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

Parameters

Status
Not open for further replies.

AllpayRog

Technical User
Nov 10, 2008
17
GB
Hi Everyone,

I have created a parameter with 2 values ( for example A and B).
If A is selected the report will appear as normal based on a set value.
If B is selected I would like another parameter to appear prompting the user to enter another value.
Is this possible?
i.e. Is it possible to make a second parameter appear only if the results of the first parameter = B?

Perhaps this can be done in a formula?

Thanks in advance for any help....

Best regards to all
Roger.
 
At least in Crystal 10, it's not possible to control the appearance of one parameter based on another parameter. The second parameter will always be obligatory unless it has a default option, in which case it will always be optional.

The best you could do is to have the parameters in the main report, and have most of the processing in a subreport, with the parameters passed down using Edit > Subreport Links. The section with the subreport could be suppressed if the combination is not valid. Another section could appear with a warning message. This avoids wasting processing time on a run that you don't want.

It always helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thanks Madawc

Yes, should have put the version ...it's CR IX (Professional)
 
Are your two values based on a field or are they static text? You can use dynamic, cascading parameters in XI, but they should be based on fields.

As an alternative, using static parameters, you could add a second parameter with prompt text like this:

if Parameter1 = "B" then select a value for Parameter2; otherwise select "None"

The "None" selection should appear in the parameter pick list, but isn't really necessary for the report to work--it just will make more sense to the user.

Set up your record selection formula like this:

(
(
{?Parm1} = "A" and
{table.field1} = {?Parm1}
) or
(
{?Parm1" = "B" and
{table.field1} = {?Parm1} and
{table.field2} = {?Parm2}
)
)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top