XML/BI Publisher – A Comprehensive Guide for Troubleshooting Kiran Kumar Gupta Killamsetty Gomathi Madheswaran Author: Kiran Kumar Gupta Killamsetty Gomathi Madheswaran Target readers XML Report Developers/ Leads Table of Contents 1. Installations XML Publisher Desktop Version 3 2. XML Publisher Report using Concurrent Program 4 Different activity to develop Report base XML Publisher. 4 a. Creating sample table 4 b. Create a report and register it as Concurrent Program of type XML 5 c. Creating Sample Word Template for XML Report. 7 3. XML Publisher Report using a SQL. 11 a. Introduction 11 b. The Data Template Definition 11 c. Construction of Data Template 12 d. Steps to Build XML Report using Data Template using SQL 14 4. Template formatting tips. 18 a. Inserting a field 18 b. If Statement 19 c. Setting Display property of a table at run time using if statement 19 d. Case statement 19 e. Importing a sub template 20 f. Inserting subtemplate in template rtf 20 g. Include repeating frame/table. 20 5. Bursting in XML Publisher 21 Advantages of XMLP Bursting 21 Prerequisites 21 Setups to create XML Publisher report using Bursting functionality 22 Steps to create Bursting Report: 25 6. Migration of XML Publisher reports between instances. 27 a. Different Components consider for migration. 27 b. Oracle Apps utilities for migration of XML Publisher components. 27 7. Known Issues: 31 8. Enhancements 33 9. Reference Documents 37 1. Installations XML Publisher Desktop Version This chapter explains installation of XML Publisher desktop version. Pre-Requisite : .Net Frame Work 2 Software : Oracle Patch Number 4561835 http://updates.oracle.com/download/4561835.html
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
XML/BI Publisher – A Comprehensive Guide for TroubleshootingKiran Kumar Gupta KillamsettyGomathi Madheswaran
Table of Contents1. Installations XML Publisher Desktop Version 32. XML Publisher Report using Concurrent Program 4
Different activity to develop Report base XML Publisher. 4a. Creating sample table 4b. Create a report and register it as Concurrent Program of type XML 5c. Creating Sample Word Template for XML Report. 7
3. XML Publisher Report using a SQL. 11a. Introduction 11b. The Data Template Definition 11c. Construction of Data Template12d. Steps to Build XML Report using Data Template using SQL 14
4. Template formatting tips. 18a. Inserting a field 18b. If Statement 19c. Setting Display property of a table at run time using if statement 19d. Case statement 19e. Importing a sub template 20f. Inserting subtemplate in template rtf 20g. Include repeating frame/table. 20
5. Bursting in XML Publisher 21Advantages of XMLP Bursting 21Prerequisites 21
Setups to create XML Publisher report using Bursting functionality 22Steps to create Bursting Report: 25
6. Migration of XML Publisher reports between instances. 27a. Different Components consider for migration. 27b. Oracle Apps utilities for migration of XML Publisher components. 27
7. Known Issues: 318. Enhancements 339. Reference Documents 37
1. Installations XML Publisher Desktop Version
This chapter explains installation of XML Publisher desktop version. Pre-Requisite : .Net Frame Work 2Software : Oracle Patch Number 4561835
http://updates.oracle.com/download/4561835.html
After installation MS Word will get additional add-in as shown in the
Verify the Patch installation:Application Object Library (FND) patch 3435480 fullyIntegrates XML Publisher with the Concurrent Manager
2. XML Publisher Report using Concurrent Program
This chapter explains step by step processes to build XML Publisher report using source as Oracle Concurrent Program.Different activity to develop Report base XML Publisher.
a. Creating sample table to do this exercise b. Create a report and register it as Concurrent Program of type XMLb. Build a Data Definition & XML Template using XML Publisher.c. Create a relation between XML Template & Concurrent Program.
a. Creating sample table
Table Script:CREATE TABLE EMP( EMPNO NUMBER, ENAME VARCHAR2(100 BYTE), MGR VARCHAR2(100 BYTE), HIREDATE DATE, SAL NUMBER, COMM NUMBER);
b. Create a report and register it as Concurrent Program of type XML
1. Creating Oracle Report
SQL:Select * from Emp;
Data Model:
Default Layout:
Add following user Defined Parameters:
P_CONC_REQUEST_ID, P_RESPONSIBILITY_ID, P_USER_ID
Note : These parameters are mandatory to run report.
Sample File :
2. Migrate newly created custom rdf file to Oracle Application server at appropriate location.
3. Register report as concurrent program.
a. Executable using Application Developer Responsibility :
b. Concurrent Program using Application Developer Responsibility :
Note : Select Output as XML
c. Associate with a request Group
d. Attach to request group to a Responsibility.
4. Run the report and you will see an xml output appearing. Save the output as XMLREP1.xml on your computer. You will need to use menu /Tool/Copy to open this XML output in browser, and then save it as XX XMLREP1.xml on your PC.
Sample File :
c. Creating Sample Word Template for XML Report.
5. Open MS Word and click the Add-Ins menu you will get Custom Toolbars (refer installation section for more details). Load
Data from Data menu to load the report output (xml file).
6. Insert table using Insert Table option
7. I have added two different tables as shown below. By doing this you have created XML Publisher template.
Sample File:
8. Create Data Template for XML report as mentioned below (XML Publisher Admin Data Template Create)
Note: Code Name should be Report Concurrent program short Name.
9. Create template as given below
10. Navigate back to “UL Custom Responsibility” and submit the concurrent program “XXUL XML Publisher Report 1” and see the output.
Note: Layout value should default with template name. This we can ensure link between Concurrent Program and Template established correctly.
3. XML Publisher Report using a SQL.
For any XML Publisher report requires a template layout (RTF template) and Data XML (Data Definition) to generate any report. In the previous section we have learned how to build XML Publisher report from Oracle Report. This section we would be learning how to build XML Report without using Oracle Report.
a. Introduction
The XML Publisher data engine enables you to rapidly generate any kind of XML data Structure against the Oracle database in a scalable, efficient manner. The data template is the method by which you communicate your request for data to the data engine. It is an XML document whose elements collectively define how the data engine will process the template to generate the XML.
The data engine supports the following functionality:• Schema generation• Default RTF template generation• Flexfields• Single and multiple data queries
•Query links• Parameters• Multiple data groups• Aggregate functions (SUM, AVG, MIN, MAX, COUNT)• Event triggers• Distributed queries across multiple databases
b. The Data Template Definition
The data template is an XML document that consists of four basic sections: define parameters, define triggers, define data query, define data structure. This structure is shown in the following graphic:
Attributes:• name (Required)• description• version (Required)• defaultPackage - the PL/SQL package name to resolve any lexical references, group filters, or data triggers defined in the template.• dataSourceRef - the default data source reference for the entire data template. Required only when performing a distributed query across multiple data sources.
Consists of one or more <parameter> elementsdataType Optional. Specify the parameter data type as"character", "date", or "number". Default value is"character".For the "date" dataType, the following three formats(based on the canonical ISO date format) are supported:• YYYY-MM-DD (example: 1997-10-24)• YYYY-MM-DD HH24:MI:SS (example: 1997-10-2412:00:00)• YYYY-MM-DDTHH24:MI:SS.FF3TZH:TZMdefaultValueThis value will be used for the parameter if no other value is supplied from the data at runtime.
ne a Data Link Between QueriesHow to DeExample :<link name="DEPTEMP_LINK" parentQuery="Q1" parentColumn="DEPTNO" childQuery="Q_2"childColumn="DEPARTMENTNO"/>
Attributes:• parentQuery - specify the parent query name.• parentColumn - specify the parent column name.• childQuery - specify the child query name.• childColumn - specify the child
column name.• condition - the SQL operator that defines the relationship between the parent column and the child
Lexical References Create a lexical reference using the following syntax:¶meternameNote : define a parameter (package variable) in the PL/SQL default package for each lexical reference in the query.
d. Steps to Build XML Report using Data Template using SQL
Step 1: Create the Data Definition in XML Publisher and associate it with Data Template
Create Data Template as shown below and note down the code name (EMP_DD1), this code should be used as concurrent program short name.
Add Data Template file which we have created in the previous session.
Step 2: Create Concurrent program as shown below. Short Name should be equal to Data Template code name.
Note: XDOTEXE is a standard Oracle Java Program.
Step 3: Create RTF template
Sample file.
RTF File
XML Data File
Step 4: Create Template and associate Data Definition.
Step 5: Navigate back to “UL Custom Responsibility” and submit the concurrent program “XXUL EMP DEP XML SQL Report”.
Sample Output :
4. Template formatting tips.
This session will discuss about various available in XML Publisher to manipulate the RTF template.
c. Setting Display property of a table at run time using if statement
Following table will display only if <field name> contains “Y” value<?if: <Field
Name>=”Y”?>I am an employee of the company.I confirm I am not an independent, non-employee representative of the company. I confirm I have authority to accept or reject this agreement.I have been provided the content of this agreement and have reviewed it.I accept this agreement on behalf of the company and agree that the company will be bound by it.
By:
d. Case statement
<?choose:?><?when:expression?><? end when ?><?otherwise?><?end otherwise?>
Very common requirement in reporting is to split/print report in different pages depending transaction number. XML Publisher’s bursting engine accepts data stream and splits it based on multiple criteria. The engine provides flexibility to choose delivery channel. Example: Employee Pay slips and delivered via email.
Advantages of XMLP Bursting
No Additional Coding, just need to create XML bursting File. ( Isn't it exciting , otherwise we would have to write java program to split the XML File and then use XMLP delivery manager API to send emails .
Process of Creating XML data Definition and Template remains AS – IS .
Prerequisites
Apply patch 5968876 if not already applied
Verify XMLP version is 5.6.3
Steps to Verify if XMLP is indeed 5.6.3
adident Header $OA_JAVA/oracle/apps/xdo/common/MetaInfo.classMetainfo.class XML
<?xml version="1.0" encoding="UTF-8"?><xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi"><xapi:request select="/EMPLOYEES/EMPLOYEE"> <! - This sets the burstingelement i.e., EMPLOYEE (group name)- ><xapi:delivery><xapi:email id=”<ID Name>”server=" usnbkm201.us.ul.com" port="25"from="[email protected]" reply-to ="reply@ us.ul.com "> <!- Mention SMPT Server Name and port number. - ><xapi:message id="123" to="${EMAIL}" cc="${EMAIL_ALL}"attachment="true" subject="Employee Detailsfor ${ENAME}"> Mr. ${ENAME}, Please review theattached document</xapi:message><! - This assigns a delivery id of ’123’. It also sets the e-mailaddress of the employee and a cc copy to a parameter valueEMAIL_ALL; this might be a manager’s e-mail. The employee’sname (ENAME) can also be used in the subject/bodyof the email. - ></xapi:email><xapi:fax server="ipp://mycupsserver:631/printers/fax2">
<xapi:print id="printer1" printer="ipp://mycupsserver:631/printers/printer1" copies="2" /></xapi:delivery><xapi:document output-type="pdf" delivery="123"><xapi:template type="rtf" location="/usr/tmp/empGeneric.rtf"><xapi:template type="rtf" location="/usr/tmp/empDet.rtf"filter=".//EMPLOYEE[ENAME=’SMITH’]" ><! - Employees with the name SMITH will havethe empDet template applied - ></xapi:template></xapi:document></xapi:request></xapi:requestset>
3. Use the attribute select under the request element to specify the element in the XML data that you wish to burst on
4. Use the attribute id under the lowest level of the delivery structure (for example, for the delivery element email, the id attribute belongs to the message element. This assigns an ID to the delivery method to be referenced later in the XML file.
5. Use the delivery attribute under the document element. This assigns the delivery method for the generated document as defined in the id attribute for the delivery element. You can specify multiple delivery channels separated by a comma.
This will apply the empDet template only to those employees with the name "SMITH". All other employees will have the empGeneric template applied. This filter can use any XPATH expression to determine the rules for the template application.
7. Dynamic Delivery Destination
You can reference elements in the data to derive certain delivery attributes, such as an e-mail address or fax number. Enter the value for the attribute using the following form:${ELEMENT} where ELEMENT is the element name from the XML data that holds the value for the attribute.For example:<xapi:message id="123" to="${EMAIL}"/>At runtime the value of the to attribute will be set to the value of the EMAIL element from the input XML file. You can also set the value of an attribute by passing a parameter to API in a Properties object.
8. Dynamic Delivery Content: Options same as above.
9. Run the below procedure in APPS Schema
CREATE OR REPLACE PROCEDURE xx_submit_bursting(p_request_id IN INTEGER) ASn_request_id NUMBER;BEGINn_request_id := fnd_request.submit_request('XDO','XDOBURSTREP',NULL,NULL,FALSE,p_request_id,'Y');END xx_submit_bursting;/
11.
Steps to create Bursting Report:
1. Create table which will provide data for Bursting Report2. Create a report name <Report Name> 3. Run the report in preview mode in reports designer4. Add user parameters to this report and FTP to $<Custom Location>/reports/US5. Register this report as concurrent program of type XML6. Add this report to Request group7. Run this report and save the xml file as xx_manager_output.xml8. Download & install XML Publisher desktop software latest version[as yet]9. Import xx_manager_output.xml in MS Word, and create default layout10. Save the default layout as rtf file MANAGER_XML_TEMPLATE.rtf11. Preview the report output within MS Word using XMLP Preview option12. Define data definition for the XMLP Report13. Prepare a simple bursting file, with help of XML xx_manager_output.xml
Sample file
14. Upload the bursting control file to data definition
15. Create XMLP Template XX_MANAGERS, and upload MANAGER_XML_TEMPLATE.rtf to this template.
16. Create pl/sql procedure xx_submit_bursting in apps schema, that submits fnd_request for XDOBURSTREP, with debug parameter= Y (Refer Setup 9)
17. Call XDOBURSTREP from After report trigger, passing it current request_id
18. Ensure that srw.user_exit('FND SRWINIT') has been called from before report trigger
19. FTP the XX_MANAGERS.rdf againt to $<Custom Location>/reports/US
20. Run the report, and you will see the Bursted Output in mailbox.
6. Migration of XML Publisher reports between instances.
In this article we will discuss in details the steps involved in the moving the XML Publisher / BI Publisher report components across instances.A XML Publisher report development is a multi step process requiring a technical consultant to develop multiple files and register with XML Publisher Administrator. In addition to registering, consultant needs to integrate the report with oracle applications using Concurrent Program or OA Framework Self Service Application. Due to these complexity, its very important to understand the steps involved in moving the components of a XML Publisher report across instances.
a. Different Components consider for migration.
Data Definition
Data Template
Data Definition File.
Concurrent Program
b. Oracle Apps utilities for migration of XML Publisher components.
XML Publisher provides FNDLOAD and XDOLoader to migrate XML Publisher components.
FNDLOAD : This tool is used to migrate Data Definition, Data Template definition and Concurrent Programs.
Download a particular data definitions and its corresponding Templates.FNDLOAD apps/<Password> 0 Y DOWNLOAD $XDO_TOP/patch/115/import/xdotmpl.lct targetldtfile.ldt XDO_DS_DEFINITIONS APPLICATION_SHORT_NAME=XXX DATA_SOURCE_CODE=EMP_DD Upload the data definitions and its corresponding Templates to an instance.FNDLOAD apps//<Password> @db 0 Y UPLOAD $XDO_TOP/patch/115/import/xdotmpl.lct targetldtfile.ldt
XDOLoader : This tool is used to download and upload physical files.
Option I File download Only Mode allows you to download files of the specified type (BURSTING_FILE, DATA_TEMPLATE,TEMPLATE,XML_SAMPLE,XML_SCHEMA) from a specified application short name. If you specify the data definition or template code, then it download the specified file type of that data definition or Template. But when i tested the command, it generated files of all type attached to a data definition in a specified application short name including the drv file.Download Syntax :
Option IIFile Download and LDT/DRVX Generation Mode allows you to download all the files (BURSTING_FILE,DATA_TEMPLATE,TEMPLATE,XML_SAMPLE,XML_SCHEMA) for a specified application short name. If you specify the data definition, then it will download all the files for the specified data definition. IN addition these files, it also generates a DRVX files, which has the upload script for each of the file downloaded.
1. “Unable to find published output for this request”
Issue Root Cause:When we submit a concurrent program to generate XML Publisher / BI Publisher report using fnd_request.submit_request , the Template Name, Template Language and Format is not set in the concurrent program option. Hence when we try to view the output, we get the error "Unable to find published output for this request".Root Cause: When we submit a concurrent program to generate XML Publisher / BI Publisher report using fnd_request.submit_request , the Template Name, Template Language and Format is not set in the concurrent program option. How to overcome this issue:Call fnd_request.add_layout before calling the fnd_request.submit.Signature:Fnd_request.add_layout (template_appl_name in varchar2, template_code in varchar2, template_language in varchar2, template_territory in varchar2, output_format in varchar2) return boolean is
For OAF use addLayout method in oracle.apps.fnd.cp.request.ConcurrentRequest class.
Issue2:Issue Root Cause:Beginning post-processing of request 11180253 on node USNBKA030 at 02-OCT-2009 16:41:33.Post-processing of request 11180253 failed at 02-OCT-2009 16:48:34 with the error message:The concurrent manager has timed out waiting for the Output Post-processor to finish this request.Root Cause: By default a timeout will occur if it takes longer then 300 seconds (5 min.) for the XML Publisher engine to generate the output file. The Concurrent Request will complete with status Warning and the Request log file will contain Error Message B.How to overcome this issue:There are 2 new profiles options that can be used to control the timeouts. Depending on the error message, one of the following solutions needs to be implemented.
Profile Option: Concurrent: OPP Response TimeoutInternal Name: CONC_PP_RESPONSE_TIMEOUTDescription: Specifies the amount of time a manager waits for OPP to respond to its request for post processing.
Profile Option: Concurrent: OPP Process TimeoutInternal Name: CONC_PP_PROCESS_TIMEOUTDescription: Specifies the amount of time the manager waits for the OPP to actually process the request.
8. Enhancements
i. How to generate XML outputs in different Languages based on the user preference?
Solution:
While defining the Templates, We can attach templates for different Language and territory combination in according to the needed user preference values.
ii. How to set Background color for each alternate row?
Solution: This below sample code is used to set the background of the alternative rows in light silver color. This code has to be added in the row first property as shown in the screen shot. <?if@row:position() mod 2=0?><xsl:attribute name="background- color"xdofo:ctx="incontext">Needed Colour </xsl:attribute>
iii. How to add sorting condition in the template?
The records can be sorted by by particular field. It can be done by setting by the row level property as shown in the screen shot for a particular group of data.<?sort:field_name?>
iv. How to eliminate zero amount lines ?
Based on the field data value (whether it holds zero or non-zero), we can restrict the data to display or not in the output file.
By defining the condition in row level property of the particular group of data as shown in the below screen shot.
<?if field_value > 0?>
v. How to define number formats?
We can define the number formats in the field value as shown in the below screen shot.
vi. How to make titles to repeat on each page?
We can use the table property to make the titles to repeat on each pages as shown below.