Developing XML Publisher Report – Using Data XML Template as Data Source
Developing XML Publisher Report – Using Data Template as Data Source
Developing XML Publisher Report – Using Data Template(.xml) as Data Source and Template(.rtf) as Layout.
Note that, we can use .rdf file as data source. But for this demo we are using Date XML Template.
CREATE TABLE demo_products
( product_code NUMBER,
product_name VARCHAR2 (100));
2. Insert Values
INSERT INTO demo_products
VALUES (569, ‘Oracle Cost Management’);
3. Issue Commit
Step1: Define Data Template:
The data template is the method by which you communicate your request for data to the data engine.
The data template is an XML document that consists of four basic sections:
- Define parameters: In which parameters are declared in child <parameter> elements
- Define triggers:
- Define data query: In which the SQL queries are defined in child <sqlStatement> elements
- Define data structure: In which the output XML structure is defined
<dataTemplate name=”demoProductsDT” description=”Demo Products Details” version=”1.0″>
<parameters>
<parameter name=”p_product_id” datatype=”number”/>
</parameters>
<dataQuery>
<sqlStatement name=”DQ”>
<![CDATA[ SELECT product_code, product_name FROM demo_products
WHERE product_code = NVL(:p_product_id,product_code) ]]>
</sqlStatement>
</dataQuery>
<dataStructure>
<group name=”G_DP” source=”DQ”>
<element name=”PRODUCT_CODE” value=”product_code”/>
<element name=”PRODUCT_NAME” value=”product_name”/>
</group>
</dataStructure>
</dataTemplate>
- This Data Template selects the product details from the demo_products table. It uses a bind parameter to find the product name against the product code.
- For each bind parameter in the query , we need to define a Parameter in the Concurrent Program
Step 2: Create Data Definition & Associate with Data Template
Navigation: XML Publisher Administrator -> Data Definitions -> Create Data Definition
Screen 1 : Create Data Definition
Enter the data definition Details and click on Apply. Note down the Code.
The code should be used as the short name of the concurrent program.

View Data Definition


Data Template is associated with Data Definition


2. Short Name in the concurrent program and Code in the data definition should be same.
The Data Template parameter name should match the concurrent program parameter token




Pre-requisite : Install XML Publisher Desktop
After installation following Menus & Toolbars gets added to the MS Word.

Data -> Load XML Data


Final Output layout look like this.
Step 6: Run the concurrent program to see the output
Note:
References:
http://www.oracle.com/technology/products/xml-publisher/index.htm
http://www.oracle.com/technetwork/middleware/bi-publisher/overview/index.html
http://xdo.us.oracle.com
Oracle® XML Publisher Administration and Developer’s Guide
FAQ:
What is XDODTEXE used in the Executable section of Concurrent Program?
XDODTEXE is a BI Publisher Data Template Executable. The purpose of this executable is to identify data template file (.xml) and execute the data template to generate the raw xml data, that later can be used by BI Publisher formatting engine to format as as per the layout (RTF, PDF etc).
This executable will be used by all the BI Publisher reports (Concurrent Program) which are using Data Template to generate the xml data.
Leave a Reply
Want to join the discussion?Feel free to contribute!