SAP Knowledge Base Article - Public

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


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


Crystal Reports XI R2

Reproducing the Issue

  •  Create a sample Crystal Report against the Xtreme Sample Database
  •  Create 4 static parameters - Customer ID, Customer Country, Customer Name  and Order ID
  •  We would like to setup Customer Country, Customer Name and Order ID 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


1) Create the static string parameters as you normally would
2) When creating the number parameter, set 'Default Value' as '0'

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} 


 if {?OrderID} = 0 then true
 {Orders.Order ID} = {?OrderID} 


Save the formula and refresh the report. Now Customer ID would be the only parameter that needs to be entered, and you can see that the report will run without the other parameters as well.

See Also

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


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


SAP Crystal Reports XI R2