Chapter 4 - Selecting Records with Parameters
This chapter first shows you how to filter data using the Select Expert and then shows you how to create advance filters using parameters. Parameters are covered in great detail because they are also used within report formulas and for custom formatting. The effective use of parameters within record selection formulas and custom formatting lets you create dynamic reports that are tailored to each specific user.
Multiple, Discrete and Range Values
The last three options we haven't discussed yet are for parameters that have more than one value associated with them. A parameter has the flexibility to store a single value, a range of values, or a combination of the two. This gives you a lot to think about when deciding which is appropriate for each parameter. Since these three options can be used in conjunction with each other, it's best to get an overall understanding of them at the same time.Discrete parameters are good when you need to store a single value. An example is when you want to print a report based on a Company Id. Another example is storing a Boolean value that determines when a report feature to be displayed or hidden.
Range values give you more flexibility by allowing you to set a start and end point of acceptable values. Any value that falls within this range is included. This is useful anytime you want to print multiple values and these values have a definite starting point and ending point. Range values are frequently used when filtering dates because you can set the beginning and ending dates and all dates in between get included.
Parameters let you go one step further by combining both discrete values and range values into the same parameter. These are called multi-value parameters. A multi-value parameter is a list of different values (i.e. an array of values3). This gives the user the ability to create a list of acceptable values that can be discrete values, range values, or a combination of the two. This can result in a complex list of acceptable values. For example, consider financial reports which are often based on account codes. Each type of account category (assets, liabilities, etc.) is represented by a starting and ending range. An auditor that is investigating fraudulent information could print out certain related accounts by entering multiple account codes such as 10000-11000, 50000-51000, and the individual accounts 05928 and 05970. The multi-value parameter lets all the accounts be printed on the same report for easier analysis. If the report didn't use a multi-value parameter then each! of these accounts and account ranges would have to be printed on a separate report and pieced together. Table 4-3 shows a summary of the different type parameter options.
Table 4-3. 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. |
| Allow multiple values | Allow a parameter to accept more than one value and store them as a series. |
Now that you understand the different data types and options available for parameters, let's look at how to create parameters in a report.
To read all my books online, click here for the Crystal Reports ebooks.

Become a Crystal Reports expert with the authoritative resource available.
The tuturials and tips in this book will take your skills to the next level.