Quantcast
Channel: Oracle Maniacs' Notes » XML Publisher Report
Viewing all articles
Browse latest Browse all 16

Using Data template for developing XML Publisher reports

$
0
0

XML Publisher reports contain 2 main components.

  1. Data definition
  2. Template

The Data definition component generates the XML for the XML Publisher engine. The XML is then processed into the Template to generate the entire report.

The Data definition could be any program that generates XML. Developers generally use an Oracle reports or a PL/SQL program to generate the XML. A lesser known and used method to generate the XML is by using XML Data template. The XML data template is a XML file with specific tags that is interpreted by a standard Java program, XDODTEXE. XDODTEXE interprets the XML file and generates the final XML file for XML publisher engine.

The development process is illustrated below

Create the data template

The data template XML file is shown below,

<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- $Header: DATA_TEMPLATE_EMP_DD.xml 115.0 2012/03/15 08:04:42 <span class="hiddenSpellError" pre="42 ">xdouser</span> noship $ -->
<!-- <span class="hiddenSpellError" pre="">dbdrv</span>: none -->

<dataTemplate name="EMP_DD" description="Employee Details" version="1.0">
<parameters>
<parameter name="p_period1" dataType = "CHARACTER"></parameter>
<parameter name="p_period2" dataType = "CHARACTER"></parameter>
<parameter name="p_org_id" dataType = "NUMBER"></parameter>
</parameters>
<lexicals>
</lexicals>
<dataQuery>
<sqlStatement name="Q1">
<![<span class="hiddenSpellError">CDATA</span>[select rownum, a.employee_number EmpNo, a.full_name Employee_Name, awsl.cost_center Cost_Centre, ffvv.description CostCenter_Desc, awsl.signing_limit Signing_Limit, TO_CHAR (awsl.last_update_date, 'DD-MON-YY') UpdateDate
from (select distinct papf.person_id person_id, papf.employee_number employee_number, papf.full_name full_name from per_all_people_f papf, AP_WEB_SIGNING_LIMITS_ALL awsl where attribute16 is null
and papf.person_id = awsl.employee_id ) a,
AP_WEB_SIGNING_LIMITS_ALL awsl ,
fnd_flex_values_vl ffvv,
fnd_flex_value_sets ffvs
where a.person_id = awsl.employee_id
and ffvs.FLEX_VALUE_SET_ID = ffvv.FLEX_VALUE_SET_ID
and ffvs.flex_value_set_name = 'EY_COST_CENTRE'
and ffvv.FLEX_VALUE = awsl.cost_center
and awsl.org_id = :p_org_id
--and awsl.last_update_date between nvl(:p_period1, awsl.last_update_date) and nvl(:p_period2, awsl.last_update_date)
and awsl.last_update_date BETWEEN TO_DATE (:p_period1,'YYYY/MM/DD HH24:MI:SS') AND TO_DATE (:p_period2,'YYYY/MM/DD HH24:MI:SS')
--order by a.employee_number, a.full_name, awsl.cost_center, flv.description
]]>
sqlStatement>
<dataStructure>
<group name="G_EMP" dataType="VARCHAR2" source="Q1">
rownum"/>
<element name="EmpNo" dataType="VARCHAR2" value="EmpNo"/>
<element name="Employee_Name" dataType="VARCHAR2" value="Employee_Name"/>
<element name="Cost_Centre" dataType="VARCHAR2" value="Cost_Centre"/>
<element name="CostCenter_Desc" dataType="VARCHAR2" value="CostCenter_Desc"/>
<element name="Signing_Limit"  dataType="VARCHAR2"  value="Signing_Limit"/>
<element name="UpdateDate" dataType="VARCHAR2" value="UpdateDate"/>
</group>
<element name="C_count_cur" function="count" dataType="NUMBER" value="G_CURRENCY.trx_currency_code"/>
<element name="NF" dataType="VARCHAR2" value="NUM_FORMAT"/>
</dataStructure>
</dataTemplate>

Tag explanation:

Tag Explanation
<parameter name=”p_period1″ dataType = “CHARACTER”></parameter> The parameters of the concurrent program is defined using this tag
<lexicals></lexical> Lexical parameters are defined in this section
<dataQuery><sqlStatement name=”Q1″><![CDATA[SQL statement]]>

</sqlStatement></dataQuery>

<dataStructure>

The SQL queries are written within the CDATA tag.
<group name=”G_EMP” dataType=”VARCHAR2″ source=”Q1″> The data generated is in groups. We need to name the group. We name the group in this tag and the data will be enclosed by this group in the XML
<element name=”Sr_No” dataType=”VARCHAR2″ value=”rownum”/> Each XML element, i.e. that data, is declared within the element tag. The type and the value is also declared. In this tag, value=”rownum”, means that this tag will get the value from rownum column from the query.

 Unfortunately there is no tool to generate the XML file, the file has to be created manually. I think Oracle is in the process of building a tool for this purpose.

We will save the XML file with the name, EMPTemplate.xml

We will create the Concurrent program.

Responsibility: System Administrator

Navigation: Concurrent > Program > Define

Enter the program details

Concurrent program definition

When we use a data template for a XML Publisher report, the executable name is always set to XDODTEXE. The concurrent program should be assigned to Internal Controls Manager application if it uses XDODTEXE program.

Click on Parameters button

Program parameters

Enter the parameters as any other concurrent program. Save the form.

Note: We do not need to create a concurrent executable as we use a seeded executable XDODTEXE

If you want to view the concurrent executable, open the Executable form and query for XDODTEXE as short name.

Seeded executable

This is a seeded Java concurrent program supplied by Oracle.

Now we need to register the data definition and the template.

Responsibility: XML Publisher Administrator

Navigation: Data Definition

Create a data definition with the same short name as the concurrent program, EMP_DD. Upload the data template xml file we had created earlier as the Data Template file.

Data definition setup

Save the form.

Click on Templates tab.

Enter the details for the new template and upload the template file also.

Template definition setup

Now attach the report to a AP request group. You can find the request group of a responsibility by querying the responsibility form.

Responsibility to execute the program

Add the concurrent program to the request group of the responsibility in the request group form.

Request group of the responsibility

Now the program is ready available to the EY AP Administrator responsibility.

Switch responsibility to EY AP Administrator

Click on View > Requests

Select the report, EY Signing Limit Report, on the SRS form.

Execute the program

Enter the parameters. Click ok and then click on Options on the SRS form.

Program options

Ensure that the template that we have registered for the report shows in the Layout section. If it does not show on the first run then select Layout manually. This might be required when we are running the report for the first time.

Submit the request

Request status

Check the report log,

+---------------------------------------------------------------------------+
Internal Controls Manager: Version : 11.5.0

Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.

EMP_DD module: EY Signing Limit Report
+---------------------------------------------------------------------------+

Current system time is 15-MAR-2012 16:33:47

+---------------------------------------------------------------------------+

XDO Data Engine Version No: 5.6.3
Resp: 50293
Org ID : 1991
Request ID: 18988593
All Parameters: p_period1="2012/02/01 00:00:00":p_period2="2012/03/15 00:00:00"
Data Template Code: EMP_DD
Data Template Application Short Name: AMW
Debug Flag: N
{p_period2=2012/03/15 00:00:00, p_period1=2012/02/01 00:00:00}
Calling XDO Data Engine...
+---------------------------------------------------------------------------+
Start of log messages from FND_FILE
+---------------------------------------------------------------------------+
+---------------------------------------------------------------------------+
End of log messages from FND_FILE
+---------------------------------------------------------------------------+

+---------------------------------------------------------------------------+
Executing request completion options...

+------------- 1) PUBLISH -------------+
Beginning post-processing of request 18988593 on node EYEPDBG1 at 15-MAR-2012 16:33:52.
Post-processing of request 18988593 completed at 15-MAR-2012 16:33:52.

Check the output of the report.

Output

The output shows that the report is giving the correct output and is ready for use.



Viewing all articles
Browse latest Browse all 16

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>