cancel
Showing results for 
Search instead for 
Did you mean: 

Parameter Field - please help

Former Member
0 Kudos

Hello

I am using Crystal Report ver 10. I have three parameter fileds define in my report;

1) Crew (string - values are predefined in history table. They can be more then one)

2) Employee Last Name (string - values are predefined in employee table. They can be more then one)

3) Date Range

I would like to make these parameter fields NOT mandatory. Currently report don't run until I have select or enter data in each of these fields. Is there a way that these fields can become optional and filter data user provided. Any help or suggestion would be greatly appreciated.

Thanks

Syed

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Yes, you can make a parameter optional. Please follow following steps:

1. Create a parameter for example "My Parameter". Add a value namely "All" to the values. In the Default Value specify "All" as the default value.

2. Modify the record selection formula as follows:

if {?My Parameter}= 'All' then true else {?My Parameter}={Customer.Country}

Here this report will return all the countries by default when user selects "All" else it will return records for the country selected by the user.

Hope this helps!!

FYI: CR 2008 has a new option which allows to make the parameter optional.

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks for your help but this formula did not work. Selecting ALL returns no results to the query. I think because in the database ALL means nothing. Any other suggestions?

Former Member
0 Kudos

Is the "All" that you used "ALL" or "All"? The comparison is case sensitive, so make sure they are the same (or use UCase() ).

Also, are you passing the parameter to an SQL Command? If so, you have to put this logic in there, not in a formula field.

HTH,

Carl