Maintaining Sub-Templates
This section provides an overview of sub-templates and discusses how to maintain 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.
Access the Content Library page (Select
.)Image: Content Library page
This example illustrates the fields and controls on the Content Library page. You can find definitions for the fields and controls later on this page.
![Content Library page](img/ia2cf27cn-703d.png)
Field or Control |
Definition |
---|---|
Sub-Template ID |
Enter a unique sub-template ID. |
Description |
(Optional) Enter descriptive text that provides more detail about the sub-template and identifies its use. |
Language |
Select a language code for the sub-template. The default value reflects the users base language. |
Report Category ID |
Select a report category ID. This is a grouping mechanism that provides row-level security for editing sub-templates per the rights defined on the report category setup table. |
Object Owner ID |
(Optional) Indicate which product, feature, or application owns this sub-template. Use this field to extract and package production data source and report registrations and their supporting files. |
Sub-Template Type |
Select RTF or XSL. |
Effective Date |
Select an effective date for the sub-template file in order to maintain new versions or versions that are specific to a particular time period. For example, a new file could be uploaded to reflect a new format or new legal language for reports, and the new sub-template is automatically used as of the new effective date. The default date for a newly added sub-template file is the current system date. This effective date has no correlation with the effective date of the primary template. The as of date on the Query Report Viewer, Query Report Scheduler, or Run Control page determines which effective-dated templates and sub-templates are run. |
Status |
Select a status of In Progress, Active, or Inactive for the sub-template file. This field indicates the usability of the sub-template file. Runtime selection logic for a sub-template file uses this field in conjunction with the Effective Date field to determine which sub-template file to use at runtime. At least one file must be active to save a sub-template in the Content Library. |
Template File |
Displays the name of the sub-template file. |
Upload |
Click to attach an actual effective-dated sub-template file. When you save the sub-template, this button becomes disabled. To reupload a new version of the sub-template, you must delete and add it again. |
Download |
Click to download the sub-template to your local computer for updating. |
View |
Click to view the contents of the sub-template. |