Understanding Sub-Templates

You may have text, images, or logic in your templates that you want to reuse across many report templates. Examples include company headquarter address information or standard legal language. Rather than replicate this text, code in every template, or both, you can store sub-template files that include the reusable content. These sub-template files are referenced with standard XSL commands in the primary template file. Sub-template functionality is available for use only with primary RTF and XSL templates.

Sub-templates are secondary RTF or XSL templates that are imported by primary RTF or XSL report templates. The primary template accesses the sub-template through the XSL import style sheet feature. You can import any XSL style sheets or other RTF or XSL templates using standard XSL import and call functions. PeopleTools simplified sub-template syntax is also supported.

Primary templates calling nonexistent or inactive sub-templates causes an error message to be issued indicating the reason for the problem. This error information is incorporated into Process Scheduler error handling as well as into online viewing or previewing of the report.

The sub-template files are independently stored and are not registered in association with a data source or primary template. This being the case, if any form fields exist inside the sub-template, the report in which the sub-template is placed must have a related data source that supplies those fields, or the data must be passed in as runtime parameters.

The Content Library is a component provided for the registration of reusable sub-template files. The metadata is similar to that of primary template files and includes the sub-template ID, sub-template description, language, object owner ID, report category, effective date, and status. As with Report Definition security, sub-template editor registration security is applied through report categories. Because Report Category secures the data in the component, you can assign select users read-only access for a report category. These users can browse, view, and download sub-template files but not add them. This facilitates the offline design of primary templates for users who can access the library of existing sub-templates but who can’t alter them.

Sub-template names are not exposed to the end user at either report design time or runtime. The complete template (primary and sub-templates) is systematically assembled by the BI Publisher engine during report generation. The same occurs during online previewing as long as the sub-template file exists.

Note:

No method is available for viewing which report templates include which sub-templates. This means that users must be careful about changing, deleting, or inactivating sub-templates.