The Formula Editor is part of the Layout Painter. You can use it, 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.
The following topics are covered:
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 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 tree, select the field control for which you want to add a formula.
Or:
Select the field control in the HTML preview.
From the
tab of the Layout Painter, 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. | |
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 information at the bottom of the dialog is no longer shown. 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.The Formula Editor is closed. You can now test your 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
tab of the Layout Painter, choose (located directly above the command).A dialog appears. When formulae have been defined in the current layout, they are listed in this dialog.