?
Solved

View Crystal Reports SQL Query

Posted on 2009-06-29
7
Medium Priority
?
820 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Use Filtering Commands to Process Files in Linux

Learn how to manipulate data with the help of various filtering commands such as `cat`, `fmt`, `pr`, and others in Linux.

 
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 101

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

Docker-Compose to Simplify Multi-Container Builds

Our veteran DevOps Author takes you through how to build a multi-container environment, managed with a single utility in order to simplify your deployments.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

777 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