Hey everyone... I was windering how I might be able to get the SQL code executed by a report via c# or vb.net.
I'm sure it must be somewhere in the ReportDocument class, but I can't find it. What I'm looking for is the same as selecting "database --> show sql query" in the designer.
My reason for this is that I have found reports that are programatically given their data in a dataset to be a lot more stable/faster to render. I would like to pull the required query from the report, submit the query to the sql sever from the application, then push the returned dataset to the report before exporting to .pdf.
In tests (using a known SQL Query hard coded) the difference in responce times can be 5-10 minutes for large reports. If I can extract the query from the report itself, I can create a simple extension method to export any given .rpt file to pdf.
I would appreciate any help that any one might be able to offer.
- Scott