You can split text templates across several files for size or organizational reasons. Most commonly, you will split a text template into multiple files to allow a portion of a text template to be reused in other templates. The following procedure describes how to use the include directive to use multiple text template files within a single text template. For more information, see Directive Syntax (Domain-Specific Languages).
To add the include directive to a text template
-
In Solution Explorer, right-click the text template file that will use the include directive, and then click Open.
The template opens in the editor.
-
Add the following directive to the template:
<#@ include file ="MyTextTemplateFile2.ReportTemplate"#>
Important |
|---|
| Replace the file name MyTextTemplateFile2.ReportTemplate with the name of your file. |
For a detailed example demonstrating splitting a text template into multiple files, see Walkthrough: Creating and Running Text Templates. In the walkthrough, functions defined in a text template are removed from the template and placed in another file for organizational purposes.
Note |
|---|
| To debug text templates you must set the debug parameter of the template directive. For more information, see How to: Debug Text Templates. |
Security
See Also