Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step online tutorials.

5.02 Adding Parameters

Adding Parameters

Parameters are another type of report object. The steps to add and modify them are similar to what you’ve already been doing. Add a parameter by clicking on the Field Explorer tab (on the left side of the IDE by default) and right-clicking on Parameter Fields. Then, select the New menu option. Clicking on an existing item allows the option to edit, delete or rename the item. Figure 5-1 shows this menu.



Figure 5-1. Menu option for adding a new parameter.

Once you select New, the Create Parameter Field dialog box appears, shown in Figure 5-2.



Figure 5-2. The Create Parameter Field dialog box.

This dialog box has three textboxes at the top, for entering the necessary properties: the parameter’s name, the prompting text and the value type. The Name property is how the parameter is referenced in the report. Running the report triggers the display of the Prompting Text, which should describe what the user is asked to enter. The Value Type property selects the data type for the parameter field. All the available data types are listed in this dropdown box.

The lower half of the dialog box lets you set the options for the data that the parameter can store. Table 5-1 describes four options.

Table 5-1. Options for parameter fields

Option Description
Discrete value(s) The user must enter must a single value.
Range value(s) The user enters two values that are the beginning and ending points of a range. The range includes the values entered. For example, if you entered a range of 1,000 and 1,999 then it would include all numbers from 1,000 up to and including 1,999.
Discrete and Range values The user can enter both discrete and range values.
Allow multiple values Allow a parameter to accept more than one value.