Using multiple-value parameters
Multiple-value parameters are drop-down lists or check lists. The values you select in a multiple-value parameter restrict the resulting document data to the elements with the selected values for that parameter. For example, if you select specific years from a multiple-value parameter for years, then only data from those selected years is generated for the report.
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, Deployment Kit 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‑3 shows an example of using dynamic filter parameters to create an expression.
Figure 3‑3 Using dynamic filters
Table 3‑1 lists the possible operators you can use in a dynamic filter parameter.
Table 3‑1 Dynamic filter operators
Operator
Usage
Between
Find data that is between two specific values
Equal to
Find data equal to a specific value
Greater than
Find data greater than the specific value
Greater than or equal to
Find data greater than or equal to the specific value
In
Find data that matches any of the selected values
Is false
Find data that equals zero
Is not null
Find data that does not have a null value
Is null
Find data that has a null value
Is true
Find data that does not equal zero
Less than
Find data less than the specific value
Less than or equal
Find data less than or equal to the specific value
Like
Find data matching the value’s string pattern
Match
Find data matching the value’s string expression
No Condition
Find all values for this parameter
Not between
Find data that is not between two specific values
Not equal to
Find data not equal to a specific value
Not in
Find data that does not match any of the selected values
Not like
Find data not matching the value’s string pattern
Not match
Find data not matching the value’s string expression
The Like operator supports the following special characters:
*% 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 can be combined to form text patterns called regular expressions. Metacharacters can be combined to form complex matches. 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.
If you need to match on a metacharacter itself, a backslash (\) followed by the metacharacter causes the search to interpret the metacharacter as a normal character. For example, if $ is part of the data to be found, it must be entered as
\$ because $ is a metacharacter.
Table 3‑2 lists the metacharacters that can be used to form regular expressions with the Match operator.
Table 3‑2 Regular expression metacharacters
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 the $ sign, search for \$.
\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‑3 provides examples of dynamic filter expressions.
Table 3‑3 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'
'Boston'
Like
'Be%n'
'Berlin'
'Bern'
'Bergamo'
Like
'%& Co%n'
'Handji Gifts& Co'
'Models & Co.'
'Boards & Toys Co'
'Cruz & Sons Co.'
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
'es.'
'Manchester'
'Nantes'
Match
L[^o]s
'Lisboa'
'Los Angeles'