Building a report in XML Publisher

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.

Building a report in XML Publisher image1

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

 Building a report in XML Publisher image2

 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

Building a report in XML Publisher image3 

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

Building a report in XML Publisher image4

                                 Template                                                                  Preview Report in PDF

 Building a report in XML Publisher image5 Building a report in XML Publisher image6

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.

Table

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

 Building a report in XML Publisher image7

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 Building a report in XML Publisher image8

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

 Building a report in XML Publisher image9

 The template looks like this:

 Building a report in XML Publisher image10

 

The PDF preview like this:

Building a report in XML Publisher image11

 

 

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.

Building a report in XML Publisher image12

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

 Building a report in XML Publisher image13

 The preview PDF

Building a report in XML Publisher image14

Totals 

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’?>

Building a report in XML Publisher image15 

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′?>

Building a report in XML Publisher image16

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

The preview PDF :

Building a report in XML Publisher image17

Sort

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

The preview PDF :

 Building a report in XML Publisher image19

 

My next step:

Building a report in XML Publisher image20

One Response

  1. Goran Music September 5, 2008