You could use a single prompt (e.g., Please enter
Account Name or ID) and by checking the type of data
using the IsNumeric() function, you can then branch
your selection logic.
Alternatively, you can use two prompts and branch the seelction logic accordingly.
Crystal does not support dynamic parameters in the sense that you can select one parameter value from a list that is based on the value of a previously selected parameter.
Example - you can't do this:
Parameter 1 = Select Name or ID
Parmaeter 2 = Either a list of names or a list of IDs depending on the value selected for Parameter 1
Instead you'll end up building 3 parameters:
Parameter 1 = Select Name or ID
Parameter 2 = Record Name
Parameter 3 = Record ID
Next, your record selection statement would use conditional If-Then-Else statements:
If
{?Parameter 1} = 'Name'
Then
{record.name} = {?Parameter 2} Else
If
{?Parameter 1} = 'ID'
Then
{record.id} = {?Parameter 2}
The downside to this is that your If-Then-Else criteria won't be processed server side; it'll be processed client-side. Performance will always be slower client-side, however, the impact depends on a variety of factors such as the number of records returned based on other selection criteria, database size, indexes, etc... If the performance is livable then this is an ok option. If performance is horrible then you may want to consider splitting this into two reports or basing the report off a stored procedure.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.