Print Page | Close Window

Get SQL Query ..... HOW?

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=5583
Printed Date: 05 May 2024 at 12:27am


Topic: Get SQL Query ..... HOW?
Posted By: jverhei
Subject: Get SQL Query ..... HOW?
Date Posted: 23 Feb 2009 at 1:44pm
Dead
I've looked everywhere for how to extract the current SQL query out of a Crystal report. Why is this so dificult? Am I missing some thing simple?
 
This seems like it should be easily accesible from within the reportDocument Object.
 
I have Mr.Bischof's book .Net Programming. I've looked through the second half of the book but only see how to set the datasource programaticly and not just veiw the current datasource.
 
All I want to do is get back a simple string of "Select bla FROM bla".....
 
PLEASE HELP!


-------------
- joe



Replies:
Posted By: jverhei
Date Posted: 23 Feb 2009 at 2:32pm

In my irate state i left out some details that might be important.

Using: VS.NET 2008 and CR 11 and CR 11.5
I'm needing an iterave loop to go through all tables and sub reports. Does that make sense? I'd like to extract all the SQL queries for a given report.
 
I promise to by the 05/08 book if i can get a solution! :)
Thanks.


-------------
- joe


Posted By: jverhei
Date Posted: 24 Feb 2009 at 5:10pm

Can someone tell me whether or not this is even possible?

Not trying to be rude, I'm just desperate.  well Sick over this because I've spent so much time trying to figure it out. 

I know you guys are busy. Sorry.

-------------
- joe


Posted By: BrianBischof
Date Posted: 25 Feb 2009 at 10:43pm
Well, I see that you have CR 11.5, then you should be able to get it using the RAS object model. I cover the RAS object model in my CR.NET 05/08 book in Chapter 20 and I have many examples. But since there are hundreds of properties, I only covered the main ones that most people will need. I didn't dig into it to find this specific property. You can probably get access to it using the ReportClientDocument.getDatabaseController() method and then look at the properties of the databaseController class.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>



Print Page | Close Window