Monday, January 31, 2011

Calling Subtemplate from main Template

Applies to:
BI Publisher (formerly XML Publisher) - Version: 5.6.2 to 5.6.3 [Release: 5 to 5]
Information in this document applies to any platform.
13-Jun-2010
Goal
Link a RTF subtemplate to the original template in XML/BI Publisher because only the original template is visible for viewing in the PDF output.
This feature is provided in the BI Publisher (formerly XML Publisher) but there are no precise information in the user guide itself regarding this topic.



Solution
These are the steps to enable subtemplates:

1. In the subtemplate file, add the following tag to the beginning of the section to be included:

<?template:TemplateIdentifier?>
where (TemplateIdentifier) is whatever you would like to call this section of the subtemplate.

Note that in a single subtemplate file, you can have multiple entries, marking different segments you would like to include in other files.

2. Register the subtemplate in Template Manager by selecting Subtemplate=Yes

3. In the main template, include the following tag in the beginning of the file:

<?import:xdo: (product_short_name).(subtemplate_code).(lang).(terr)="" ?="">

The first 2 fields are whatever you registered your subtemplate as.
The last two are the locale for your subtemplate file.

For example:
<?import:xdo: ?="" xdo.test.en.us="">

4. In the place in your main template file where you would like to use the sub template,
add the following tag:

<?call:TemplateIdentifier?>

References
BUG:4483295 - HOW TO INCLUDE SUBTEMPLATE WITH IN THE REPORT USING XML PUBLISHER
NOTE:362496.1 - How to Determine the Version of Oracle XML Publisher for Oracle E-Business Suite 11i and Release 12

4 comments:

Anonymous said...

Nice post!! It help me a lot to complete my requirement.

Zafar said...

Very useful post, found one more similar link for Sub templates.
http://steptowardsoracle.com/creating-sub-templates-in-rtf/

Arun Jacob Elias said...

If I have HTML tags in the outout from XML, how can I use sub-template to have output in PDF using RTF?

GAMESH TAWADE said...

I am very happy for buy this product.
Visit this page