Adding templates to a document specification

You can include one or multiple templates in a document specification and generate a document from the document specification.

Before you begin

About this task

Note: Windows icon As an alternative to this task, you can also drag and drop .dta files from a Windows explorer directory into the Templates section of the Document specification view.

Procedure

  1. In the Document Specification view, right-click Templates.
  2. Click Add templates.
  3. Select a tab to choose one or more templates to add:
    • Load from library:
      1. Select a template from the Central Management component.
      2. Click Add selected.
      3. Repeat to add more than one template to the document specification.
      4. Use the Up and Down buttons to order the templates in your document specification.
    • Open local or remote:
      1. To select templates, enter a URL and click Add URL or click Browse to select a template from your computer or server.
      2. Repeat to add more than one template to the document specification.
      3. Use the Up and Down buttons to order the templates in your document specification.
      Tip: You can use relative paths, HTTP paths , or HTTPS paths to related resources in document specifications. When you use relative paths, you can change the directory structure of your files or move them to the central asset management system and still access the files necessary to generate documents. You are prompted to choose between using relative paths or absolute paths when the document specification is saved, when the template is in the same folder as the document specification, when the template is in a child folder of the folder that contains the document specification, or when the template is in a parent folder of the folder that contains the document specification. You cannot specify a relative path to a parent folder of a parent folder.
    Note: You can use the same template multiple times with different configurations for its data sources.
  4. Click Finish.
  5. Optional: If you must change the order of the templates again after closing the Add template window, reorder the templates by dragging them into the correct order in the Document Specification view. In most situations, the order the templates appear in the Document Specification view is the order in which they display in your generated report.

Results

When you publish the document, each template is executed in the order it are specified in the document specification.

Example

Table 1. Multi-template document example
Template file name Template contents Explanation of use
titlePage.dta Title page, Table of contents Generates the title page
masterPage.dta Header, Footer Generates the header and footer for each page of the document
Introduction.dta Paragraph introduction Provides an introduction for the report
Data.dta Tables of data Generates the data from the data source
Summary.dta Include file for summary Includes a Microsoft Word file with an analysis of the data

Feedback