In general, a Report Template will display on every page. However a Conditional Template will only appear on a Report’s page when a certain predefined condition is satisfied. If the condition is not satisfied then the Default template will be displayed on that page of the Report.
Adding Conditional Templates
Expand the Template section of the report, right-click on the “Default” tab and select the “Add Conditional Template” menu item. This will add a new tab in the Template area.
Conditional Templates have the following properties:
|Condition||A value indicating the condition in which to evaluate to determine if the Conditional Template should be displayed. (see conditions listed below)|
|Id||A value indicating the programmatic identifier of the conditional template of the report.|
|InheritElements||A Boolean value indicating whether the default template elements will also be included in the Conditional Template.|
Conditions include the following:
- FirstPage – Displays the Conditional Template on the first page of the Report.
- LastPage – Displays the Conditional Template on the last page of the Report.
- MiddlePage – Displays the Conditional Template on any middle page of the Report.
- Document.EvenPage – Displays the Conditional Template on any even page of the Document.
- Document.OddPage – Displays the Conditional Template on any odd page of the Document.
Satisfying Multiple Conditions
Only one Conditional Template will ever be applied to any page. The condition of a Conditional Template will be evaluated from left to right in the order in which they were added in Designer. In other words they will be evaluated from left to right in the order of the tab listed in the Designer. Even if multiple conditions would have been satisfied, only the first Conditional Template whose condition is found to be true will be displayed.