Solved

View Crystal Reports SQL Query

Posted on 2009-06-29
7
813 Views
Last Modified: 2012-05-07
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!
0
Comment
Question by:grossman52
7 Comments
 
LVL 17

Expert Comment

by:pssandhu
ID: 24739684
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.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 24739997
if you start the profiler in SQL server, you will find the query that is received by SQL Server.
0
 
LVL 1

Author Comment

by:grossman52
ID: 24740297
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
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 17

Expert Comment

by:pssandhu
ID: 24740474
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.
0
 
LVL 1

Author Comment

by:grossman52
ID: 24741158
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
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 24741632
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
0
 
LVL 1

Accepted Solution

by:
grossman52 earned 0 total points
ID: 24745893
Thanks for the response but I am using VB.Net 2005.  I found  a way to display the SQL by using the ODBC Query Profiler option.  The SQL will get written to a file when you choose this option.  This should do the trick.

thanks
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

810 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