Registration of XML Report
Registration of XML Report
The XML/BI publisher requires a template layout and data XML to generate the report
PDF, EXCEL, RTF or HTML format.
The data XML can be generated from Oracle Report, OA Framework and data Template.
Using this approach you can develop BI Publisher reports in Oracle EBS, without having
to develop an RDF report.
You can specify an SQL Statement in an XML file, and result of that SQL Statement is
published as XMLP Output.
The data template is the XML document whose elements communicate the following
information to the data engine.
Data Query: The SQL query with bind parameter specifying the data to be fetched.
Bind Parameters: Definition of each bind parameter defined in the query.
Data Structure: Definition of the Output XML Structure.
Data Triggers: Triggers that should be executed before or after the data query execution.
Triggers are used to either do initialization or do some post query operation.
Data Template Structure:
Sample Data Template:
Data Template is the means by which we inform the data engine to fetch the data of our
interest. Apart from these, data template also contains other elements. To make our
example simple and easy to understand, lets deal with the above 4 elements.
Data Template Declaration:
The <dataTemplate> element is the root element. It has a set of related attributes expressed
with the <dataTemplate> tag.
For example:
Package employee
AS
where_clause varchar2(1000);
…..
Package body employee
AS
…..
where_clause := ‘where deptno=10′;
…..
Data Query:
Use <sqlStatement name=””> to define query Performing operations in SQL is faster than
performing them in Data Template or PL/SQL. The following are the most common cases
where using SQL would improve performance:
Use a WHERE clause instead of a group filter to exclude records.
Perform calculations directly in your query rather than in template.
Example: Data Query
<parameters>
<parameter name=”p_DeptNo” dataType=”character” />
</parameters>
<dataQuery>
<sqlStatement name=”Q1″>
<![CDATA[
SELECT d.DEPTNO,d.DNAME,d.LOC,
EMPNO,ENAME,JOB,MGR,HIREDATE,SAL
from dept d, emp e
where d.deptno=e.deptno
AND d.deptno = nvl(:p_DeptNo,d.deptno) ]]>
</sqlStatement>
</dataQuery>
Data Triggers:
<dataTrigger name=”beforeReport” source=”employee.beforeReport()”/>
<dataTrigger name=”beforeReport” source=”employee.beforeReport(:Parameter)”/>
Data triggers execute PL/SQL functions at specific times during the execution and generation
of XML output. Data triggers are optional, and you can have as many <dataTrigger>
elements as necessary. The <dataTrigger> element has a set of related attributes. These are
expressed within the <dataTrigger> tag.
For example, the name and source attributes are expressed as follows:
<dataTrigger name=”beforeReport” source=”employee.beforeReport()”/> <dataTrigger
name=”beforeReport” source=”employee.beforeReport(:Parameter)”/>
The location of the trigger indicates at what point the trigger fires.
Example:
<group name=”G_DEPT” source=”Q1″
groupFilter=”empdata.G_DEPTFilter(:DEPT_NUMBER)”>
<element name=”DEPT_NUMBER” value=”DEPTNO” />
<element name=”DEPTSAL” value=”G_EMP.SALARY” function=”SUM()”/>
<group name=”G_EMP” source=”Q2″>
<element name=”EMPLOYEE_NUMBER” value=”EMPNO” />
<element name=”NAME” value=”ENAME”/>
<element name=”JOB” value=”JOB” />
<element name=”SALARY” value=”SAL”/>
</group>
</group>
Linking Queries:
Two ways of linking are supported
For each parameter in the Data Template, define a parameter in the concurrent program. The
Data Template parameter name should match the concurrent program parameter token.
Associate the Concurrent Program to a request group.
Next
Go to XML Publisher Responsibility and edit the data definition created earlier and upload
the downloaded .xml file
Next
Use Microsoft Word BI Publisher to design the template
Load the xml data downloaded above as given below
Click on Add-Innsà Dataà Load XML Data
I presume that all visiting here has the understanding of inserting fields I’m roughly giving
you the final design
After designing the template Preview the template and save it in .rtf format.
I actually happened to enter the incorrect data definition name which I updated in the next
slide
After completing the XML part
Now again go to Purchasing Vision Operations and submit the request
One can view the Template created in XML Publisher Responsibility here in the layout tab
Concurrent Program executed successfully
The Output: