Designing reports using BIRT Studio : Filtering data : Prompting for filter values at run time : Creating a static filter parameter : How to create a static filter parameter with a list of values
 
How to create a static filter parameter with a list of values
When you create a static filter parameter, and select an available display type other than Text Box, you can create a static or dynamic list of data values to provide to the user. To create a static filter parameter with a list of values, on Edit Parameter, complete the following steps:
1 In Prompt Text, if necessary, type the display text for the prompt.
2 In Help Text, optionally type a tooltip to assist the user in selecting values for which BIRT Studio displays data.
3 Accept the default selection of Is Required. To make the parameter optional, deselect Is Required.
4 In Display Type, select an option other than Text Box from the list of options. The example in Figure 5‑24 shows the selection of List Box.
Figure 5‑24 Creating a static list of values
5 In List of Values, do one of the following:
*Select Static to create a static list of values, that the report developer specifies. If you select Static, proceed to step 6.
*Select Dynamic to create a list of values that is retrieved from the data source when the report runs. If you select Dynamic, proceed to step 8.
6 To select the values to make available to the report user when the report runs, choose Select Values.
In Find, select a value from the list of values that appears, then press Ctrl and select any additional values to display. You can also type each value in Enter value, then choose Add value. The specified values appear in Selected Values.
7 In Selected Values, select a value to set as the default value, as shown in Figure 5‑24.
*If the parameter is optional, you do not need to specify a default display value.
*If the parameter is optional, No Value appears on Edit Parameter. Select No Value to display data rows that have null values.
Choose OK. Proceed to step 10.
8 In Data Set, from the drop‑down list, select Current column (No Data Set) to create the list of values from the report table, as shown in Figure 5‑25, or select an available data set to create the list of values from the data set.
Figure 5‑25 Creating a dynamic list of values
If you selected the current column do the following:
*Choose Select Values. In Find, select a value from the list of values that appears, then press Ctrl and select each additional value to display. The first value you select is set as the default value.
*In Sort, in Sort Direction, optionally select Ascending or Descending. If you do not specify a sort direction, BIRT Studio displays the default value first, and arranges the remaining values in ascending order below the default value.
Choose OK. Proceed to step 10.
9 In Data Set, if you selected an available data set, do the following:
*In Select Value Column, select the column whose values are filtered according to the parameter condition.
*In Select Display Text, select a column from the drop‑down list, containing the values displayed to the user. For example, you can choose to display the office code values for the user to choose from, instead of the names of sales office cities.
*Choose Select Values. In Find, select a value from the list of values that appears, then press Ctrl and select the remaining values you want to display. The first value you select is set as the default value.
*In Sort, specify a field by which to sort the list of values.
*In Sort Direction, select Ascending or Descending from the drop‑down list.
If you do not specify a sort direction, BIRT Studio displays the default value first, and arranges the remaining values in ascending order below the default value.
Choose OK.
10 On Filter, choose OK.
11 Test the prompt in BIRT Studio by choosing Parameter. Parameters displays the prompt, as shown in Figure 5‑26. In this example, the default parameter value is Boston.
Figure 5‑26 Parameters displaying the specified prompt