This document covers the following topics:
The formula editor can be used, for example, to define that the sum of the fields A and B is to be shown in field C. In this case, the formula has to added to field C.
Important:
The formula is processed on the client side.
When you open the formula editor, you can add or remove a formula.
The prerequisite for adding a formula for a field is that an adapter class or Natural adapter with the corresponding code exists. The formula editor only works with fields that have valid declared properties on the adapter side.
To open the formula editor
In the layout area or preview area, select the field control for which you want to add a formula.
From the
menu, choose .A dialog appears. If a formula has already been defined for the selected field, it is shown in the dialog.
Important:
A function is always defined from the left to the
right. It is not possible to go back in the function, for example, in order to
insert a missing operator. Therefore, you should already have a plan of your
function in mind before you compose the function using the controls in the
formular editor.
The following command buttons are provided:
Command Button | Description |
---|---|
Allows you to select a function (such as sum) from a drop-down list box. After you have selected a function, you define the required fields using an "insert field" link. A simple example is provided below; see Adding a New Formula. | |
This button is only shown when applicable, that is, if at least one expression has been entered. Allows you to select an operator (such as the plus sign) from a drop-down list box. | |
Allows you to define a constant (for example, the number "77") in a text box. | |
Allows you to select brackets from a drop-down list box. | |
Deletes the formula. |
This section explains how to define a simple formula: the sum of the fields Value A and Value B is to be shown in the Sum field.
To add a simple formula
It is assumed that the formula editor has been invoked as described above (the field was selected in which the sum is to be shown).
Choose the
button.The following information is now shown at the bottom of the dialog.
Select the required function (for this example, select sum) from the Functions drop-down list box and choose the button.
The information at the bottom of the dialog is no longer shown. The selected function is now shown in the Formula text box, together with the link "insert field".
Note:
It is not possible to edit the formula in the
Formula text box.
Choose the "insert field" link in the Formula text box.
The fields that are currently defined in the layout are now shown at the bottom of the dialog. Example:
Choose a field (for this example, choose valueA).
The selected field is now shown in the Formula text box. The link "insert field" is still shown in case you want to insert more fields.
Insert all required fields as described above (for this example, choose valueB).
For this example, the formula should look as follows:
sum(valueA,valueB)
When the formula is complete, choose the
button.To close the formula editor, choose the
button.You can now test the formula in the preview area.
You can display a list of all formulae which are defined in the current layout.
To display an overview
From the
menu, choose .A dialog appears. When formulae have been defined in the current layout, they are listed in this dialog.
When you click on a formula, the formula editor appears and you can change the formula as described above.