|
Expression syntax |
Top Previous Next |
|
Expressions are used for calculating numerical values, strings or logical values ("true" or "false"). There are various operators and functions available for this, comparable to a programming language ("Pascal" in this case), which can be used to do many kinds of calculations. You can do operations with data fields, for example calculate the tax for a given amount, or merge two data fields into one string. Please note that if the expression is a property of a report band, the result of the expression must be a logical value. Only the group band expects the result to be a string or a number, just like the expression-field report-element.
Composing expressions
The expression evaluator is working with four data types: Strings, Integer, Float and Boolean. Binary data and memo fields are not supported in expressions. Below is a list of how database fields are converted to report data types:
Report expression syntax is very much like Object Pascal. Below is a list of supported operators:
The standard functions included are:
Using database fields in expressions Any field in any table referenced in your report can be accessed in an expression. Field names can be referenced either just by the field name itself (e.g. Name) or by the table name followed by a dot and the field name (e.g. Customers.Name). If you do not specify a table name the report engine will search for the field in all available data sets and use the first instance found.
The current version of the expression evaluator does not support field names with embedded special characters like blank, "/", dot, dollar sign and so on.
Using Strings in Expressions Strings in expression should be put in single quotes. The following is a valid expression:
"Computers are great!"
Maximum string length is 255 characters.
Expression Examples Below are some examples of expressions:
Compose expressions visually Expressions can be typed in directly to the corresponding edit line, or you can press the button ".." to the right of the edit line to show the expression builder dialog. You can then visually design your expression with your mouse. If a used function has parameters, like "Copy" or "Sum", another copy of the dialog will be opened to define those parameters separately.
|