Dynamic SQL Query

Dynamic SQL Query

Forum member · Aug 26, 2008
I have a HUGE search query builder situation where there are around 20 - 30 optional query questions. Can I dynamically create a query string in C# and pass the resulting query string to the DPLX file instead of using the Query it was created with? Please advize. ACTUALLY I would like to just simply use the dataset returned from the query that was run BEFORE I do a PDF conversion rather than having to run the query again. Is this by any chance possible and if so HOW? Thanks.

Re: Dynamic SQL Query

Support · Aug 26, 2008
Hello, Yes, you can use the query built by your C# code dynamically in the report without any problem. In order to do this you will have to use the OpeningRecordSet event of the query object. You can also assign a DataTable object you have to the report. You can refer to the Event Driven Queries topic on our help documentation. Thanks, ceTe Software Support Team.

Re: Dynamic SQL Query

Forum member · Aug 27, 2008
Thanks for the quick responce. The help files are not all that helpfull in the web area. What I have is a simple simple example. In my Page_Load I ONLY have DrawPdfToWeb("MyDemoReport.pdf"); How do I change the DataTable that is in the DPLX file (Where I have a SIMPLE SQL query in to a allready returned DataTable lets say called dtData. IN the Page_Load and not having to call other methods that I still need to write. I just simply want to report the DataTable that I allready HAVE. ? Any help with this please. Need to stream it straight to web client and not CREATE a file on the server side etc. Thanks again for the quick responce.

Re: Dynamic SQL Query

Support · Aug 27, 2008
Hello, Can you please send an email to our [^a|mailto:support@cete.com|Support Team^], so that they can send you an example that shows how to generate reports using data from the DataTable. Thanks, ceTe Software Support Team