Tuesday, January 5, 2010

Create XML Publisher Report Using Oracle Reports( RDF )

Required Files:
Oracle Report: HGXPUBTEST.rdf
Template file: HGXPUBTEST.rtf

Output Files:
Output in PDF: HGXPUBTEST_OUTPUT.pdf

XML Publisher is a simple engine. It needs only 3 input values to generate report.
1.Data to display on report(in XML format)
2.Layout model/presentation(in XSL-FO format or RTF)
3.Final output type (PDF, Doc, HTML, etc)
Points to Note:
o XML publisher doesn't care about how you are generating xml data. Only it needs is, your actual data(text file, excel file, data in DB) must be converted in xml format(calling XML Data) as input to the engine. To get this, you can write your own xml data or use Oracle Reports to generate xml data or use any other third party tools to generate xml data from actual data.
o XSL-FO stands for Extensible Stylesheet Language Formatting Objects. Used to present XML Data in readable and  user friendly format. But normal user understands very little in this, so there is an alternative i.e. user friendly RTF. You do presentation work on RTF file and give this as input to the XML Publisher engine. XML Publisher converts RTF into XSL-FO.

What is new here?
We are using Oracle Reports(rdf file) to generate XML data.

Run CP
  |
   -----------Oracle Reports(RDF)----->Generates XML Data-->
  |                                                                                 |--->XML Pub Engine-->CP Output(in PDF or etc)
   --Finds template from XML Publihser Admin resp-->RTF file-->

Summary Steps:
1. Create Oracle Report(HGXPUBTEST.rdf)
2. Define/Register Concurrent Program(HGXPUBTEST)
3. Create Template Definition and Template(HGXPUBTEST.rtf)
4. Run CP and Show XML Publisher report in PDF format(HGXPUBTEST_OUTPUT.pdf)

Step 1: Create Oracle Report(HGXPUBTEST.rdf)
1. Open Report Builder
Follow below screen shots to complete Oracle Report creation.
2. Save file as HGXPUBTEST.rdf. Compile and check for errors. Close Report Builder.
3. Now move this file to $AP_TOP/reports/US
    Or
    Keep file in local directory and set file path in profile option 'FND: Override Directory' at user level.

Step 2: Define/Register Concurrent Program(HGXPUBTEST)
1.Register Executable
Navigate to System Administrator->Concurrent->Program->Executable
Provide following information as shown in the picture.
Executable: HGXPUBTEST
Short Name: HGXPUBTEST
Application: Payables
Execution Method: Oracle Reports
Execution File Name: HGXPUBTEST
2.Define CP
Navigate to System Administrator->Concurrent->Program->Define
Provide following information as shown in the picture.
Program: HG-XML Publisher Test Report
Short Name: HGXPUBTEST
Application: Payables
Executable Name: Oracle Reports
Format: XML

CP definition looks like this after creation.


Points To Note:
o Note down Executable name. We need to use this in XML Publisher definition to refer this CP.
o XML Publisher engine needs data input in XML format. So always select format as XML.( Final output will be PDF/RTF/HTML.. as selected by you in report submission.)
o Add new CP to the Request Group, then add Request Group to your Responsibilty.

Step 3: Create Template Definition and Template(HGXPUBTEST.rtf)
1.Create Template Definition
Navigate to XML Publisher Administrator->Data Definitions
Click Create Data Definition button.

Provide following information as shown in the picture.
Code: HGXPUBTEST
Name: HG-XML Publisher Test Report(your choice)
Application: Payables(your choice)
Click Apply.

Definition looks like this after creation.
Points To Note:
Value given in the Code field must be same as the Executable name of the CP 'HG-XML Publisher Test Report'.

2.Create Template
Navigate to XML Publisher Administrator->Templates
Click Create Template button.

Provide following information as shown in the picture.
Code: HGXPUBTEST(your choice)
Name: HG-XML Publisher Test Report(your choice)
Application: Payables(your choice)
Type: RTF
Data Definition: HG-XML Publisher Test Report
Upload template HGXPUBTEST.rtf.
Click Apply

Template looks like this after creation.

Step 4:  Run CP and Show XML Publisher report in PDF format(HGXPUBTEST_OUTPUT.pdf)
1. Submit Request
If you want final output in different format(RTF, HTML, etc), click Options button and change the Format type. Default is PDF.
2.CP Output(PDF) 
Related Posts Plugin for WordPress, Blogger...