Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Editing a SQL Query - Adding new Fields to a Report

Status
Not open for further replies.

christinh

Instructor
Jan 24, 2001
6
US
I am currently using a Crystal SQL Query Designer QRY file as the datasource for my Crystal Report. (Not sure if this matters, but I enter the SQL statement manually rather than using Crystal's table linking tool.)

I found that if I need to edit the QRY file, i.e., add additional fields to the query, I can't find a way to add those new fields to mt report. -- I've tried to add the fields via the Insert fields tool and via the Report Expert with no luck.

So, when this happens Ive been creating the RPT file from scratch again, which is a major PAIN!

I'm figuring there MUST be an easier way to do this!!! Does anyone know of a way to edit the SQL and then edit the report that uses the QRY as its datasource????

Thanks in advance for any help!
 
I have had this problem, too. First be sure to save and close the query in the SQL Designer, and close and re-open the report in CR.

Sometimes when I modify the .qry in the Crystal SQL Designer, I can see the changes in the CR Field Explorer right away; sometimes I have to use Database/Set Location to relink the query: use the Metadata/Query node in the Data Explorer, click on "Crystal SQL Query Files to open a File Open dialog, Open your .qry file (be sure you are in the correct folder), and click the Set button in the Data Explorer.

If this does not work, save and close your report and shut down the Crystal Reports app. Re-open CR and your report and look for the new or changed data fields in the Field Explorer. I don't know WHY shutting down CR refreshes the query, but usually it does.

Crystal SQL query-based reports are a little quirky. It has taken a lot of trial-and-error to learn how to use them.

Note that if you remove or rename a query field in the SQL Designer, that field will be removed from your report with no option to re-map it when you re-open the report.
 
Actually, you need to close CR completely, reopen the report, and then use the Database - Verify Database in that report. This will force it to reread the fields in the QRY. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top