Specifying parameter values
When scheduling a file containing parameters, you can specify parameter values based on which Information Console retrieves data to display in the file. For example, when running a design such as Customer Order History.rptdesign, you can select a customer from the list to view their order history, as shown in Figure 3‑5. Parameter fields can use one or more lists, from which you select a value, a text box in which you type a value, or a combination text box and list, in which you can either type or select a value. Some parameters can also require selecting a comparison operator.
Figure 3‑5 Specifying parameters
Report developers use parameters to enable users to specify values for which they need to view data. User input can define the records retrieved, the sorting sequence of the data, and the output format for a report.
If a file uses parameters, the user sets the parameter values when running the file job or uses the default parameter values set by the developer. If a report parameter file is available, the user generates a report and report parameters are loaded using predefined values.
Understanding parameter types
Information Console supports the following parameter types:
*Single value
A single-value parameter accepts one value to filter the document data. For example, a report that provides sales information by customer requires the user to select a customer from a list of existing customers.
*Multiple value
A multiple-value parameter accepts more than one value to filter the document data. For example, a report that provides sales information about products sold can prompt the user to select multiple products.
*Optional
A user can select or group the data presented in a report by typing values or conditions into the optional parameter. If a user does not specify a value for an optional parameter, the job uses a value set by the report developer.
*Required
In a required parameter, the user must supply a value before the job can run. For example, a report that accesses a database can require a user name and password or require a user to select a city before running the report. Typically, a report designer supplies a default value for a required parameter.
*Cascading
When working with cascading parameters, available options depend on other parameters. For example, in a parameter that requires you to specify a country and city, the city list is populated based on the country selected in the previous field.
*Dynamic filter
A dynamic filter parameter uses an operator and one or more values to retrieve or filter data from a data set. This data appears in the tables, charts, maps, or other presentation formats built into the report.
Figure 3‑6 shows a range of parameters prompting the user to supply values.
Figure 3‑6 Using parameters to customize data displayed in a report
Using multiple-value parameters
Multiple-value parameters consist of drop-down lists or check lists. After you specify the values for a multiple‑value parameter, the resulting document displays data only for those values. For example, when you select some years in a multiple-value parameter, the generated report displays data only for the selected years.
Using a dynamic filter parameter
Dynamic filters appear in BIRT design and document files. When you work with a BIRT file containing dynamic filter parameters, Information Console prompts you to select from a list of operators and supply a value. These choices define an expression used to select data to display in the document. The developer specifies which operators are available to the user when creating the filter parameter.
Dynamic filters support multiple values and complex string expressions, depending on the operator. The output file displays data based on evaluating the expression.
Figure 3‑7 shows an example of using dynamic filter parameters to create an expression.
Figure 3‑7 Using dynamic filters
Table 3‑7 lists the possible operators you can use in a dynamic filter parameter.
Table 3‑7 Dynamic filter operators
Operator
Usage
Between
Finds data that is between two specific values
Equal to
Finds data equal to a specific value
Greater than
Finds data greater than the specific value
Greater than or equal to
Finds data greater than or equal to the specific value
In
Finds data that matches any of the selected values
Is false
Finds data that equals zero
Is not null
Finds data that does not have a null value
Is null
Finds data that has a null value
Is true
Finds data that does not equal zero
Less than
Finds data less than the specific value
Less than or equal
Finds data less than or equal to the specific value
Like
Finds data matching the value’s string pattern
Match
Finds data matching the value’s string expression
No condition
Finds all values for this parameter
Not between
Finds data that is not between two specific values
Not equal to
Finds data not equal to a specific value
Not in
Finds data that does not match any of the selected values
Not like
Finds data not matching the value’s string pattern
Not match
Finds data not matching the value’s string expression
The Like operator supports using special characters as follows:
*% matches zero or more characters. For example, %ace% matches any value that contains the string ace, such as Ace Corporation, Facebook, Kennedy Space Center, and MySpace.
*_ matches exactly one character. For example, t_n matches tan, ten, tin, and ton. It does not match teen or tn.
The Match operator is case-sensitive and supports special metacharacters that combine to form text patterns called regular expressions. For example, using ^H.*(Gifts|Collectables)$ to search through a list of company names matches all companies whose name starts with the letter H, has one or more letters after H, and includes the word Gifts or Collectables at the end of the name. To match using a metacharacter, a backslash (\) followed by the metacharacter causes the search to interpret the metacharacter as a normal character. For example, to look for a string containing the '$' metacharacter, type the character preceded by a backslash (\) in the search expression, as follows:
\$
Table 3‑8 lists the metacharacters available to form regular expressions with the Match operator.
Table 3‑8 Regular expression metacharacters used with Match
Metacharacter
Usage
.
Matches any single character.
*
Matches the previous character zero or more times. For example, po* matches Liverpool and Leipzig.
!
Matches everything not equal to the search expression.
( )
Matches all characters in the set between the parentheses.
|
Matches if any one of multiple conditions is true.
[ ]
Matches any character in the set between the brackets.
[ ^ ]
Matches any character not in the set between the brackets.
+
Matches the previous character one or more times. For example, po+ matches Singapore and Liverpool but not Leipzig.
?
Matches the previous character zero or one times. For example, po? matches Singapore and Leipzig.
x{y}
Matches the previous character exactly y times. For example, o{2} matches Liverpool but not Lyon.
^
Matches the start of the string. For example, ^A matches Australia but does not match Los Angeles.
$
Matches the end of the string. For example, n$ matches Lyon.
\
Used with a metacharacter to make it a literal character. For example, to search for a string containing a $ symbol, use \$.
\A
Matches the start of a string.
\b
Matches the edge of a word, beginning, or end.
\B
Matches any place inside a word, but not the edge of a word.
\d
Matches any decimal digit.
\D
Matches any non‑digit character.
\s
Matches a space.
\S
Matches a non‑space.
\w
Matches a word that is made of letters, numbers, or an underscore.
\W
Matches a non-word.
\Z
Matches the end of a string.
Table 3‑9 provides examples of dynamic filter expressions.
Table 3‑9 Example results for dynamic filter expressions
Operator
Values
Matches
Does not match
Between
'A'
'D'
'Barcelona'
'Dublin'
'Zurich'
'Seattle'
Greater than
'Oslo'
'Oulu'
'Paris'
'Oslo'
'NYC'
In
'Lyon'
'New York'
'Lyon'
'New York'
'London'
'New Haven'
Is false
 
'0'
'11'
Like
'A%'
'Amsterdam'
'Auckland'
'Zurich'
Like
'B___'
'Bern'
'Berlin' or 'Boston'
Like
'Be%n'
'Berlin' or 'Bern'
'Bergamo'
Like
'%& Co%n'
'Handji Gifts& Co'
'Models & Co.'
'Boards & Toys Co'
'Cruz & Sons Co.'
Match
'es.'
'Manchester'
'Nantes'
Match
'ity'
'City'
'Makati City'
'Nantes'
'Paris'
Match
'ern'
'Stavern'
'Bern'
'Liverpool'
'Bergen'
Match
'(ern)|(New)'
'Bern'
'Newark'
'New Bedford'
'Glendale'
'Cunewalde'
Match
'A'
'Allentown'
'Los Angeles'
'Nantes'
'Paris'
Match
'.A'
'Los Angeles'
'Allentown'
Match
'[A-C]'
'Burbank'
'Los Angeles'
'NYC'
'Frankfurt'
'Singapore'
Match
L[^o]s
'Lisboa'
'Los Angeles'