The expressions are based on Microsoft® Visual Basic. The Expression Editor knows a basic set of Visual Basic functions, as well as all application specific fields, functions, report parameters or calculation variables. The Expression Editor tries to autocomplete your commands as you type, and shows the best matches in a drop-down list.
To find the required item, do one of the following:
Start typing the full word
Type a partial match
Type the occuring capital letters (Latin letters only, does not apply to Chinese, Japanese, or Russian fonts)
To insert a selected item, press [Tab], [Enter],or [Space].
To close the list without inserting anything, move the cursor out of the current word, or press [Esc].
To open the list again, continue typing the expression, or press [Ctrl]+[Space].
To create a dynamic expression, the first character in the expression window must always be an equals sign. Without an equals sign, the system shows the content as a plain static text in the report item. |
If you enter invalid expressions, a red, serrated line will be shown in the Expression Editor. However, you can still save the expression, as it may contain code that is just not modeled by the Report Template Editor, but is still valid Visual Basic. |
To break a single long expression into multiple lines, choose one the following approaches:
Add a blank followed by an underscore ( _), then add the line break.
In expressions used for chromatograms, spectra, calibration curves, or charts, the underscore does not work as a line continuation character. |
Or
Add the line break at a valid position, for example after an operator. For a list of syntax elements that can be used to continue an expression across multiple lines, see https://docs.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/statements.
In the expressions editor text box, the syntax of your entered expression is highlighted in a defined color.
These colors are used to highlight different syntax types:
Color | Syntax type |
Fixed text that is placed in quotation marks. | |
Program flow actions, such as IF, Choose, etc. | |
All other supported functions. | |
All operators, such as +, -, and, or, etc. | |
All constant numbers. | |
All field names (VB.net fields, properties) listed in the Fields tree below. | |
True, displayed for valid expressions. | |
False, displayed for invalid expressions. | |
Place the cursor in front of an open or after a closed bracket, respectively, and the corresponding bracket will be highlighted in this color. |
Category |
Description |
---|---|
Globals |
Contains several global variables that are constant for the entire report. |
Parameters | Contains all report parameters (see Report Parameters). |
Fields |
Contains all data fields that are available for the report type of the current template. |
Operators | Contains a collection of various operators to combine different value (see Operators). |
Common Functions | Contains a collection of various functions that you can apply on the data fields or variables (see Functions). |
Variables |
Contains a collection of all variables that have been defined in preceding report items (see Calculation Variables). |
The lower middle panel displays the specific items corresponding to the selected category. You can insert the item into your expression by double-clicking it.
The Description panel shows a short description on the selected item. If you selected a Category Aggregator variable, this panel shows the functions that can be applied to the selected variable.
Click Save Expression Result As... to open a dialog where you can specify the variable name. The result is then stored under this variable name and can be accessed in subsequent report items.