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

command with dynamic parameter

Status
Not open for further replies.

kenhamady

Instructor
Sep 10, 2000
8,794
US
CR XI, Xtreme sample database:

I created a report using a command with one parameter. I then added a normal table to the report. The table is not linked to the command and none of it's fields are used in the report. I then changed the parameter (through the report parameter screen) to be dynamic, using a field from the table as the source. It seems to work fine with one quirk - I get prompted twice for the parameter.

The first prompt seems to come directly from the command. It shows me the static default value I used in the command parameter. The value entered here is ignored. The second prompt shows me the dynamic parameter value list and the value selected here affects the data selected.

Has anyone else tried to put a dynamic parameter into a command and seen similar behavior? I think it may be a bug.

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
 
Ken,

Crystal still sees the parameter from the command line object, it was never taken out. Unless I misread and you stated you took the command line object out and still see it?

Thanks so much!
satinsilhouette
 
But there is only one parameter. When you add a parameter to a command it appears in the report field list automatically. You can then go in and load a list of default values which are shown when the command is refreshed. If you leave it as a static parameter it only prompts once. For some reason when you switch to dynamic it prompts twice.

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
 
Ken,

This makes sense to me (even though it's not desirable) in that I think commands are processed first.

Also, when using a dynamic parameter based on a command that in turn uses parameters, I've found that the parameters for the command are prompted first, the command executes, and then the parameter prompts for the report proper appear.

-LB
 
Thanks, but I am not sure that is it in this case.

My dynamic parameter uses a direct table field - not another command. So how would the command process first if it has to wait for the parameter, which in turn has to wait for the table query?

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
 
Sorry, I think I confused things by adding a comment about a different behavior--I was just commenting about another way you can get double prompts when using a dynamic parameter.

I tested your method with the same result as you mentioned. I meant to suggest that if it is true that the command is in fact the first to process, it would attempt to process before even accessing the table within CR to populate the list.

-LB
 
Ken -

Are you using R1 or R2 of CR XI? I just tried this exact same set up against the Xtreme db and I only get prompted once.

~Brian
 
I meant to say that I tried it with CR XI R2 and I only get prompted once.

~Brian
 
Lbass,

I understood you. But I really don't think the command CAN be the first to process - at least not in this case. While I can't monitor the processing on the Xtreme MDB, I know that the command SQL would be incomplete because of the parameter. It would have to wait for the parameter selection before it could run the command.



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 am using R1, so maybe it is a bug that was fixed.

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
 
Thanks to all who contributed here. I installed R2 and the created the same report config. Only one prompt. Ran the sam report in R1 and got 2 prompts. So it is a bug in R1. Not sure if the HotFixes take care of this but R2 does.

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top