Eclipse BIRT Report Object Model (ROM)
|Display Name:||Filter Condition|
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
The name of a data row column or an aggregate expression.
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.
|Display Name:||Filter Target|
|Display Name:||Is Optional|
The operator to apply to the expression.
|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.|
|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.|
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.
The first (or only) operand.
|Display Name:||Value 1|
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.
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.
|<, <=, =, <>, >=, >||X|
is not null
|between, not between||X
(the regular expression)
(the n value)
|top percent, bottom percent||X
(the % value)
The second operator for between & not between operators.
|Display Name:||Value 2|
The value for conditions with the operators between and not between. Gives the upper value of the range.
|<, <=, =, <>, >=, >|
is not null
|between, not between||X
|top percent, bottom percent|