How To Create An Oracle XML Report
How To Create An Oracle XML Report
The XML data template is an XML document that consists of four basic sections:
1. Parameters
2. Triggers
3. Data Query
4. Data Structure
This structure is shown in the following graphic:
Step by Step Guide to create a sample XML Data Template:
1. INVOICE_NUM
2. INVOICE_CURRENCY_CODE
3. INVOICE_AMOUNT
The query for the same will be like below:
SELECT invoice_num
,invoice_currency_code
,invoice_amount
FROM ap_invoices_all;
Decide on the parameters
We will be using two parameters to limit the data being retrieved:
1. ORG_ID
2. VENDOR_ID
The resulting query will be like:
SELECT invoice_num
,invoice_currency_code
,invoice_amount
FROM ap_invoices_all
WHERE org_id = :p_OrgId
AND vendor_id = :p_VendorId;
That’s all we need to construct the XML Data Template.
Open Word. Go to Add-Ins. You will be able to see the BI Publisher Menu. Under the Menu, Select
Data > Load XML Schema. Select the xml file that we just created.
If the data is loaded successfully, you will get the below message:
Select Drop All Nodes from the choices. We will be getting the below screen:
Press OK. We will get the below template in the Word Document. Save the same as
XXINV_DETAILS.rtf.
Inv Number Currency Amount
Go to XML Publisher Administrator responsibility and create a new Data Definition. Give the
following for the fields:
Name – XXINV_DETAILS
Code – XXINV_DETAILS
Press “Add File” next to Data Template. Browse and upload the XML Data Template that we have
created here.
Go to Data Templates and create a new Data Template. Give the following details:
Select Language as US English and upload the RTF File that we have created (XXINV_DETAILS.rtf).