Crystal Reports - Create Parameter Field



In Data Explorer view, right-click within the Parameters area → select New → New Parameter

Create Parameter Field

The Create Parameter dialog box appears → Enter a name for the parameter (up to 255 alphanumeric characters). In the dialog box, you can change the name and type of the parameter along with other properties.

Select the appropriate Data Type from the list → such as String, Number, or Date, among others.

Create Parameters

To create a parameter that allows multiple values

In the Data Explorer → right click on Parameters → select New → New Parameter

In the Create Parameter dialog box, enter a name for the parameter.

Select the appropriate Data Type from the list → Enter prompting text → Set Allow Multiple Values to True.

Now, when prompting, you can specify multiple values to be entered for the parameter.

Dialog Box

Data Set

To specify discrete or range values

For the type of value range, choose Discrete or Range.

If you select Discrete, the parameter will accept discrete values (rather than ranges of values).

If you select Range, you are prompted for parameter values. You can enter a start value and an end value. For example, if you enter the values "1" and "10", the range is 1-10, and a report that uses this parameter for filtering will display all records with values between 1 and 10. This also works for string parameters. With a start value of "A" and an end value of "H", a report that uses this parameter for filtering will display all records within an alphabetical range of A-H.

Range Values

If the Allow Multiple Values and the Discrete Options are selected, the parameter will accept multiple discrete values. You can enter more than one value, but these values will be evaluated individually and will not be interpreted as a range. If the Allow Multiple Values and Range Options are selected, the parameter will accept multiple ranges.

Advertisements