Template Based Reports

This type of report is based on one or more templates; a template is a file in the native file format of the report type; templates of Microsoft Word reports are Microsoft Word Documents, templates of Microsoft Excel reports are Microsoft Excel Workbooks etc. 


Generally speaking, a report template is nothing more than a file in the native format of the report type that contains references to report elements wherever you want Mail & Deploy to insert dynamic parts e.g. a chart or a table read from a datasource - into the report document.


Templates General 

Every template-based report supports multiple templates. This is particularly useful if you have some reports which are very similar (e.g. they are based on a similar template and require similar report elements) but are still slightly different. When the creation of a report document is requested, Mail & Deploy will by using the Report Template Name attribute (see Expressions) automatically determine which template is to be used. If there is only one template for a given report, the Report Template Name attribute can be empty, because in such a scenario Mail & Deploy will automatically use the one report template available.

Example: You want to create reports for all your sales managers; generally, the reports for all sales managers are identical in their structure (e.g. they all contain the same charts and tables; only the data is filtered to a different sales manager). However, you have sales managers in three different countries; Germany, the US and France and you want to send each sales manager a report in their native language. The data model of the datasource (e.g. a QlikView Document) that you base your report on has a field "LanguageCode" which contains the two-letter code of the language for each sales manager (e.g. "de" for German, "en" for English and "fr" for French).  In such a scenario, the multi-template feature of Mail & Deploy is particularly useful, because you can create three templates - each in a different language - and name them "Template_de", "Templat_en" and "Template_fr". However, you will not have to create the required report elements three times, because as previously stated the charts and tables will be the same for each language. Therefore you can reference the same report elements in all your templates. But how does Mail & Deploy know which template to use for each sales manager? The answer lies in the "Report Template Name" attribute; if you set this to an expression (see Expressions) that returns the applicable template name by combining the constant "Template_" (because all template names begin with that phrase) and then the value of the "LanguageCode" field of the datasource, the correct template will be chosen. Of course, this feature is not only limited to multilanguage templates; you could also create different tempates for private or corporate report recipients, or various currencies etc.

The Report Template Name attribute cannot only return a single value but also an array of values. Mail & Deploy will then merge all specified templates into a single template on which basis the report is created.

Example: If you specify a report template name expression of New String() {“TemplateName1”, “TemplateName2”} then Mail & Deploy will merge the templates TemplateName1 and TemplateName2 (in the order specified) to a single template and will then process that template and create a report document. 

Report Templates

Templates can be managed using the following buttons:

Click this button to create a new template. A new dialogue will pop up which allows you to assign a name to the newly created template.
Click this button to import a template from the file system. A new dialogue will pop up which allows you to browse to the file you want to import and to assign a name to the imported template.
Click this button to edit the name of the currently selected template.
Click this button the create a copy of the currently selected template.
Click this button to delete the currently selected template.
Click this button to enter the design mode for the currently selected template.


Design Mode 

The design mode is used to design a report template. When you click the button to enter the design mode, Mail & Deploy will open the editor the type of report template (e.g. for a Microsoft Excel template, Microsoft Excel will be launched) and re-arrange the windows so you that your template editor is at the right side of the screen, while Mail & Deploy is on the left side of the screen.
Once the report template editor (e.g. Microsoft Excel) has launched, you can start designing the report template by using all features of the report template editor. If you want to place report elements in the report templates, you can simply drag and drop the report element to the location of the report template (e.g. a Microsoft Excel cell) where you want to report template to be placed.
If you want to undo all changes made since you launched the design mode, you can simply close the report template editor without saving change. Otherwise, simply save the changes in the report template editor and close it.

Please note you can only enter the design mode of report templates if you have the required design software (e.g. Microsoft Excel if you want to design Microsoft Excel report templates) installed and licensed on the computer that runs Mail & Deploy Client (see Client).


Report Elements

All the parts of a template-based report which are inserted dynamically during report execution by Mail & Deploy into the report template are represented by a report element. 

General Attributes 

Each report element has the following general attributes:

CodeThe code that is used to reference the report element in a report template.
NameThe name of the report element; this is only used within Mail & Deploy to identify the report element.
ConditionAn optional expression (see Expressions) that evaluates to either True or False. What happens if a condition is not fulfilled (False) is determined by the Condition Not Fulfilled Behaviour attribute.
Condition Not Fulfilled BehaviourThis attribute defines what shall happen if the condition is not fulfilled (i.e. returns False).

Skip Report Element.
If you select this behaviour, the report element will be skipped and not included in the final report document.

Cancel Report Document Creation.

If you select this behaviour, the report document creation will be cancelled and no report document will be created.

Filter Check Behaviour 

This attribute defines what shall happen if a filter check (see Filter Datasource Field Action) of the report element fails.
CultureThe culture associated with the user.
E-Mail AddressThe e-mail address of the user. This attribute is only required if e-mails shall be sent to the user.

Preparation Actions 

This is a list of actions (see Actions) which will be executed before the report document will be created. These actions can, for instance, be used to filter datasource fields or activate bookmarks in order to prepare the datasource to be in exactly the state required for the report document to contain the necessary data.

Design

In the Design section, report elements can be managed using the following buttons:

Click this button to create a new report element. A new dialogue will pop up which allows you to set the general attributes of the newly created report element
Click this button to edit the name of the currently selected template.
Click this button the create a copy of the currently selected template.
Click this button to delete the currently selected template.


You can choose between the following report elements: 

T
Team is the author of this solution article.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.