Professional Documents
Culture Documents
Table of Contents.................................................................1
XML Standards for XML / BI Publisher for Oracle.....................2
XML - Extensible Markup Language........................................2
Output Formats....................................................................2
Moving Templates and Data Definitions.................................3
FNDLOAD to Manage Metadata..............................................3
XML Publisher FNDLOAD File Structure:.................................3
Downloading Metadata.........................................................3
XDOLoader to Manage Files...................................................4
Moving Files.........................................................................4
Oracle Report to XML/ BI Publisher Report migration .............5
Overview:...................................................................................5
Process:.....................................................................................6
Data Model Migration:..........................................................................................6
Layout Migration:..................................................................................................7
Known Issues:............................................................................8
Batch Conversion:.......................................................................8
XML Publisher Naming Convention.........................................9
Layout/ RTF Template.................................................................9
Data Definition/ Data Template..................................................10
BI Publisher Standalone Naming Convention........................10
XML/ BI Publisher Best Practices..........................................11
Report Architecture...................................................................11
Data Extraction & Processing/ Layout or Template......................12
Data Sources and Templates..............................................................................12
Oracle BI Publisher EE (Standalone Server)..........................13
Best Practices for Layout Template......................................16
RTF Template Best Practice.................................................17
Tuning...............................................................................18
XML Standards for XML / BI Publisher for Oracle
<?xml version=”1.0”?>
<employees>
<employee>
<employee_id>120</employee_id>
<last_name>Weiss</last_name>
</employee>
<employee>
<employee_id>160</employee_id>
<last_name>Laura</last_name>
</employee>
</employees>
Output Formats
XDO_TOP/patch/115/import/xdotmpl.lct
Downloading Metadata
The FNDLOAD command takes the following format:
FNDLOAD usr/pwd@db 0 Y DOWNLOAD|UPLOAD <full path to xdotmpl.lct>
targetldtfile.ldt XMLP ATTRIBUTES
For example, to download all data definitions and templates for Accounts Receivable,
use the following command:
FNDLOAD apps/apps@mydb 0 Y DOWNLOAD
$XDO_TOP/patch/115/import/xdotmpl.lct
XMLPData.ldt XDO_DS_DEFINITIONS APPLICATION_SHORT_NAME=AR
XDOLoader to Manage Files
The XDOLoader utility is a Java-based command line program to load template (RTF,
PDF, and XSL-FO), XML, and XSD files to the XML Publisher database tables. Use this
utility to download files from one instance and load to another. Note: The XDOLoader
currently cannot handle XLIFF files. The XDOLoader has two modes
• File download only mode
• File download and LDT/DRVX generation mode
Moving Files
To upload/download the files, first set up your environment for your session by
setting the APPL_TOP and CLASSPATH.
The parameters LOB_CODE and LCT_FILE are optional, but one must be defined as
follows:
• LOB_CODE - use this parameter to download an individual template.
• LCT_FILE - if you do not define an LOB_CODE then this parameter is required. If
you want to download multiple templates, then you must provide the LCT file. The
loaded needs this file to retrieve the templates. The LCT file can be found under
$XDO_TOP/patch/115/import/xdotmpl.lct. When you use this option you will not
only get the templates, but the ldt file for the templates will be generated for you
as well.
Overview:
This document describes the usage of XML Publisher report migration APIs and
necessary guidelines for report migration process.
In Oracle Report the Data Model (data extraction logic) and Layout
(presentation), both are embedded together as an rdf file. In XML Publisher both of
these layers are separated; the migration is two step processes. Data Model
migration and Layout migration. These can be combined into a single shell script to
convert an Oracle Report. The shell script can be modified to convert all Oracle
Reports in a given directory.
The overall flow is as follows:
1. Run the conversion utility.
2. Load the PL/SQL package into the database.
3. Upload the report to the Oracle BI Publisher repository.(Exclusively For
Oracle BI Publisher – Standalone)
4. Register the Data Template and Layout Template using XML Administrator
Responsibility (Oracle EBS)
5. Test the report and check the conversion log files to identify any manual
modifications needed to complete the conversion (It can be done for both XML / BI
Publisher reports).
XMLP SupportingPL
Oracle Oracle Data /SQL
Reports Reports Template
10g 10g
RDF RDF-XML
XMLP
RTF
Templates
Pre-Requisites:
The migration APIs accept an Oracle Report in XML Format, this format is only
supported in Oracle Reports 9i and above. For R12 the Oracle Reports version in the
techstack is 10.1.3 so the conversion to RDF XML is straightforward. For Release 12
the version is 10g.
To get the Oracle Report in XML format from rdf format, either use Oracle Report
Designer or Oracle Report rwconverter.exe utility under $ORACLE_HOME/bin
Example:
This will convert the binary RDF file into an RDF-XML format that can then be
consumed by the conversion APIs.
Update the Class Path with Required JAR Files:
To run the conversion utilities you need the following files defined in your
class path:
• Collections. zip
• xmlparserv2-904.jar
• xdocore.jar
• aolj.jar
For Oracle E-Business Suite, these libraries or the corresponding classes are
available under JAVA_TOP.
For Oracle BI Publisher Enterprise, all these libraries are available under WEB-
INF\lib.
Process:
The API can be called through the command line or through a shell script. This will
generate following output files.
• DataTemplate (REPORT.xml)
• Default PL/SQL package specification (REPORTS.pls)
• Default PL/SQL package body (REPORTB.pls).
Example :
javaw.exe oracle.apps.xdo.rdfparser.DataTemplateGenerator H:\report\raxinv.xml
Output files
PL/SQL Body:H:\report\raxinvB.pls
DataTemplate:H:\report\raxinv_template.xml
Layout Migration:
Use RTFTemplateGenerator API to migrate the Oracle Reports layout to an
XML Publisher RTF template.
Since there is no support of PL/SQL in RTF Template, the process does not
migrate any format trigger logic present in the report. Instead the generator writes
all the format trigger code to log file. You will need to implement any corresponding
PL/SQL logic as XSL code. The majority of Oracle Reports use simple ‘if’ formatting
logic that can be converted relatively easily. To aid in this process, the resulting RTF
template will contain formfields that hold the format trigger names that are called,
these fields will be highlighted in red. You can then refer to the log to find the actual
PL/SQL code used in the original Oracle Report.
The API can be called through the command line or through a shell script. This
will generate following output files.
• RTF Template
• Log file
Example :
javaw.exe oracle.apps.xdo.rdfparser.RTFTemplateGenerator
H:\report\raxinv.xml
Output files
The converted Oracle Reports will generate a PL/SQL package specification file
and a PL/SQL package body file as follows:
• <report_name>S.pls
• <report_name>B.pls
Run the PL/SQL package files against your Oracle Database as follows. This
will create the PL/SQL package specification and body.
SQL> @C:\BIPublisher_reports\ARinvoice\ raxinvS.pls
SQL> @C:\BIPublisher_reports\ARinvoice\ raxinvB.pls
Simply copy the report directory and all its files to the desired folder structure
in the existing report repository.
Known Issues:
1. Some times, because of complexity of Oracle Report the, Data Template or
PL/SQL has some minor errors and requires manual correction.
2. Format triggers are not supported. The format trigger logic should be
implemented separately though XSLT
Batch Conversion:
The three components to the migration can be combined into a single shell
script to completely automate the process. Furthermore, rather than just have the
script run on a single report file, the script can be modified to run on all the reports in
a given directory.
This script will convert all RDFs in a directory. You will need a few java libraries:
1. Collections.zip – available from Sun
2. xmlparserv2-904 – available from the JAVA_TOP directories
3. A pointer to the Apps JAVA_TOP – under here are the necessary XML
Publisher libraries
The below mentioned are the XML Publisher Naming Conventions to follow in
development for the creation of Layout Templates, Data Definitions.
Example:
Name: KC Statement Generation Program
Code: XXARXSGP
Application: Receivables
Data Definition: KC Statement Generation Program
Type: RTF
Start Date: 16-MAR-2010
Description: KC Customer Statement Generation Program
Template File:
File: XXKCCUST_STMT_RTF.rtf
Language: English
Territory: US
Example:
Name: KC Statement Generation Program
Code: XXARXSGP
Application: Receivables
Start Date: 16-MAR-2010
Description: KC Customer Statement Generation Program
Data Template/ Definition File:
Data Template: XXARXSGP_DT.xml
Preview Data: XXARXSGP_DATA.xml
Report:
Data Model:
General Settings:
Name: Mandatory (Use Short Name)
Type: Mandatory, Select the List of Values based on the Requirement
SQL Query: Use Upper cases for all the Conditional Statements
like SELECT, FROM, WHERE, AND etc.
Data Template: Use the mentioned structure
<dataTemplate>
<dataQuery>
</dataQuery>
</dataTemplate>
File: Use the Report Name as the file name and keep it short
for flexibility and understanding, file extension with .xml
List of Values:
General Settings:
Name: Mandatory (Use Short Name and end with _LOV)
Type: Mandatory, Select the List of Values based on the Requirement
SQL Query: Use Upper cases for all the Conditional Statements
like SELECT, FROM, WHERE, AND etc.
Fixed Data: Add the Values (Use Upper Case for Label and
Values Should Start with Upper Case Letter and the rest lower
case letters
Parameters:
General Settings:
Identifier: Mandatory (Start with P_<Parameter Name>)
Data Type: Mandatory (Select from the List of Values)
Default Value: Optional
Parameter Type: Mandatory (Select from the List of Values)
Layout:
General Settings:
Name: Mandatory (Use Short Name and postfix with _RTF, _PDF, _XLS
and file extension as .rtf, .pdf, .xls)
Template: If Exists that will be defaulted, otherwise defaulted to the
newly created
Template Type: Mandatory (Select from the List of Values ex. RTF,
PDF, EXCEL)
Output Format: Mandatory (Select from the Radio Button Selection)
Bursting:
General Settings:
Enable Bursting: Mandatory (Select the Check Box Option)
Split By: Conditional (Based on the List of Values Defined)
Deliver By: Conditional (Based on the List of Values Defined)
Report Architecture
Separate layout & translation from data logic. This allows for greater flexibility
with report layouts, report maintenance, and optimization of the data extraction and
document generation process.
Data Extraction & Processing/ Layout or Template
Oracle EBS:
Data Source Type:
Data Template
File (XML)
Data Template:
Join and Structure data that reside on different systems & disparate data
sources
Best Practices for Large Data Sets
• Push Expensive joins to the database
• Generate XML data that are optimized for processing
o Sort Data (preferably at the source)
o Structure Data
o Pre-calculate group-level and report-level aggregate functions
• Take advantage of Before Report Triggers
-<dataTemplate name=”dataTemplateName”
description=”Template Description”
defaultPackage=”employee” version=”1.0”>
-<parameters>
<parameter name=”departments”
dataType=”character” defaultValue=”10”/>
</parameters>
-<dataQuery>
<sqlStatement name=’Q1”>
SELECT EMPNO, ENAME from emp where
deptno=:department
</sqlStatement>
</dataQuery>
-<dataTrigger name=”deforeReport”
source=”employee.beforeReportTrigger”/>
-<dataStructure>
-<group name=”G_EMPLOYEE” source=”Q1”>
<element name=”Employee_Number”
value=”EMPNO”/>
<element name=”Name” value=”ENAME”/>
</group>
</ dataStructure>
</ dataTemplate>
File (XML):
<?xml version=”1.0”?>
<employees>
<employee>
<employee_id>120</employee_id>
<last_name>Weiss</last_name>
</employee>
<employee>
<employee_id>160</employee_id>
<last_name>Laura</last_name>
</employee>
</employees>
Connection Type:
JDBC
JNDI (Recommended, can take advantage of connection pooling)
Data Template:
Join and Structure data that reside on different systems & disparate data sources
Best Practices for Large Data Sets
• Push Expensive joins to the database
• Generate XML data that are optimized for processing
o Sort Data (preferably at the source)
o Structure Data
o Pre-calculate group-level and report-level aggregate functions
• Take advantage of Before Report Triggers
SQL Query:
Enter the SQL Query or Use Query Builder to build the SQL Query.
Three Sections: Object Selection Pane, Design Pane displays the selected object
from the Object Selection Pane, and Output Pane allows creating conditions, to view
the generated SQL and Result of the Query.
File (XML):
<?xml version=”1.0”?>
<employees>
<employee>
<employee_id>120</employee_id>
<last_name>Weiss</last_name>
</employee>
<employee>
<employee_id>160</employee_id>
<last_name>Laura</last_name>
</employee>
</employees>
BI Publisher supports document/literal Web service data sources that return the
following data types:
• String
• Boolean
• dateTime
• decimal
• integer
Tip: If the WSDL URL is outside of your company firewall you must start the BI
Publisher sever using proxy parameters.
BI Publisher supports Web services that return both simple data types and complex
data types. You must make the distinction between simple and complex when you
define the Web service data model.
Note that if you want to include parameters for the Web service method, you must
define the parameters first, so that they are available for selection when setting up
the data source. Multiple parameters are supported. Ensure the method name is
correct and the order of the parameters matches the order in the method.
Note that only parameters of simple type are supported, for example, string and
integer.
• Enter the WSDL URL and the Web Service Method.
Important: Only document/literal Web services are supported.
• To specify a parameter, select the Add link. Select the parameter
from the list.
Note: The parameters must already be set up in the Parameters section of
the report definition
Element Naming:
Avoid re-using the same name for element names. This does sometimes make
sense – for example CITY under SHIPPING_ADDRESS and BILLING_ADDRESS. But in
many cases you are better of using different names.
Use short element names to reduce the XML file size.
Avoid using XML attributes, they are supported but are more complicated to
use in the Template Builder for word
Supported Modes:
XML Publisher supports two methods for creating RTF templates:
• Basic RTF Method
• Use any word processing application that supports RTF version 1.6 writer (or
later) to design a template using XML Publisher's simplified syntax.
• Form Field Method
• Using Microsoft Word's form field feature allows you to place the syntax in
hidden form fields, rather than directly into the design of your template.
Note: If you use XSL or XSL:FO code rather than the simplified syntax, you
must use the form field method.
Oracle EBS:
Oracle XML Publisher supports the following three Layout Template Types in Oracle
EBS.
Use Tables
• To optimize the exact placement of elements when the template is
transformed into XSL, it is recommended that you use tables to define the
placement and alignment.
• By using a table, each element can be aligned within its own cell and in exact
positions.
• Tables used for formatting only can be hidden at runtime by turning off
(hiding) the table gridlines.
Use Word Styles
• Makes it easier to achieve consistency in the template and between templates
Use Form Fields
• Form Fields keep the template clean
• Form Fields are supported by the Template Builder Field Browser
• Form Fields can be colored or hidden to understand the structure
Caveat: Word Header and Footer don’t allow Form Field
Don’t Overcomplicate the Template
• The Template is easier to understand, debug and maintain
• In general it is better to have different business documents in different
templates
• Try to limit the logic in templates to simple if or loop statements
• Use Sub templates to simplify documents if necessary
• Some calculations are easier performed in the data templat
Use Sub-Template:
• XSL sub templates for code re-use or separation
• RTF sub templates for layout re-use
• Caveat: Use of RTF sub templates makes it hard to understand the template
structure
Use Cases:
RTF sub templates:
• Re-use common layouts such as header/footer
• Internationalized address block
XSL sub templates:
• Transformations for complex chart requirements
• Dynamically apply formatting to a portion of data
• Print formatted XHTML data – convert to FO using sub template
Tuning
Tables:
Large tables that continue over hundreds of pages consume considerable server
resources. If possible group the data and create a table inside each grouping.
Grouping:
• Sorting large data sets is typically better performed by the database (indices,
efficient disk sorting..)
• However, regular grouping <?for-each-group?> will force the XSL engine to
“sort” the data.
• The group-adjacent option will not resort the data
• <xsl:for-each-group select=“…" group-adjacent=“INVOICE">
• Checking “Data already sorted” option in the Table Wizard will make use of
group-adjacent