Prompting for filter values at run time
You can create a prompt that accepts a value or multiple values for a filter when a report is run. A prompt, also called a parameter, enables users reading the report to control the content of the report without editing the report. For example, in a report that displays sales data by sales office, instead of creating a filter that returns data for a specific office, you can create a prompt that asks the user to select the office for which they want to view data in the report.
Understanding parameters
In Report Studio, you can create a static or dynamic filter parameter at the data set level or at the report table level.
To construct a filter parameter, complete the following tasks:
*Choose a filter parameter type.
*Define a condition.
*Specify whether the parameter is required or optional.
*Specify a display type.
*Specify a list of values from which a user can select values. You can specify a static list or a dynamic list. You can create a dynamic list of values at the data set level or at the current column level.
Choosing a parameter type
A static filter parameter is a filter condition that the report developer defines, which prompts the user to specify one or more values when running a report. The filter condition typically consists of an operator, specified by the report developer, and corresponding values to be specified by the report user when running a report.
A dynamic filter parameter differs from a static filter parameter in one important aspect: the report developer can provide report users with a list of operators to use to construct a filter condition. The user selects an operator, then specifies one or more corresponding values when running the report. The report displays data for the filter parameter condition the user constructs.
Making a filter parameter optional
When you create a prompt, you can require the user to specify a value, or you can make the value optional. If you make the value optional, the user can view the report with all the data. For example, if Parameters contains a list of sales offices for the user to choose from, if the prompt is not required, the user can leave the field blank to view sales data for all the sales offices.
You can require that the user supply 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 takes longer to generate. In Report Studio, a dynamic filter parameter is always optional.
How to make a prompt value optional
To make a prompt value optional, complete the following steps:
1 In Filter, select Prompt Text. Prompt Text and Is Required appear highlighted.
2 Deselect Is Required, as shown in Figure 11‑10.
Figure 11‑10 Specifying an optional prompt
Accepting multiple values
Users often want to select several 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 filter parameter as follows:
*Select 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.
Specifying a display type
When specifying properties for a static filter parameter, you can select the display types shown in Table 11‑2 for the list of values. When specifying properties for a dynamic filter parameter, you can specify List Box or Text Box as the display type.
Table 11‑2 Choosing a display type for the list of values
Combo Box
Provides a combination of a drop‑down list and a text box, where the user can either select a value from the list or type a value
Enables the user to select one or more values, or type a specific value for which Report Studio displays data.
List Box
Displays available values in a drop‑down list
Enables users to select one or more values. If you use the In operator, the list box is the only available display type.
Radio Button
Displays the values as radio buttons
Enables the user to select one value at a time. Additionally, this option enables a report developer to provide the user with a limited number of values from which to choose.
Text Box
Requires that the user type a value
Enables the user to type a value for which Report Studio displays data.
Text Box‑Auto Suggest
Provides the user with the available values that match a certain number of typed characters
Activate auto suggest after any number of typed characters. For example, if you activate auto suggest after one character, and if the user types S, all the values beginning with that character appear in a list from which the user selects a value. In case there is no match, Report Studio displays the message No Suggestions.
Providing the user with a list of values
To create a useful prompt, provide the user with a list of values from which to choose, since it is not always possible for the user to know what value to type. In some cases, providing a list of values, such as customer names or invoice numbers, is necessary.
You create a list of values using one of the following techniques:
*Create a static list of values.
In a static list, the values you select to display to the report user are fixed in the BIRT design. You can either select from a list of values, or type values to populate the list of values. Create a static list if you want to control the list of values displayed to the report user, for example, if you want to display only some of the values.
*Create a dynamic list of values.
In a dynamic list, the software generates the list of values when the report runs, using the current values in the report table or the data set. You can create a dynamic list of values at the data set level, or at the report table level. Create a dynamic list for values that are frequently updated in the data source, such as new customer names or product names.