Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Get SQL Query ..... HOW? Post Reply Post New Topic
Author Message
jverhei
Newbie
Newbie


Joined: 23 Feb 2009
Location: United States
Online Status: Offline
Posts: 6
Quote jverhei Replybullet Topic: Get SQL Query ..... HOW?
    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
IP IP Logged
jverhei
Newbie
Newbie


Joined: 23 Feb 2009
Location: United States
Online Status: Offline
Posts: 6
Quote jverhei Replybullet 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
IP IP Logged
jverhei
Newbie
Newbie


Joined: 23 Feb 2009
Location: United States
Online Status: Offline
Posts: 6
Quote jverhei Replybullet 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
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet 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>
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.016 seconds.