Add a function field for a text block to a report

You use a text block to combine text, fields, punctuation, etc. in one field.

You can lay out a text block any way you want, there are no rules regarding the syntax. However, you cannot include calculations, formulas, comparisons, etc. in a text block.

You can also use a text block for a longer text, for example if you want to create a merge document using the Report generator.

To add short text (one line):

  1. Start the formula editor.
  2. Select Text block in Kind.
  3. For a short text, select Text in Type. Drag the necessary fields to the editing box and add text, punctuation, etc.

  4. For a long text (including line breaks), select Memo in Type. Drag the necessary fields to the editing box and add text, punctuation, etc.

  5. Click on: OK.

In the above example, you can only combine text and fields, but you cannot perform operations on fields. If you do want to perform operations, you first have to add function fields with the relevant operation. You then position the function fields in the layout.

Example:

The {Course date (Course)} field results in dates in the short format, like 18-03-2011.

However, you want a long format. That is why you add the 'Datelong' function field with the following operation:

FormatDateTime({Course date (Course)},1)

Place the 'Datelong' function field in the memo field. This function field provides dates in the long format, such as ‘Monday, 18 March 2012’:

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