The value for a property of
a report item can be a literal value, or it can be derived from an
expression that is written using the RTL Expressions language. RTL
Expressions allow you to define runtime values for any property of
a report item, except for those properties that display a specific
set of valid values in a dropdown listbox.
Enter an expression in a field of the Properties View, by clicking
the Value field. To enter longer values, or obtain hints while typing
the entry, click the f(x) button of the desired property to
open the RTL Expression Editor:
Figure 1. Edit Expression dialog
The acceptable choices for the next character are displayed as
you type. If you press Ctrl Space while entering an expression, a
Code Completion box appears containing a list of the valid choices
based on the context.
RTL Expressions:
- are typed - an expression is composed of items of different
types and the expression returns a particular type. The properties in
the Properties View are also typed. Any expression entered as a
value for a property must return the specified type. For example,
the text property
of a WordBox has
a type of String. So, any RTL expression for the text property is
expected to yield a String. See Report Element
Properties for a list of each report property and its type.
- closely follow the Java™ syntax for
expressions. The main difference is that the "new" keyword is not
supported, so that it is not possible to create and subclass objects.
RTL Expressions loosely follow the Java evaluation
semantics (operator precedence, evaluation order, etc.).
- can use 4GL variables. The 4GL variable is converted to
a specific type within the expression (See Conversion
table) .
RTL
Classes provide member functions (methods) and member variables
that you can use in your expressions. There is a class for each type
of a form property.
Important: Numeric data types are limited to 15 significant
digits. To avoid problems with totals in reports, do not calculate
the value of an item that is part of a total using an RTL expression.
Perform any calculations in the BDL program.