SAP Knowledge Base Article - Public

1751918 - Mandatory parameter not enforced in Crystal Reports

Symptom

  • Report refreshed without entering value for mandatory parameter(s). 
  • It is possible to leave mandaroy string parameter blank in Crystal Reports, and the report will still sucessfully refresh.
  • How to ensure user enter a values for mandatory parameters in Crystal Reports?

Environment

  • SAP Crystal Reports 2008
  • SAP Crystal Reports 2011
  • SAP Crystal Reports 2013
  • SAP Crystal Reports 2016

Reproducing the Issue

  1. In Crystal Reports, create a report off any data source.
  2. Create a parameter, and set the data type to: String.
  3. Set the parameter option: "Optional" to False.  ( This will make the parameter mandatory )
  4. Add the parameter to the report.
  5. When refreshing the report, it prompt for the parameter. If no value is entered for the parameter, it still refresh the report,
    when the expectation is a value is required for the parameter, before the report can be refreshed.

Cause

  • It is not required to enter any values for string parameter, as blank is an acceptable value for parameter of data type string, but not for any other data types.

Resolution

  • To make it mandatory to enter a value for a  String Parameter in Crystal Reports, do one of the following:
      
    • Edit the parameter and set the Mask option to: "Aaaaaaaaaaaaaaaaaaaaaaaa"
      (Add as many "a" as the maximum length for the parameter); OR
           
    • Set the parameter option:Minimum Length to 1 character.

Keywords

CR, Mandatory, required entry , KBA , BI-RA-CR , Crystal Reports designer or BusinessViews Manager , Problem

Product

Crystal Reports 2008 V1 ; SAP Crystal Reports 2011 ; SAP Crystal Reports 2013 ; SAP Crystal Reports 2016