Add function fields to reports

This topic is a general introduction to the formula editor.

In the formula editor you determine the following:

  • The name and internal code code of the function field
  • The type of the function field
  • The formula (calculation)
  • The output (for example, text, numerical value, decimal value, Y/N).

In the formula editor fields are always between {curly brackets}.

Functievelden toevoegen aan rapporten:

  1. Open the report layout.
  2. Click on: .
  3. Go to the tab: Function fields.

    You can add, change or delete function fields here.

  4. Click on:  (add function field)
  5. Enter the Code and the Name. Usually it is easiest to use the same value for the code and the name.
  6. Select Kind:
    • Constant value

      A value that always stays the same. You can position it on the report or use it in calculations that include other function fields.

    • Text block

      You combine texts (that you enter yourself) with fields. This is the easiest way to combine text and fields, for example like "Your credit limit is {credit limit} euro". However, you cannot use conditions or calculations.

    • Expression

      A calculation or comparison.

  7. Select Text as the type.

    This determines how the result of the operation will be shown.

  8. Enter the operation and drag the required fields to the box with the operation.
  9. Click on: OK.

    Profit shows the new field in the Function fields box. You can drag this field to the layout and format it.

  10. Select the appropriate tab:

    Add data fields from the data collection.

    Add a function field (you can use a function field within another function field).

    Add a document field (report name, print date, etc.).

    Add a script field (calculation functions, field formatting, etc.).

  11. Drag the necessary fields to the editing box.

    By default, Profit displays field names, but you can also display the (internal) codes by selecting Codes.

  12. Click on: the Check button. Profit checks if the formula is technically correct. This does not mean that the formula gives the correct result.
  13. Click on: OK.  if Profit reports that the script does not contain errors. If an error has been detected, first resolve the error.
  14. Click on: OK.

    Profit shows the new field on the Function fields tab.

    Drag the field to the layout, just like you would do with other fields.

Directly to

  1. Function fields in reports
  2. Add function fields to reports
  3. Add function fields with a calculation to a report
  4. Combine text using an expression
  5. Add a script
  6. Add a text block
  7. Add a constant