SAP Knowledge Base Article - Public

1517536 - How to create Optional Parameters in Crystal Reports XI R2


When creating static parameters in Crystal Reports XI R2, we do not have an option to set some of the parameters as 'Optional'


Crystal Reports XI R2

Reproducing the Issue


  •  Create a sample Crystal Report against the Xtreme Sample Database
  •  Create 3 static parameters - Customer ID, Customer Country and Customer Name
  •  We would like to setup Customer Name and Customer Country as optional, however we do not have any predefined option to setup the parameters as optional


This functionality is not available in Crystal Reports XI R2. This has been implemented in Crystal Reports 2008 as an enhancement where the record selection makes use of the 'hasvalue()' function


As a workaround we need to modify the record selection formula.

Once the parameters have been setup, create a record selection formula as follows:

{Customer.Customer ID} = {?ID}


 if {?Country} = "" then true
 {Customer.Country} = {?Country}


 if {?Name} = "" then true
 {Customer.Customer Name} = {?Name} 

Save the formula and refresh the report. Now Customer ID would be the only parameter that needs to be entered, whereas all others would be optional.

See Also

1517565 - How to Create 'Optional Number Parameters' in Crystal Reports XI R2


Optional Parameters, Crystal Reports XI R2 , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To


SAP Crystal Reports XI R2