We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now


Get complete Crystal Reports SQL statement via C# code

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.

Watch Question


Sorry, Meant Crystal Reports XI (11) not X1. Thanks
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...


Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts


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.

I've never gone looking for it before, but I was surprised that it wasn't exposed also...
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013
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

Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.