Solved

View Crystal Reports SQL Query

Posted on 2009-06-29
7
809 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 69

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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Saveas need to save a copy 16 26
How do ASP.NET and MVC work together? 4 27
Class object 2 26
How would you add MULTITHREADING to the attached C# code? 4 51
It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
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 …

911 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now