Using the Formula Editor

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:


Opening the Formula Editor

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.

Start of instruction setTo open the Formula Editor

  1. 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.

  2. From the Tools tab of the Layout Painter, choose Formula Editor.

    A dialog appears. If a formula has already been defined for the selected field, it is shown in the dialog.

    Formula Editor

    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
    Insert Function 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.
    Insert Operator Allows you to select an operator (such as the plus sign) from a drop-down list box.
    Insert Constant Allows you to define a constant (for example, the number "77") in a text box.
    Insert Bracket Allows you to select brackets from a drop-down list box.
    Reset Formula Deletes the formula.

Adding a New 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.

Example

Start of instruction setTo 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).

  1. Choose the Insert Function button.

    The following information is now shown at the bottom of the dialog.

    Formula Editor

  2. Select the required function (for this example, select sum) from the Functions drop-down list box and choose the OK 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.

  3. 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:

    Formula Editor

  4. 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.

  5. Insert all required fields as described above (for this example, choose valueB).

    For this example, the formula should look as follows:

    sum(valueA,valueB)
  6. When the formula is complete, choose the OK button.

    The Formula Editor is closed. You can now test your formula in the preview area.

Displaying an Overview of All Defined Formulae

You can display a list of all formulae which are defined in the current layout.

Start of instruction setTo display an overview

  • From the Tools tab of the Layout Painter, choose Overview (located directly above the Formula Editor command).

    A dialog appears. When formulae have been defined in the current layout, they are listed in this dialog.