Get complete Crystal Reports SQL statement via C# code

Posted on 2007-07-19
Medium Priority
Last Modified: 2013-11-07
In C#, (Visual Studio 2005) I need to use the native Crystal Reports objects to get the complete SQL statement as it appears when you view it in Crystal Reports.

In Crystal Reports X1, Go to "Database > Show SQL Query..." ... That is what I need to get via C# code. I can get bits and pieces of parameter info etc but I just want the whole SQL statement.

Question by:udsllc
  • 2
  • 2

Author Comment

ID: 19526100
Sorry, Meant Crystal Reports XI (11) not X1. Thanks
LVL 42

Accepted Solution

frodoman earned 1000 total points
ID: 19530337
Hi udslcc,

I've been double checking this since yesterday and I've come to the conclusion that there isn't a way to get the SQL statement out.  As far as I can tell, it's built internally and isn't publically exposed...


Author Comment

ID: 19530691
Thanks for your time frodoman. This seems like such a simple thing. I wonder why they would not expose it. I can understand making it read-only but not providing it at all is in my opinion just wrong.
LVL 42

Expert Comment

ID: 19532743
I've never gone looking for it before, but I was surprised that it wasn't exposed also...
LVL 101

Assisted Solution

mlmcc earned 1000 total points
ID: 19534998
There used to be a property of the report object that was the SQL query.  I don't know if that will show the SQL or not.  If it does it probably will show the original query and not any modifications made from the program

I think it is


Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating a Cordova application which allow user to save to/load from his Dropbox account the application database.
Creating a Cordova application which allow user to save to/load from his Dropbox account the application database.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Hi, this video explains a free download that you can incorporate into your Access databases, or use stand-alone for contact management. Contacts -- Names, Addresses, Phone Numbers, eMail Addresses, Websites, Lists, Projects, Notes, Attachments…

599 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question