Providing a default value
BIRT does not require you to specify a default value for each report parameter. Typically, however, you should provide one. If you do not, the user must specify a value to generate the report. It is particularly important to specify a default value if you present the report parameter as a text box in which the user has to type a value, rather than a list box from which the user selects a value.
The default value can be any value from the data set field that is bound to the report parameter. You should, however, specify a value that most users would select, such as Active for an account status. Another option is to specify a value that appears most often. If the field contains unique values, such as an order ID or a customer ID, it is typical to specify the first ID as the default value, particularly when using a list box or combo box to display a list of values.
When setting the default value, you can type a literal value or write an expression. For example, to display the current date as the default value for a date parameter, use the expression new Date( ).
How to provide a default value for a report parameter
This procedure assumes that you already created a report parameter.
1 In Data Explorer, expand Report Parameters, then double-click the report parameter to edit.
Edit Parameter displays the current property settings for the selected report parameter. Figure 13‑16 shows an example of a report parameter with no value specified for Default value.
Figure 16-12 Property settings for a report parameterFigure 16-12 Property settings for a report parameter
Figure 13‑16 Property settings for a report parameter
2 Depending on the display type that you select, complete one of these tasks:
*If the display type is text box, in Default value, type a value or an expression. To type a value, choose the Constant button. To create an expression, choose the expression builder button.
*For all other display types, specify a list of values to display, then select one value as the default value.
3 Choose OK.