You are on page 1of 22

How to Use XML Publisher to Generate Oracle Reports in Excel and PDF

December 31, 2006 on 5:49 pm | by Nancy Chung | In How To Guides | | Print | Email

In the past, Oracle E-Business Suite Customers seldom used outputs of the seeded Oracle reports because they were unfriendly, and frankly, hard to use. Unfriendly because the generated output was always fixed width courier only font, contained no graphics, and could only be in black and white. Hard to use because the only output was text. In the business world, we all know how important the final output is and text only is not even an option. Businesses require PDF and XLS output that support tables, charts, graphics, color, etc. Today, Oracle offers a solution that enables our Oracle E-Business Suite Customers to turn the once unfriendly Oracle seeded reports into PDF and XLS outputs of color, graphics, and tables. The solution is XML Publisher. XML Publisher is a java based reporting tool that is bundled for free within the technology stack of the Oracle E-Business Suite. The concept is similar to that of mail-merge where the data and template are maintained separately until the two are married to generate the desired document. XML Publisher separates a reports data and layout component into two manageable pieces while it supports the desired outputs of PDF, HTML, XLS and RTF. The prerequisites to use XML Publisher include:

XML Data Report Template Registration of Data Definition and Template at XML Publisher

How does XML Publisher leverage on Oracle seeded reports? An Oracle seeded report is a report definition file that integrates both the data query and the report layout into one file. XML Publisher will use Oracle Reports for only the data query portion and will ignore the defined report layout. This will fulfill one of XML Publishers prerequisites: XML Data. So the question is, how do you set up the Oracle system to only use the data query portion of the Oracle report?

Log into Oracle with System Administrator Responsibility Navigate to > Concurrent > Program > Define Search for the desired Oracle Report Change the Output Format from the default Text to XML Take special note of the Program Short Name (youll need it later to register the data at XML Publisher)

How does it benefit Oracle E-Business Suite customers? XML Publisher provides full control of the layout and look and feel of the report to the Customers. This means the Customer will fulfill the second prerequisite, the Report Layout. Customers will leverage on familiar tools like Microsoft Word and Adobe Acrobat to create the report layout with reference to the XML Data Tags. So the question is, how does the Customer create the Report Layout? PDF Forms template are intended for Customers that require a fixed look and feel such as completed IRS forms and are created in Adobe Acrobat. RTF templates are intended for all other purposes and are created in Microsoft Word. In this example, well go over how to create an RTF Template.To create an RTF Template, youll want to download the XML Publisher Desktop Utility and its prerequisite Java Runtime Environment. This enables you to create and test your Report Template in a localized environment, your computer, before registering it at Oracle XML Publisher. So where to download the XML Publisher Desktop Utility?

Navigate to Oracle eDelivery Site Select Product Pack: Oracle Application Server Products Select Platform: MS 32 bit Click on the GO Button Select and Download Oracle XML Publisher Release 5.6.2 Media Pack for Microsoft Windows

The XML Publisher Desktop Utility is a plug-in to Microsoft Word. To create the RTF template, you must first load the XML Data File by clicking on the Data button and selecting Load XML Data. To get a sample XML data file, you can run the Oracle seeded report and download the output. Once the data file is loaded, you can make references to the XML Data elements. For example, if you want to reference the Project_Number XML Data Element, the format you would type would be The common used tags include:

for-each | end for-each if | end if choose | when | end when | otherwise | end otherwise | end choose

Alternatively, you can use the Desktop Wizard functionality by clicking the Insert button and selecting Table/Form to drag and drop the desired XML Data Elements into the Template window. This will automatically generate a table for you. You can test your RTF template with the loaded XML Data File by click on the Preview button and selecting one of the supported output formats. Once satisfied with the created RTF Template, the final steps is to register both the Data Definition and the Template at XML Publisher. The steps are: Register the Data Definition:

Log into Oracle with XML Publisher Administrator responsibility Navigate to > Home > Data Definitions Click on the Create Data Definition button The Code must be the Concurrent Program Shortname from above

Register the Template

From Data Definitions, Navigate to > Templates

Click on the Create Template button The Data Definition value should be the Data Definition you registered above

When the Customer runs this configured report through the Concurrent Manager, the Customer will follow the same steps to run the standard Oracle Report by selecting the report in the Single Request Screen and entering the desired run parameters. Now, the Customer has one additional option to select the desired output format of the report. From the Single Request Screen, click on the Options button and select the desired output.

XML Publisher Concurrent Program - XMLP In this article I have listed a step by step demo of XML Publisher as a Concurrent Program in Oracle Apps. I think it is very important that you get a feel of XML Publisher, as this will become the reporting tool in Fusion [assuming XMLP can become as powerful as Oracle Report in the given time]. Before I explain the steps in details with screenshots, let me brief them:a. Create a report and register it as Concurrent Program of type XML b. Build a Data Definition & XML Template using XML Publisher. c. Create a relation between XML Template & Concurrent Program.

Sounds simple, it is indeed, but devil lies in detail. Hence read the below carefully. I have provided the source code with installation instructions for you to try this. Please note to try this you need 11.5.10 environment.

Now lets get into the details.Step by Step.. 1. Create a table xx_emp_demo and insert two records into it. create table xx_managers ( manager_no integer, manager_name varchar2(200) ) ; insert into xx_managers ( manager_no, manager_name ) values ( 1000, 'Anil Passi') ; insert into xx_managers ( manager_no, manager_name ) values ( 1001, 'Martin') ; commit;

2. Next you need a concurrent program that spit out an XML file to the output of the concurrent program. Such concurrent program can be of type SQL or PL/SQL or Oracle Report or any other supportable type, provided it can produce a XML output. Hence in this case, we will develop a Report that has all the columns from table xx_managers Create a plain default Oracle Report using wizard in Oracle Reports 6i. This can be done using wizard with SQL select * from xx_managers

Above picture shows the report output in Reports 6i preview

Do not change anything in DESFORMAT, as Concurrent Manager will take care of passing XML to this. Hence XML Publisher will be fed an XML output by the concurrent manager itself.

3. Add three user parameters P_CONC_REQUEST_ID, P_RESPONSIBILITY_ID, P_USER_ID

These parameters will make it possible to run a report as concurrent program. Save the above RDF as XX_MANAGERS.rdf

4. FTP XX_MANAGERS.rdf to $AR_TOP/reports/US

Silly it is, but for demo I will use standard Application [forgive me, but I am making it easier for you to run the source code].

5. Create Concurrent program executable for XMLP report, as if it is a normal report

6. Create a concurrent program for the executable. Note that I have kept the shortname and the program name both as XX_MANAGERS. IMPORTANT:- Note that format is XML

7. Register this program with Receivables request group. DECLARE BEGIN FND_PROGRAM.add_to_group ( PROGRAM_SHORT_NAME =>'XX_MANAGERS' ,PROGRAM_APPLICATION =>'AR' ,REQUEST_GROUP => 'Receivables All' ,GROUP_APPLICATION =>'AR' ); commit;

exception when others then dbms_output.put_line('Object already exists'); END ; /

8. Run the report and you will see an xml output appearing. Save the output as XX_MANAGERS_241106.xml on your computer. You will need to use menu /Tool/Copy to open this XML output in browser, and then save it as XX_MANAGERS_241106.xml on your PC.


9. Install this XML Publisher Desktop software on your pc, ensuring that you have MS-

Word installed(for this demo) The XML Builder Desktop Patch for Word is Patch Number: 4561835 This software can be downloaded from

This is a tool given by Oracle[Desktop XML Publisher] that will read any XML file, will create the fields automatically.

10. Open MS Word after installing as per step 9, and you will now see something similar to below in Microsoft Word

Now in MS Word, click on Load XML Data and select file XX_MANAGERS_241106.xml that was created in Step 8.

11. Now, click on Insert/Table Form And then drag and drop List G Manager No within the template section and click on OK.

Effectively by doing these steps, you have just created a Layout for the report in XML Publisher. The layout will look like this [as below].

Save this MSWord file as MANAGER_XML_TEMPLATE.rtf

By clicking on Preview, you will see the output as below

12. Now, lets do the real bit in attaching the Concurrent Program definition to XML Publisher. Logon to responsibility XML Publisher Administrator.

Click on Data Definition menu as aboveso that we can create the XMLs source data Definition. Effectively we are saying that output of the Concurrent program becomes the data definition for XMLP.

Lets define the value in below fields Name : XX_MANAGERS Application : Receivables Code : XX_MANAGERS [Note: This is the short name of the Concurrent program]

Start Date : Leave it to default Sysdate Click on Apply

13. Now lets define a template as below for XML Publisher.

For doing so, click on Templates Tab. We need to create a Template for the datadefinition of previous step.

Name : XX_MANAGERS [this is the name of the template] Code : XX_MANAGERS [short name of conc program] Application : Receivables Data Definition : XX_MANAGERS [the one that we created in prior step 12] Start Date: : Leave this default. Type : RTF Click on browse and select the RTF file[MANAGER_XML_TEMPLATE.rtf] that you had saved in Step 11.

xmlp_A_14 Click on Apply, and you will get the below record.

14. Navigate to Receivables Manager and submit report XX_MANAGERS. Click on Output button to see the report as pasted below.

Oracle Applications XML Publisher is the standard enterprise reporting solution across many of Oracle's application suites. It is also now available as a standalone reporting solution for non applications customers or for those applications customers that wish to use XML Publisher outside of their application suite. A quick note on the naming of XML Publisher, the product has been renamed to 'Business Intelligence Publisher'. Inside the E Business Suite, PeopleSoft Enterprise and JD Edwards E1 the name remains as 'XML Publisher'. It is the same product as the BI Publisher but under the older name. E Business Suite Users of the E Business Suite will find XML Publisher under the covers of many reporting solutions from application modules such as Bill Presentment Architecture, Purchasing , Financial

Consolidation Hub , Discrete Manufacturing, Human Resources (Tax reporting, legal reporting), etc. Of course XML Publisher is also integrated with the scheduling manager and more and more layout templates are being made available to users across the E Business Suite modules. Customers can easily use their existing Oracle Reports and take advantage of XML Publisher for all their production reporting needs.