Eclipse BIRT Report Object Model (ROM)
FilterConditionElement Element
Display Name: | Filter Condition Element |
Since: | 2.2 |
XML Element: | filter-condition-element |
Extends: | None |
Extendable: | No |
Abstract: | No |
Name Space: | None |
Name Requirement: | Not Supported |
Allows User Properties: | No |
Has Style: | No |
The filter criteria defines a filter to apply to a List, Table, Group or other element. Expressions are of the form "expression op value" or "expression op value 1, value 2". A special case is "expression is true" in which the expression itself is a Boolean expression.
The simplest expression is comparison with a column in the data row:
row.State = "CA"
A slightly more complex comparison is to use a report parameter:
row.State = params.StateParam
Some conditions may require conditional logic:
( row.Balance < 0 || row.Status = "Suspended" ) is true
Note that the "is true" is present just to say that the entire expression should, itself, be treated as a complete condition.
Ranking expressions let the report choose only the most interesting rows:
row.Balance Top 10
Which means to display the ten customers with the highest balances.
When used with groups, a filter can refer to total computed over the group:
Total.sum( row.InvoiceAmt ) > 1000
The filter can also refer to totals computed over the entire data set, or a higher level group. To display only customers whose sales account for at least 5% of total sales:
Total.sum( row.InvoiceAmt ) >= Total.sum_overall( row.InvoiceAmt ) * 0.05
Type: | string |
Since: | 2.5 |
Required: | No |
Display Name: | Dynamic Filter Parameter |
JavaScript Type: | |
Default Value: | None |
Inherited: | Yes |
Runtime Settable: | No |
Property Sheet Visibility: | Visible |
Property Sheet Group: | Top |
The name of a data row column or an aggregate expression.
Type: | expression |
Context: | |
Expression Type: | None |
Since: | 2.2 |
Required: | Yes |
Display Name: | Expression |
JavaScript Type: | |
Default Value: | None |
Inherited: | Yes |
Runtime Settable: | No |
Property Sheet Visibility: | Visible |
Property Sheet Group: | Top |
The filter expression is the name of a data row column or an aggregate expression. A filter only makes sense when computed using a data row column. BIRT accepts a value such as 1 or "hello, world", but then the same filter criteria will be applied to every row. Such behavior may be useful when testing, but seldom in a production report.
Type: | string |
Since: | 2.5 |
Required: | No |
Display Name: | Extension Expression Id |
JavaScript Type: | |
Default Value: | None |
Inherited: | Yes |
Runtime Settable: | No |
Property Sheet Visibility: | Visible |
Property Sheet Group: | Top |
Type: | string |
Since: | 2.5 |
Required: | No |
Display Name: | Extension Name |
JavaScript Type: | |
Default Value: | None |
Inherited: | Yes |
Runtime Settable: | No |
Property Sheet Visibility: | Visible |
Property Sheet Group: | Top |
Type: | choice (filterTarget) |
Since: | 2.2 |
Required: | No |
Display Name: | Filter target |
JavaScript Type: | |
Default Value: | DataSet |
Inherited: | Yes |
Runtime Settable: | No |
Property Sheet Visibility: | Visible |
Property Sheet Group: | Top |
Name | Display Name | Value | Description |
DataSet | Data Set | DataSet | |
ResultSet | Result Set | ResultSet | |
OdaDataSet | ODA Data Set | OdaDataSet |
Type: | boolean |
Since: | 2.2 |
Required: | No |
Display Name: | Is optional |
JavaScript Type: | |
Default Value: | false |
Inherited: | Yes |
Runtime Settable: | No |
Property Sheet Visibility: | Visible |
Property Sheet Group: | Top |
Type: | contentElement |
Since: | 2.2 |
Required: | No |
Display Name: | Member |
JavaScript Type: | |
Default Value: | None |
Inherited: | Yes |
Runtime Settable: | Yes |
Property Sheet Visibility: | Hidden |
Property Sheet Group: | Top |
The operator to apply to the expression.
Type: | choice (filterOperator) |
Since: | 2.2 |
Required: | No |
Display Name: | Operator |
JavaScript Type: | |
Default Value: | None |
Inherited: | Yes |
Runtime Settable: | No |
Property Sheet Visibility: | Visible |
Property Sheet Group: | Top |
Name | Display Name | Value | Description |
eq | Equal to | eq | Relational operator. |
ne | Not Equal to | ne | Relational operator. |
lt | Less than | lt | Relational operator. |
le | Less than or Equal | le | Relational operator. |
ge | Greater than or Equal | ge | Relational operator. |
gt | Greater than | gt | Relational operator. |
between | Between | between | Checks if a value is between two values. |
not-between | Not Between | not-between | Checks if a value is not between two values. |
is-null | Is Null | is-null | Checks if the value is null. |
is-not-null | Is Not Null | is-not-null | Checks if the value is not null. |
is-true | Is True | is-true | Checks a Boolean condition. Use these if the expression condition itself already expresses the full filter condition. |
is-false | Is False | is-false | Checks if a Boolean condition is false. |
like | Like | like | Check the value of a column against a JavaScript regular expression. |
top-n | Top n | top-n | Accept the value only if it is within the top n values. |
bottom-n | Bottom n | bottom-n | Accept the value only if it is within the bottom n values. |
top-percent | Top Percent | top-percent | Accept the value only if it is within the top percentage of values. |
bottom-percent | Bottom Percent | bottom-percent | Accept the value only if it is within the bottom percentageof values. |
match | Match | match | |
not-like | Not Like | not-like | |
not-match | Not Match | not-match | |
in | In | in | |
not-in | Not In | not-in |
A filter criteria is of the form:
expr op value1 (value2)
The operator says how to test the expression. It can be a simple relational operator:
expr = 10
Or one of the other operations shown above.
The ranking operators (Top N, Bottom N, Top Percent and Bottom Percent) can include ties. For example, suppose we want the top three customers by sales. Suppose we have the following customers and sales:
A top-3 ranking would include customers C, B, A and D because A and D both have the same sales amount.
Type: | boolean |
Since: | 2.5 |
Required: | No |
Display Name: | Push Down |
JavaScript Type: | |
Default Value: | false |
Inherited: | Yes |
Runtime Settable: | No |
Property Sheet Visibility: | Visible |
Property Sheet Group: | Top |
The first (or only) operand.
Type: | list |
Since: | 2.2 |
Required: | No |
Display Name: | Value1 |
JavaScript Type: | |
Default Value: | None |
Inherited: | Yes |
Runtime Settable: | No |
Property Sheet Visibility: | Visible |
Property Sheet Group: | Top |
The value for simple conditions with the operators: <, <=, =, <>, >=, >, between, not between, like. Gives the "N" for the top N, Bottom N conditions. Gives the "percent" for the Top Percent and Bottom Percent conditions.
The value1
property for a ranking
operator must be constant with respect to the data set. For example, it
can reference a report parameter, but not (normally) a column. The
result is undefined when used with a value that varies within the data
set.
Operator | Value 1 |
<, <=, =, <>, >=, > | X |
is null, is not null |
|
between, not between | X (lower bound) |
is true, is false |
|
like | X (the regular expression) |
any | |
top N, bottom N |
X (the n value) |
top percent, bottom percent | X (the % value) |
The second operator for between & not between operators.
Type: | expression |
Context: | |
Expression Type: | None |
Since: | 2.2 |
Required: | No |
Display Name: | Value2 |
JavaScript Type: | |
Default Value: | None |
Inherited: | Yes |
Runtime Settable: | No |
Property Sheet Visibility: | Visible |
Property Sheet Group: | Top |
The value for conditions with the operators between and not between. Gives the upper value of the range.
Operator | Value 2 |
<, <=, =, <>, >=, > | |
is null, is not null |
|
between, not between | X (upper bound) |
is true, is false |
|
like | |
any | |
top N, bottom N |
|
top percent, bottom percent |