View Categories

Calculation of the value of an expression

< 1 min read

Expressions can include variables of many types, not just database functions and field values. These various parts can be combined to calculate values to be printed or displayed within the report.

Using code in expressions

You can also include code written in the programming language of the report when calculating the values in the formula. Curly braces (“{” and “}” symbols) are used to separate code items from other text. The opening curly brace symbol '{' indicates the beginning of the calculation. A closing curly brace symbol "}" marks the end of the computation. Codes between symbols are calculated and their values are included in the calculation result. In text expressions, the calculation result is automatically converted to a string. For example, if you enter the following expression:

value = {1 + 2}

After the calculation, the result displayed in the report is as follows.

value = 3

multiple code injections

When using calculations, you can insert an unlimited number of codes in one expression. For example, if you enter the following expression:

ValueA = {1 + 2}, ValueB = {2 + 3}

After the calculation, the result displayed in the report is as follows.

ValueA = 3, ValueB = 5

Inserting Nested Code

Nesting of code sections is not allowed when performing calculations in expressions. For example, the following formula is incorrect and fails the calculation:

value = {1 + 2 + {2 + 3}}

 important: Nesting of code is not allowed when doing calculations in expressions.