Operators and Functions

DomEL provides the following operators, listed in order of precedence. Operators higher in this list are evaluated before operators lower in the list:

Operator

Syntax

Description

multiply, divide

i * j / k

Arithmetic operators for numeric types only. Parentheses for grouping are not supported.

add, subtract

i + j - k

equal

i == j

Comparison operators for string, numeric, and date types.

not equal

i != j

less than

i < j

Comparison operators for numeric and date types only.

less than or equal

i <= j

greater than

i > j

greater than or equal

i >= j

in set

i in ('apples','oranges')

Sets can be of any type.

in range

i in (j:k)

Ranges must be numeric or date types.

not

not ( i )

Boolean operators. Parentheses are required for not and may be used for grouping.

and

i and j and k

or

i or j or k

DomEL also defines the following operations as functions:

Function

Syntax

Description

startsWith

startsWith(i, 'prefix')

Comparison operators for strings. To test string equality, use i in ('string').

endsWith

endsWith(j, 'suffix')

contains

contains(k, 'substring')

concat

concat(i, ' and ', j, ...)

Returns the string of all parameters concatenated.

testProfileAttribute1Profile attributes are available in all editions of JasperReports Server, but the testProfileAttribute function is available only in JasperReports Server Professional and Enterprise editions. Contact Jaspersoft to obtain the software.

testProfileAttribute(table_ID.field_name,'profileAttribute')

table_ID.field_name is the table name and field name of the field you’re comparing to a profile attribute. This argument can also be an expression, such as a concatenation of fields. It cannot be a constant or a groovy call.

profileAttribute is the name of the user profile attribute.

Feedback
randomness