Templates - Microsoft Word Reports
  • 23 Aug 2024
  • 2 Minutes to read
  • Dark
    Light

Templates - Microsoft Word Reports

  • Dark
    Light

Article summary

General

Every template of a Microsoft Word Report is a Microsoft Word Document; each of these Microsoft Word Documents can have standard, static content (text, images, a table of contents etc. - every content that is supported by Microsoft Word); wherever you want Mail & Deploy to add data to the report document dynamically (e.g. a table from a Datasource, you can reference an Element within the template; this reference will be replaced by the actual content of the element when a report document is created from the report.

Properties

Every template has the following properties:

Name

Description
NameThe name of the template.

Managing Templates

Templates can me modified by opening the report in the Report Designer: To create a new template or import an existing Microsoft Word Document as a template, right-click the Templates folder in the content explorer and choose New Template or Import Template. To edit the contents of a template, double-click the template item in the content explorer. To delete an existing template, right-click the template item in the content explorer and click Delete Template.

Single-Template Operation

If the Microsoft Word Report has only one template, that template will always be used when a report document is created from the report. In that case, the Template Name(s) property of the report can be left empty.

Multi-Template Operation

Mail & Deploy supports multiple templates per Microsoft Word Report and can merge templates to one large template at runtime.

Example: Suppose you want to create a sales report and you create three templates named *Title Page, National Sales Data, and International Sales Data. You want to create one report document per sales representitive from this report; however, not all sales reps have international sales. In that case, you can dynamically (depending on a whether the sales rep for which the report document is created) decide whether all three templates or only the first two ones shall be merged and used for the creation of the report document.

If you have more than one template for a report, you need to specify the names of the template to be used for the creation of the report document in the* Template Name(s) *property of the report. The order in which the expression returns the template names is the order in which they will be merged when creating the report document.

Examples

The following Expression can be used in the Template Name(s) property of the report to create the report document from a single template named Title Page:

Mail & Deploy Expression

"Title Page"

The following Expression can be used in the Template Name(s) property of the report to create the report document from two templates named Title Page and National Sales Data:

Mail & Deploy Expression

CreateList("Title Page", "National Sales Data")

Let's suppose you have a Datasource named Sales Data and three templates named Title Page, National Sales Data, and* International Sales Data*. Depending on the value of the datasource field HasInternationalSales the report document shall either be constructed with or without the International Sales Data template. The following Expression can be used in that case:

Mail & Deploy Expression

If([Datasource].[Sales Data].[Field].[HasInternationalSales] = 1, CreateList("Title Page", "National Sales Data"), CreateList("Title Page", "National Sales Data", "International Sales Data"))


Was this article helpful?