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!

Parameters copied and pasted keep vanishing 1

Status
Not open for further replies.

Madawc

Programmer
Sep 5, 2002
7,628
GB
I am enhancing two rather similar reports, each of which needs to be able to choose data from either one of the last 7 days or one of the last 12 months. For the first of these, I created two parameters with pre-set value. So far, so good.

Enhancing the second report, I naturally copied some of the Formula Fields that I had already developed and tested. And also the two parameters. During my testing this seemed all fine. But the next day, when I was wishing to continue testing, I found that the parameters had vanished. They were still referenced in Formula Fields but were missing.

Testing, I confirmed that they vanish whenever I closed the report. It's also probably important that the two parameters were created from within an SQL Command.

Has anyone else come across this?

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
I have only seen Command Parameters disappear if the Command is updated. I have to delete and reinsert parameters whenever I amend it.

Are you changing command or some how refrteshing it whenever you save report?

Ian
 
Sorry, I was unclear. The first report needed to be converted from direct access to an SQL Command, and I added the parameters to the Command. (The only way it can be done, as far as I know.) But the second report was OK with direct access from the tables.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
If you referenced the parameters created in the command in the body of the command, then they should not disappear. If they are not referenced, I think they will be discarded, regardless of whether you have referenced them in formulas in the body of the report, since the command executes first.

-LB
 
I know that you can't create a parameter in an SQL command without also using it in that command. What surprised me was that the same parameters vanished when copied to a report that did not use an SQL Command. But probably they 'remember' where they began, even though they appear to be normal parameters.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
There are differences in the internal representation of parameters in the .rpt file based on whether they're command parameters or regular parameters. I suspect that this difference is causing your parameters to disappear when saving the second report - there is no command, but the parameters you've pasted "belong" to a command, hence they're deleted. You'll probably need to create them from scratch in the second report.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Thanks, hilfy. That makes sense.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top