Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: "View SQL Query" in code. Post Reply Post New Topic
Author Message
Chronicide
Newbie
Newbie


Joined: 19 Jul 2011
Online Status: Offline
Posts: 10
Quote Chronicide Replybullet Topic: "View SQL Query" in code.
    Posted: 08 Aug 2011 at 10:39am
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
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 09 Aug 2011 at 2:27am
I don't know how to pull the sql out...we chose to go the other direction....
we have the application gather the data (using a wizard to gather the parameters) and then we 'push' the data to CR.
 
good luck
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.