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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to delete an SQL expression in my Crystal Report

Status
Not open for further replies.

AndersonCJA

Programmer
Jul 30, 2003
57
US
Hi, Here is an interesting problem. I'm working with a Crystal Report xi using Oracle. Before I changed the report, I had a working sql expression.
The modification made to the report was to replace one table with another, I added the new table, changed the group from the old table to the new table and then removed the orignal table. I neglected to remove the sql expression first. It is no longer needed since I am removing the table that holds multiple records and relied on the sql expresson to select the relevent record. The sql expression will not work and sends an error, "argument is not valid". Using Field explorer, I can not see the sql expression or the tag to create a new one. In an attempt to correct this problem, I re added the first table and changed the group back to what it was. That did not help. Also when I refresh the report, I end up in the formula workshop, I can see a folder in the top left that shows, "Error in compiling sql expression" and the sql expression. I right click on it, and can see the option to delete, however the delete is inactive it does not accept my click. I also removed the code from the expression-not helpful either.
Any ideas on how to delete the sql expression? Thank you -
 
If you can delete the code you should be able to change it to something else. If so can you simply put a single field in as the expression? It might like that better than a blank expression and that will probably be valid.

But it sounds like you may have corrupted the report.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
I went to the report to try your suggestion. But last night while working with this problem, I had done several copy, and cuts, and the report I had to work with this morning was not sending the same error I was getting yesterday.

Insteading it is sending, "More than one data source or stored procedure has been used in this report. Please be sure that no sql expression is added and no server side grouping is performed."

I probably got it yesterday too, but bypassed it without noticing. I was only using one data source. Or so I thought. Today I still could not get to the sql statement or get the error.

I noticed that although I am using only one data source, I had to sign on twice. I then used set database location on every table in the report to insure they listed under the same data source. (I had two with the same name. Maybe something changed in the datasource, one old, one new?).

Then when that was complete and the report was saved, I was able to access the sql statement.

I hope I didn't waste your time or anyones time and I do hope that this information might help someone else with a similiar struggle. Thank you so much for your help Ken. I appreciate and value your advice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top