Building a report in XML Publisher

Ruud Bloemen 1

Last week I made my first steps with XML-Publisher 5.6 Desktop and I am very pleased with the simplicity you can create a report in such a short time. When you follow these instructions you can see it yourself. After you have installed the XML-Publisher 5.6 Desktop you open Microsoft Word and you are ready to create the report.

You can start with the header of the report and place for example a logo in the header. In the left corner you see a XML-Publisher menu.

First you have to ....
load the XML Data


 When de data is loaded the creation of the report is ready to start. To insert a field in the report use the menu: Insert >> Field

showing a pop-up


Now you can select a field and double-click it or drag it to the place in the report. Before you can preview the report you have to save the file as a RTF-file. To get a preview of the report select preview >> PDF,HTML,EXCEL and RTF. I used PDF

                                 Template                                                                  Preview Report in PDF


You can type some lines with or without a field inserted: 

Dear Sirs/Madam, 

According to our records as of AS_OF_DATE, we show the following open balances.


To insert a table in the report you can use the Table Wizard or Table/Form. I preferred to use Table/Form


When you select Table/Form you get a pop-up with the data and you can create a table.

See User Guide for more details 

 After setting the properties and changes in the lay-out it looks like this.


 The template looks like this:



The PDF preview like this:



Cell Highlighting

To highlight (For example color red) the cell(s) of amounts > 150000 you enter a field into the cell(s) of the table. By double clicking on the field you can change the name and the properties. In this example the field is named "COL1". The code has to be placed in the field “Status Bar” or “Help Key (F1)” At this moment I don’t know the differences between these two fields. Please let me know if you do.

 <?if:TRANS_AMOUNT>150000?><xsl:attribute  xdofo:ctx="block" name="background-color">red</xsl:attribute><?end if?>


 The preview PDF


To get the totals of the Amount you have to place in the field “Status Bar” of Amount and the Amount Remaining or in a new field in the same cell of the table the following code: <?add-page-total:TotalFieldName;’element’?> In this case it looks like: 

For Amount                <?add-page-total:TA;’TRANS_AMOUNT’?>

For Amount Remaining: <?add-page-total:TAR;’TRANS_AMOUNT_REMAINING’?>


Place the code of the totals in a new field:For AMOUNT <?show-page-total:TA;’#,##0.00′?>For Amount Remaining <?show-page-total:TAR;’#,##0.00′?>

Page total is not available for output types: HTML, RTF, Excel.

The preview PDF :


To sort the data on Date place the following code in the field “For each “(FE). <?sort: TRANSACTION_DATE?> 

The preview PDF :



My next step:

One thought on “Building a report in XML Publisher

  1. The code has to be placed in the field “Status Bar” or “Help Key (F1)” At this moment I don’t know the differences between these two fields. Please let me know if you do.


    The difference between the two is that the Help Key can hold more text. When I read about it they claimed it was unlimited but at some point it stops allowing you to insert any more text. I’m not sure what the difference is otherwise or why they would restrict you. Maybe someone out there knows?

Comments are closed.

Next Post

New PL/SQL Compiler Warning in Oracle 11g

The PL/SQL compiler in Oracle 11g will give you a warning if it encounters a when others exception without a raise or raise_application_error. SQL> alter session set plsql_warnings='enable:all'; Session altered. SQL> create or replace procedure testje as 2 begin 3 dbms_output.put_line('why do something?'); 4 exception 5 when others 6 then […]
%d bloggers like this: