Oracle XML Publisher V1.0 PDF
Oracle XML Publisher V1.0 PDF
Contents
Topic Page No.
Introduction to XML Publisher 3
About Classic Reporting Tool 6
Key features of XML Publisher 10
BI Publisher Architecture 19
Steps to Create XML Publisher Reports 22
Building a Data Template 51
Designing Template Layout 81
Template Features 101
XML Bursting 127
References
(Report 6i/9i/10g/11g)
Oracle Reports Builder is the report-building component of Oracle Reports, a powerful enterprise
reporting tool that enables you to rapidly develop and deploy sophisticated Web and paper reports
against any data source.
Leveraging Java EE technologies such as JSP and XML, you can publish your reports in a variety of
formats (including HTML, XML, PDF, spreadsheet, delimited text, PostScript, and RTF) to any
destination (including e-mail, Web browser, Oracle Portal, and file system) in a scalable, efficient
manner.
In Oracle Reports, a single executable RDF file contains the data source, layout, business logic, and
the language-specific prompts.
Report File
Data Logic
Layout
Multiple layouts:
o If you wish to publish the data from a report in more than one formatfor example,
in both an Excel and HTML layoutthen multiple RDF files have to be prepared.
o In case of any bug fixes are required, fixes will have to be applied to both RDF files.
Multiple language:
Global implementations for a large organization usually require the same report to be
developed in multiple languages. In case of Oracle Reports, developers will have to
create different copies of the same RDF files and place them in the <application
top>/reports/<language> directory.
In case of any bug fixes to data or any changes to layout, all the copies of reports have
to be amended.
Using BI Publisher, these tasks can be implemented by trained support staff or business
analysts.
Distribution:
The distribution capabilities in the Oracle Reports tool within E-Business Suite are very
restrictive. To distribute the output of Oracle Reports, many companies implementing
E-Business Suite have to purchase third-party products or even build their own in-
house reports distribution framework.
Data Logic
Report Output
Layout
Translation
Oracle Bi Publisher consists of One or More Sources that feed a template created by
any supported method. The resulting output can be sent/distributed to one or more
destinations.
1 Generate XML
4 Upload Template
Upload Template
Internal Sources
Run the Report (Oracle Apps)
Conc. Pg
Conc. Pg RDF etc..
PL/SQL Data Template
Reports
Reports
Internal Sources
1.2) When program Successfully completed open the output in browser and
save it in .XML file.
View the report in a browser. Because no template is associated with the report and you have
requested an XML output, the report is an XML file. Save the XML file as customer.xml in your local
drive.
Step 1.2
RTF templates are the most common and provide a wide range
of output formats.
Generate XML
Upload Template
Step 2.3:
Preview the data
Upload Template Note** multiple templates can use the same data definition.
Upload Template
Click the Lookup icon next to the Data Definition field, enter cust%, and then click Go.
Select the Customer Balance Data definition option from the list and click Select.
Upload Template
Data Definition
Template
Note** Developers generally use an Oracle reports (or) PL/SQL program to generate XML.
The data templates are useful when you need to create a XML Publisher report without
using the Oracle Reports (or) PL/SQL program.
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.
Data
Query
Data
1 Parameter Triggers 3
Template
Data
Structures
3. Condition is triggered
defaultValue This value will be used for the parameter, if no other value is supplied Optional
from the data at runtime.
include_in_output Whether this parameter should appear in XML output or not. Optional
The alid alues a e t ue a d false .
The location of the trigger indicate at what point the trigger fires:
In the data structure section you define what the XML output will be and how it
will be structured. The complete group hierarchy is available for output.
1) Break Groups
2) Group Filters
3) Summary Column
o It is strongly recommended that you use a WHERE clause instead of a group filter to
exclude records from your extract.
o Filters enable you to conditionally remove records selected by your queries, however,
this approach impacts performance.
o Groups can have user-created filters, using PL/SQL.
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
Navigation: XML Publisher Administrator -> Data Definitions -> Create Data Definition
Note down the Code. The code should be used as the short name of the concurrent
program.
Click o Add File utto to upload Data Te plate file that as eated in
previous step.
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.
Note:
Token is p_product_id. This is the bind parameter we have used in date template. For every bind
parameter used in the dataXML
Oracle template, we
Publisher have
- by to define
Dinesh Kumar Sparameter in the concurrent program.
74
Associate the Concurrent Program to a Request group.
Execute the concurrent program "Product Demo epo t and click on the Output
button get the Data XML.
Save the XML file to generate the RTF Template.
Note:
We are getting the output in xml because we did t define template &
associated yet.
Using the Table Wizard as below to create the 'Table Report Format' with the
columns of demo_products.
Performing operations in SQL is faster than performing them in the data template or
PL/SQL. It is recommended that you use SQL for the following operations:
To maximize performance when building data queries in the data template: XML
Publisher tests have shown that using bind variables is more efficient than using the
link tag.
The data Structure section is required for multiple queries and optional for single
queries. If omitted for a single query, the data engine will generate flat XML.
- Creating Placeholders
- Defining Groups
- Defining Headers & Footers
- Inserting Images
The placeholder maps the template field to the XML element data field.
At runtime the placeholder is replaced by the value of the element of the same name
in the XML data file.
1. Basic RTF Method: Insert the placeholder syntax directly into your template
document.
2. Form Field Method: (Requires Microsoft Word) Insert the placeholder syntax in
Microsoft Word's Text Form Field Options window. This method allows you to
maintain the appearance of your template.
Enter the placeholder syntax in your document where you want the XML data value to
appear.
Use Microsoft Word's Text Form Field Options window to insert the placeholder tags:
Following is the XML file that will be used as input to the Payables Invoice Register report
template:
By defining a group, you are notifying BI Publisher that for each occurrence of an
element, you want the included fields displayed.
At runtime, BI Publisher will loop through the occurrences of the element and display
the fields each time.
In the example, for each occurrence of G_VENDOR_NAME in the XML file, we want the
template to display its child elements,
o VENDOR_NAME (Supplier Name)
o G_INVOICE_NUM (the Invoices group)
o Total Entered Amount
o Total Accounted Amount.
And, for each occurrence of G_INVOICE_NUM (Invoices group), we want the template to
display Invoice Number, Invoice Date, GL Date, Currency, Entered Amount, and Accounted
Amount.
Syntax:
<?for-each:XML group element tag name?>
<?end for-each?>
Now Lets use the same XML data to create the report.
Following is the XML file that will be used as input to the Payables Invoice Register report
template:
BI Publisher supports the use of the native RTF header and footer feature.
BI Publisher supports several methods for including images in your published document:
1. Direct Insertion: Insert the jpg, gif, or png image directly in your template.
url:{'http://image location'}
To create a page break after the occurrence of a specific element use the "split-by-
page-break" alias.
This will cause the report output to insert a hard page break between every
instance of a specific element.
Note: Page breaks are supported for PDF, RTF, and PPT output. Page breaks are not
supported for HTML output.
Syntax:
<?split-by-page-break:?>
Some reports require that the initial page number be set at a specified number.
Syntax:
<?initial-page-number:pagenumber?>
BI Publisher also supports continuing the page number from a previous section.
The default behavior of a new section in a document is to reset the page
numbering. However, if your report requires that the page numbering continue
into the next section, use the following command:
<?initial-page-number:'auto'?>
BI Publisher supports the Microsoft Word functionality to specify a different page layout
for the first page, odd pages, and even pages.
To implement these options, simply select Page Setup from the File menu, then select the
Layout tab.
Note**
However, Microsoft Word does not provide settings for a different last page only. This is
useful for documents such as checks, invoices, or purchase orders on which you may want
the content such as the check or the summary in a specific place only on the last page.
Syntax:
Insert a Microsoft Word section break (type: next page) on the first page of the template. For the
final page, insert new line characters to position the summary table at the bottom of the page.
The summary table is shown in the following figure:
"if" statements
"choose" expressions
The conditional formatting that you specify can be XSL or XSL:FO code, or you can
specify actual RTF objects such as a table or data
For example,
you can specify that if reported numbers reach a certain threshold, they will
display shaded in red.
you can use this feature to hide table columns or rows depending on the
incoming XML data.
Syntax:
<?end if?>
This is extremely useful when you need to test a condition and conditionally show a
result.
Use the following syntax to construct an if-then-else statement in your RTF template:
For example, the following statement tests the AMOUNT element value.
Use the choose, when, and otherwise elements to express multiple conditional
tests.
If certain conditions are met in the incoming XML data then specific sections of
the template will be rendered.
o When the EXEMPT_FLAG equals "^", the row of data will render light gray.
o When POSTED_FLAG equals "*" the row of data will render shaded dark gray.
o Otherwise, the row of data will render with no shading.
Report Template:
BI Publisher allows you to display calculated page totals in your report. Because the
page is not created until publishing time, the totaling function must be executed by the
formatting engine.
Syntax:
<?add-page-total:TotalFieldName;'element'?>
TotalFieldName is the name you assign to your total (to reference later)
element the XML element field to be totaled.
<?show-page-total:TotalFieldName;'Oracle-number-format'?>
Oracle-number-format format you wish to use to for the display, using the
Oracle format mask (for example: C9G999D00).
The example shows how to set up page total fields in a template to display total
credits and debits that have displayed on the page, and then calculate the net
of the two fields.
90.00 <?credit?> <?add-page-total:ct;'credit'?> This field is the placeholder for the credit element from the XML
file. Because we want to total this field by page, the page total
declaration syntax is added. The variable defined to hold the
total for the credit element is ct.
Net <add-page-total:net;'debit - credit'?> Creates a net page total by subtracting the credit values from the
debit values.
EFE <?end for-each?> Closes the for-each loop.
Oracle XML Publisher - by Dinesh Kumar S 123
Report Output:
Syntax:
For Example;
Sorting a Group:
<?for-each:G_VENDOR_NAME?> <?sort:VENDOR_NAME?>
<?sort:VENDOR_NAME?> <?sort:INVOICE_NUM;'ascending';'number'?>
Bursting is a process of splitting data into blocks, generating documents for each
block, and delivering the documents to one or more destinations.
The data for the report is generated by executing a query once and then splitting the
data based on a "Key" value.
For each block of the data, a separate document is generated and delivered.
Financial reporting to generate a master report of all cost centers, splitting out
individual cost center reports to the appropriate manager
Generation of pay slips to all employees based on one extract and delivered via e-mail
One can create a single report/letter , then send it in any format (e.g., PDF or HTML) to
multiple destinations(email ids).
from or the email address from which the server should send the email
Location or the directory of the template file along with the file name
If the 3 values do not match then delivery will not take place as expected.
A temporary directory has to be provided for XML Publisher engine to use for bursting.
FTP the layout file, i.e. the XML layout template in the /tmp directory, as we have
defined in the bursting control file that the template file location is /tmp.
We are dropping the template file in this location, as the location in the
bursting control file is given as,
After the report is generated, execute the program named, XML Publisher
Report Bursting Program.
This program is responsible for bursting the XML with the help of the bursting
control file attached to the concurrent program whose output will be burst.
Note**
Ensure that this program is attached to the request group of this responsibility.
The bursting program output shows that 4 emails were delivered. Lets check
the mail box.