SAP Knowledge Base Article - Public

1473287 - Error: 'the value is not valid' when a null value is entered in the parameter in Crystal Reports

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

  1. In Crystal Reports, create report with a parameter.
  2. Create a formula using the parameter.
  3. Refresh the report.
  4. 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:

    1. In Crystal Reports, open the report.
        
    2. In the Field Explorer, right click on the parameter you want to be optional, and select "Edit"
        
    3. In Edit Parameter, under "Value Options", set the option "Optional Prompt" to: True
        
    4. 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