16.5.0 If, Else and EndIf Tag Reference
If Tags are used to conditionally display content in your Report Template, such as Tags, text, images, etc., in your output. This article describes the properties and syntax of If, Else and EndIf Tags.
For more details about using If and Else Tags, see How If and Else Tags Work.
Changes to If/Else Tags in Version 16.3.0
If/Else tags in version 16.3.0 have an added "var" property. The property has no value by default. The property can be set for use with the "Anchor" property: How Do I Use the Tag Anchor Property in 16.2?
If Tag Properties
Here we see the properties of an If Tag. Below, each property is described in detail. Unless otherwise noted, each property is required.
Use these links to jump forward to an If Tag properties section:
Tag Properties
deleteRow (default: true)
This property controls what happens when an If Tag evaluates to false, and the If Tag is inside a table row.
nickname (optional)
The nickname will appear in the template rather than the generic "if:" label. Square brackets ("[]") will surround any text you enter here when it appears in the template to identify it as a Tag. Descriptive nicknames can be very important in designing complex templates.
notEmpty (default: false)
This property controls what happens if the If Tag's SQL select statement returns NULL, or if its XML or JsonPath select statement returns an empty string:
- false - the Case Tag will evaluate to true because the node exists and you are not requiring it be non-empty
- true - the Case Tag will evaluate to false because the node must not be empty to evaluate to true
var (default: none)
This property allows a user to set a variable name for the If Tag. This variable name can be used to set the anchor property on a chart/bitmap.
Standard Properties
description (optional)
A brief description of this Tag.
enabled (default: on)
Controls whether a Tag is executed when generating output. This can be useful when debugging a template.
- on - this Tag will be executed when output is generated
- off - this Tag will not be executed when output is generated
- engine-only - this Tag will be executed only if output is generated using one of the Report Engines
- autotag-only - this Tag will be executed only if output is generated using the Designer
Advanced Properties
error-handling (optional)
Selects which types of errors produce warnings rather than exceptions, which allows output to be generated despite the error.
- Ignore type error - these errors occur when a Tag's defined data type is different than the data type of the data returned by the Tag's query
- Ignore formatting error - these errors occur when a Tag's specified format is not compatible with the format of the data returned by the Tag's query
- Ignore select error - these errors occur when a Tag's query fails to find valid data
- Node must exist - these errors occur when a row or node is queried which doesn't exist in the data source. These errors typically return an empty value that is output without warning.
- Node must not return NULL - these errors occur when a query returns an empty or NULL value. These errors typically return an empty value that is output without warning.
- Treat warning as error - forces all of the above error-handling warnings to appear as errors (not exceptions). This is useful when used with Report Designer's Verify feature.
Else Tag Properties
Here we see the properties of an Else Tag. Below, each property is described in detail. Unless otherwise noted, each property is required.
Use these links to jump forward to an Else Tag properties section:
Tag Properties
nickname (optional)
The nickname will appear in the template rather than the generic "else" label. Square brackets ("[]") will surround any text you enter here when it appears in the template to identify it as a Tag. Descriptive nicknames can be very important in designing complex templates.
Standard Properties
description (optional)
A brief description of this Tag.
enabled (default: on)
Controls whether a Tag is executed when generating output. This can be useful when debugging a template.
- on - this Tag will be executed when output is generated
- off - this Tag will not be executed when output is generated
- engine-only - this Tag will be executed only if output is generated using one of the Report Engines
- autotag-only - this Tag will be executed only if output is generated using the Designer
EndIf Tag Properties
Here we see the properties of an EndIf Tag. Below, each property is described in detail. Unless otherwise noted, each property is required.
Use these links to jump forward to an EndIf Tag properties section:
Tag Properties
nickname (optional)
The nickname will appear in the template rather than the generic ":if" label. Square brackets ("[]") will surround any text you enter here when it appears in the template to identify it as a Tag. Descriptive nicknames can be very important in designing complex templates.
Standard Properties
description (optional)
A brief description of this Tag.
enabled (default: on)
Controls whether a Tag is executed when generating output. This can be useful when debugging a template.
- on - this Tag will be executed when output is generated
- off - this Tag will not be executed when output is generated
- engine-only - this Tag will be executed only if output is generated using one of the Report Engines
- autotag-only - this Tag will be executed only if output is generated using the Designer