The Template Builder for Word
Oracle provides a free Microsoft Word plugin called BI Publisher Template Builder that adds a BIP toolbar to Word. Install it from: My Oracle Support or Oracle Technology Network.
The plugin:
- Connects to your BI Publisher instance to load data models
- Provides a field picker to insert BIP tags directly
- Allows in-Word preview with real sample data
Template structure
An RTF template is a Word document with special BIP tags embedded as field codes. When BIP processes the template, it replaces tags with actual data values.
Basic field insertion
<?EMPLOYEE_NAME?> -- outputs the value of EMPLOYEE_NAME
<?AMOUNT?> or
<?xdofx:to_char(AMOUNT, '$999,999.00')?> -- formatted number
<?xdofx:to_char(HIRE_DATE, 'DD-Mon-YYYY')?> -- formatted date
Repeating rows (table rows)
For each row in the data:
<?for-each:EMPLOYEES?>
[row in table: <?EMPLOYEE_NAME?> | <?DEPARTMENT?> | <?SALARY?>]
<?end for-each?>
In practice, insert this as table rows in Word with the tags in the appropriate cells.
Conditional content
Show content only when a condition is met:
<?if:STATUS='OVERDUE'?>
[text or cell that shows only for overdue items]
<?end if?>
Grouping and summaries
Group by a field and show subtotals:
<?for-each-group:DEPARTMENTS;./DEPT_NAME?>
Department: <?DEPT_NAME?>
<?for-each:current-group()?>
[employee row]
<?end for-each?>
Subtotal: <?sum(.//SALARY)?>
<?end for-each-group?>
Conditional formatting
Change cell color or font based on data:
<?xdo-xslfo:background-color;'xdofx:if(AMOUNT>10000, "yellow", "white")'?>
Testing templates
In Template Builder: BIP menu → Preview → connect to BIP and preview with real data. This validates tags and shows exactly how the output will look before uploading to the server.
Common mistakes
- Forgetting to test with null values (empty fields cause tag errors)
- Hardcoding dates/amounts instead of using format functions
- Not handling the case where a query returns zero rows (show a “No data found” message using
<?if:count(ROWS)=0?>)