Specifying filter conditions at report run time : Enabling the user to specify a filter condition : Creating a dynamic filter report parameter
 
Creating a dynamic filter report parameter
A dynamic filter report parameter differs from a regular report parameter in one important aspect. Using a dynamic filter parameter, you can provide report users with a list of operators, which they can use to construct their own filter condition.
Figure 17‑1 shows an example definition of a dynamic filter parameter where the display type is a text box. Aside from the Dynamic Filter Condition section, where you specify the column on which to filter and the operators to provide to users, the properties are similar to the properties for a regular report parameter.
 
Figure 17‑1 Properties of a dynamic filter parameter whose display type is a text box
Like the regular report parameter, a dynamic filter parameter can also provide the user with a list of values. However, values can be presented in a combo box or list box only. Figure 17‑2 shows an example definition of a dynamic filter parameter that includes a list of values. The display type is set to Combo/List Box.
 
Figure 17‑2 Properties of a dynamic filter parameter whose display type is a combo box or list box
How to create a dynamic filter report parameter
1 In Data Explorer, right-click Report Parameters, and choose New Dynamic Filter Parameter.
2 Specify the properties of the dynamic filter parameter. For information about the standard properties for a report parameter, see BIRT: A Field Guide. The following Dynamic Filter Condition properties are specific to a dynamic filter parameter:
*In Column, type the name of the field on which to filter.
*In Operator, select the operators to provide to the user. By default, all the operators are selected. To remove an operator, select it and click <.
*Optionally, set one of the operators as the default. Select the operator, then choose Set as Default. A check mark appears next to the operator. If you specify a default operator, you must also specify a value in Default Value.
3 Choose OK.
Making a filter parameter optional
When you create a dynamic filter parameter, you can require the user to specify a value or you can make the filter optional. It is usually good practice to make the filter optional, so that the user can view a report with all the data. For example, if a report displays inventory data by vendor and you create an optional parameter to filter on vendors, the user can select No Condition to view inventory data for all vendors.
On the other hand, you can require that the user specify a value if displaying all the data results in a very long report. A report that runs into hundreds of pages is not only difficult to read, but the report takes longer to generate.
To make a filter parameter optional, deselect the Is Required property.
Accepting multiple values
Users often want to select any number of values for a filter condition. In an inventory report, for example, the user might need to view data for several vendors. To support the selection of multiple values, create a dynamic filter parameter as follows:
*Select Combo/List Box as the display type.
*Select the In operator as one of the operators to provide to the user.
*Create a list of values.