You can import an entire template or a section of a template by physically embedding
elements into another template. You can also import a template into another template during
document-style report generation by dynamically linking to it instead of physically embedding
it.
About this task
You can import templates with their data sources, master
pages, styles, and variables. If the imported content matches the
contents of the template, you receive a conflict notification. Edit
the content or replace the content to resolve the conflict.
Procedure
- In Document Studio, select one of these options:
- To insert a template into an existing element or to the end of your template, click
.
- If an existing element is selected in the template and that element can contain imports,
Import Template is enabled so that the imported content can be inserted into
the selected element.
- If an existing element is selected in the template and that element cannot contain imports,
Import Template is disabled.
- If no existing elements are selected, Import Template is enabled so that
the imported content can be inserted to the end of the template.
- To add a template before or after an element that is selected in the template content
editor, click and then select Before
selection or After selection.
In the Import Template Wizard, click Next.
- In the Select Template window, select a sample template from the
library or click the Open Local or Remote tab and enter the path for the
template or click Browse to locate the template. Click
Next.
- Select the importing type:
- Physical embedding: Inserts the template
elements into the current template.
- Dynamic referencing: Template elements are linked and loaded during
document-style report generation into the output.
Important: Use physical embedding
instead of dynamic referencing when:
- A template or snippet is designed to extract information from a data source.
- A template or snippet contains a dynamic reference in it.
- If there is any conflicting information for master pages, styles, and variables, the
Conflicting content icon displays in front of the conflicting content. Edit
the conflicting contents:
- To use the information from existing template, click Use Existing Item For
Conflicts As Allowed.
- To edit the conflicting content with the new content, click Edit,
modify the value and then click OK.
Note: If you first imported a template by
dynamically referencing it, and then imported another template by physically embedding it, none of
the conflicts can be resolved by reusing the values for the dynamically referenced template. You
must edit each conflict to resolve it.
Click Next.
- Review the summary and click Finish.
If authentication credentials were provided in the imported
template and display in the summary, those credentials are also stored
in the host template. You can revise those credentials after the import.
- Optional: If necessary, reorder the elements in your template.
If
you imported several templates or elements in succession, each item you added displays before the
last item. The latest import displays first. In the template content editor, you can drag the
imported templates to a specific location to reorder the template.
Note: In the Outline view, you can
drag elements to a specific location to reorder the template, but you cannot drag imported templates
to reorder the template.
Results
The template content or template link is inserted into your host template. If you
selected Dynamic referencing for the importing type, the styles, master
pages, data sources, and variables from the imported template display in the Outline view with
(referenced) after the name.
You can drag these references into template
elements and use them in expressions in the script editor.
You cannot assign values to these variables or edit the variables. When a host template is loaded,
all of the references to variables, styles, and master pages are checked. Deletion of referenced
templates whose variables, styles, or master pages are used in the host template is not permitted.
In version 1.3.0 and later, external variables from dynamically imported templates can be used in
scripts in the host template.
What to do next
- If you chose to dynamically reference the file, you might be prompted
to change the file path to be relative to the host template.
If
you are prompted to use relative paths:
- Remember that the relative path that is specified is relative
to the host template, not the document specification.
- If you move one of the templates from its original location and
the relative path changes, you must remove the referenced template
from the host template and import the template again.
If you are not prompted to use relative paths, verify
that:
- The host template is saved.
- Both the host and imported templates are version 2 templates.
- If necessary, revise the authentication credentials that are stored in the host template from
the imported template.