Condition Elements
  • 13 Dec 2023
  • 2 Minutes to read
  • Dark
    Light

Condition Elements

  • Dark
    Light

Article summary

General

Condition elements can be used to exclude certain parts of a Template based on a condition.

Properties

This type of report element has the following properties:

Name

Description
NameThe name of the condition element. This name will be displayed in the tree hierarchy of the content explorer of the Report Designer.
CodeThe code of the condition element. There must be no other report element within the same report with the same code. The code is used to reference the report element from within a Template (see below).
ConditionAn optional condition Expression; if it returns True or 1 the condition is considered to be fulfilled and the portion encapsulated by the condition element will be included in the report document. If it returns something other than True or 1 the portion encapsulated by the condition report element will be excluded. If you leave this property empty, the condition is considered to be always fulfilled. The condition expression is evaluated after the preparation Actions of the image element have been executed.
Preparation ActionsA list of Actions that will be executed before the condition element will be processed.
Fail On Filter ExceptionDetermines what shall happen if an exception occurs when executing a preparation action that performs a filter (e.g. because the value to which you want to filter does not exist). When enabled, an exception will be thrown and the report document creation will be cancelled; when disabled, the portion encapsulated by the condition report element will be excluded.

Insertion

You can insert the placeholder for the condition element by dragging and dropping the report element from the content explorer of the Report Designer into the template. You will then see a start and an end tag for the condition element:

Condition Element Start Tag

[[<code>]]

Condition Element Start Tag

[[/<code>]]

Every content between the start and the end tag of the condition element will be removed from the report document, if the condition is not fulfilled or the condition element is excluded for any other reason. Take for example the following screenshot:


Condition Element Reference in Microsoft Word Template

NOTE

If you change the code of a condition element after you have inserted the placeholder into the template, you need to change the start and end tag of the element in the template as well. Otherwise error messages will occur when creating the report document.


Was this article helpful?