Link to home
Start Free TrialLog in
Avatar of grossman52
grossman52

asked on

View Crystal Reports SQL Query

How can I display the SQL query that Crystal sends to the database when I run a report using the crystal reports viewer in VB.Net (visual studio 2005).  Basically I am looking for the runtime version of Show SQL Query feature in the designer.

thanks!
Avatar of pssandhu
pssandhu
Flag of Canada image

In Crystal Report, click on Database>Show SQL Query from the menu bar on top. I am using CR vs 10 as a standalone product and not using .NET to build reports. Hopefully the instructions will be the same in both the cases.
P.
Avatar of Éric Moreau
if you start the profiler in SQL server, you will find the query that is received by SQL Server.
Avatar of grossman52
grossman52

ASKER

Thanks for the response.  Unfortunately the database is not SQL Server but a flat file data structure accessed via ODBC.  Tried using the trace utility to spit out the SQL but did not produce the needed results.  Is there a property of the report that contains the SQL after it is constructed?  I did not see one but thought I would ask.
Thanks
Not sure. The only way I know is what I posted above through Database?Show SQL Query. I know for a fact that it worls for Databases and Excel files.
P.
Thanks for the suggestion but I need to see the information at run time.  I am running a report throguh a crystal viewer (passing in parms) and am not getting a row back.  I get a row back when I run the report from within crystal.  The generated SQL query must be incorrect but w/o being able to view it, I cannot diagnose the problem.

thanks
The is a property for th eSQL QUery in the report object.

You might try displaying it in code.

With the VB6 API it is

crRptObj.SQLQuery

mlmcc
ASKER CERTIFIED SOLUTION
Avatar of grossman52
grossman52

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial