Symptom
- Cannot use null values in the 'Enter Parameter Values' dialog box
- Error: 'The value is not valid'
Environment
- SAP Crystal Reports 2013
- SAP Crystal Reports 2016
- SAP Crystal Reports 2020
Reproducing the Issue
- In Crystal Reports, create report with a parameter.
- Create a formula using the parameter.
- Refresh the report.
- Assign no value to the parameter in the 'Enter Parameter Values' dialog box, and click "OK"
Cause
- By default, parameter are mandatory, and requires a value.
Resolution
- Set the parameter to be optional:
- In Crystal Reports, open the report.
- In the Field Explorer, right click on the parameter you want to be optional, and select "Edit"
- In Edit Parameter, under "Value Options", set the option "Optional Prompt" to: True
- Click "OK"
- Note:
If you have any formulas refering the parameter, modify the formulas and use the function "HasValue" to find if the parameter has value, or not. For example:
If hasvalue({?My Optional Parameter}) Then {?My Optional Parameter} Else "No Values"
- Optional parameters have been implemented since Crystal Reports 2008
Keywords
list of values, entry, empty, '...' , LOV , KBA , crystal reports , prompt , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem
Product
SAP Crystal Reports 2013 ; SAP Crystal Reports 2016 ; SAP Crystal Reports 2020