?
Solved

Get complete Crystal Reports SQL statement via C# code

Posted on 2007-07-19
7
Medium Priority
?
1,936 Views
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.

Thanks
0
Comment
Question by:udsllc
  • 2
  • 2
5 Comments
 

Author Comment

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

Accepted Solution

by:
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...

frodoman
0
 

Author Comment

by:udsllc
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.
0
 
LVL 42

Expert Comment

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

Assisted Solution

by:mlmcc
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
rptObj.SQLQuery

mlmcc
0

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