BI Publisher Subtemplates
We are using BI Publisher Subtemplates to change our printed PO terms and conditions based on a supplier. Subtemplates allow us to split the terms content from the formatting template.
I had the toughest time getting this to work; the documentation for subtemplates proved to be a bit rough. I found a few errors in both the formal BI Publisher documentation and Oracle provided white paper. Here are the basics for getting BI Publisher subtemplates to work.
Subtemplate
Create a new BI Publisher template the same way the main template is configured, but use a different template name/code, and make sure subtemplate is set to “Yes”.
Contents of subtemplate RTF:
<?template:standard_terms?>
Standard Terms Body
<?end template?>
<?template:100001_terms?>
Special Supplier Terms Body
<?end template?>
Report Calling the Subtemplate
You must first import the subtemplate file from the main template, then call the section of the file you want to display.
Import the Subtemplate file
When Using Server to Render Output
Syntax:
<?import:xdo://[APPLICATION_CODE].[TEMPLATE_CODE].[LANGUAGE_CODE].[TERRITORY]/?>
<?import:xdo://XXPO.XXPO_TERMS_R100.en.US/?>
When Using Desktop Viewer to Render Output
<?import:file:C:/XXPO_TERMS_EGS_R100.rtf?>
Call the subtemplate with a condition
<?choose:?>
<?when:SUPPLIER_NUMBER=’100001′?>
<?call:100001_terms?>
<?end when?>
<?otherwise:?>
<?call:standard_terms?>
<?end otherwise?>
<?end choose?>
Things to Note
- Language code is always lower case
- Territory is always upper case
- Don’t forget the forward slash at the end of the server based import string
- Some formatting in your subtemplate will cause the subtemplate import to fail
- I couldn’t get the subtemplate to be two columns using built in RTF/Word functionality
- I did get the main document to put the subtemplate text into two columns
- Intended bullets and numbering work fine
Oracle Documentation
- Sub Templates in Oracle BI Publisher (White Paper)
- Oracle® XML Publisher Report Designer’s Guide Release 12
Thank you for the excellent post. Even though its two years old, this solved my subtemplate issues. As indicated, ‘Don’t forget the forward slash at the end of the server based import string’. This is key! In Bi Publisher 12.2, the report will fail without the forward slash at the end of the string. Issue not documented properly in Oracle’s Designers Guide. Crazy! Thank you
Glad I could help!
I am also facing same issue – if we use two columns using built in RTF/Word functionality then BIP is not importing the sub template content in main template. How to solve the issue if I have to enter 2 lines in single column and below that 2 column text?
I’m quite confused what you are trying to say.
While building the rtf sub template, Suppose if we take any paragraph of 4 lines. I wants to show the same in 2 columns layout in RTF (2 lines will be left side and 2 lines at right side). I am applying below steps to convert 4 lines into 2 columns layout in Word.
first writing the 4 lines in word rtf.
then selecting 4 lines and choosing the tab on Word document-Layout–>Columns–>Two.
It will convert the single column layout 4 lines into 2 columns layout having each column 2 lines.one is left an done is right.
Now I am referring this sub template in main template then this part is not displaying while running report.
Any solution please?
Have you tried using a table of two columns and one for the two “columns” of text? Tables work pretty well. You can change the border to none so that you can’t tell there’s a table when printed.
Yes that option also I tried, however this is working for one page content only. If we are having more than one pages terms and conditions which need to arrange in proper 2 column format. When we use table and paste the terms into first column of table all text is pasting in first column only. its not going to 2nd column when first column of first page is filled with terms. Ideally it should flow like first column of first page then second column of first page then first column of second page and then second column of second page and so forth.
Yes, I don’t think you’ll have much luck with that then. I just checked what I did with PO terms a while back. Originally we had two columns. But at some point we changed to subtemplate, with full page width, not two columns. If there’s no strong business case for two columns of terms, stick with single column and be done with it.