Você está na página 1de 153

Oracle XML Publisher - by Dinesh Kumar S

Contents
Topic

Page No.

Introduction to XML Publisher

About Classic Reporting Tool

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

Oracle XML Publisher - by Dinesh Kumar S

Introduction to XML Publisher

Oracle XML Publisher - by Dinesh Kumar S

What is in Name?

Current Name

Old Name

Oracle BI Publisher

XML Publisher

Oracle BI Publisher Desktop

Template Builder

Oracle Bi Publisher Enterprise

XML Publisher Stand-alone

Oracle XML Publisher - by Dinesh Kumar S

What is Oracle BI Publisher?


Oracle BI Publisher is a Java-based product within the technology stack of
eBusiness Suite.
Which provides user with,
o A template based publishing solution.
o A tool to develop and maintain reports.
o it decreases overall cost associated to customizations and maintenance.

What is Oracle BI publisher Desktop?


It is an extension to Microsoft Word (2000 or later), that simplifies RTF creation.
It allows following functions,
o Insert Data fields, tables, forms and charts.
o Preview the template with sample XML data.
o Browse & update form fields and many more.

Oracle XML Publisher - by Dinesh Kumar S

About Classic Reporting Tool


(Report 6i/9i/10g/11g)

Oracle XML Publisher - by Dinesh Kumar S

About Classic Reporting Tool

What is Report Builder?

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

Oracle XML Publisher - by Dinesh Kumar S

Translation

Key Limitations of Classic Reporting Tool


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.

Oracle XML Publisher - by Dinesh Kumar S

Trivial tasks:
Even trivial tasks like changing the prompt or minor changes to the layout require a
developer in Oracle Reports.
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 inhouse reports distribution framework.
With BI Publisher, a mechanism named bursting can automate distribution of the
reports using industry standard delivery protocols.

Securing the output:


When distributing the output of Oracle Reports in E-Business Suite, it is not possible to
secure the output using a password.
BI Publisher facilitates password protection of the documents.
Oracle XML Publisher - by Dinesh Kumar S

Key features of XML Publisher

Oracle XML Publisher - by Dinesh Kumar S

10

Oracle BI Publisher Paradigm

Data Logic
Report Output

Layout

Translation

Oracle XML Publisher - by Dinesh Kumar S

11

1. Flexible Deployment Options

Oracle XML Publisher - by Dinesh Kumar S

12

2. Many Source

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.
Oracle XML Publisher - by Dinesh Kumar S

13

3. Extract Once Publish Many times

Oracle XML Publisher - by Dinesh Kumar S

14

4. Report Bursting

Oracle XML Publisher - by Dinesh Kumar S

15

5. Distributed Delivery

Oracle XML Publisher - by Dinesh Kumar S

16

6. Multiple Language Support

Oracle XML Publisher - by Dinesh Kumar S

17

7. High Data Engine Performance


Fast, Scalable extraction engine.
Integrated into concurrent manager
Migration tools available for Oracle Reports.
30-40% faster reporting.

Multiple Queries & joins


Event triggers
Flexfield Support
Formula/Summary Columns
Data bursting
Distributed Queries.

Oracle XML Publisher - by Dinesh Kumar S

18

BI Publisher Architecture

Oracle XML Publisher - by Dinesh Kumar S

19

BI Publisher Architecture

Oracle XML Publisher - by Dinesh Kumar S

20

Data handler

Data engines are registered with data handler. It can be any


XML source.

Template Manager

It is user interface that is uilt o e olle tio of API s that


enable customer to register & maintain their data definitions
& templates.

Document Processor

It allows user to build single document for multiple data


source and template combination (or) individual docs for
each combinations.

Translation Handler

It provides user with ability to register & maintain data


definitions & template in a friendly user interface.

Delivery Server

Takes the output document & delivers it to destination.

Oracle XML Publisher - by Dinesh Kumar S

21

Steps to Create XML Publisher Reports

Oracle XML Publisher - by Dinesh Kumar S

22

Steps for Generating XML Publisher Reports

Generate XML

Create RTF Template

Create Data Definition

Upload Template

Run the Report

Oracle XML Publisher - by Dinesh Kumar S

23

Step 1: Generate XML

Oracle XML Publisher - by Dinesh Kumar S

24

We can generate XML from multiple sources as below,


Generate XML

Create RTF Template

Create Data Definition

External Sources
(DWH, MDX Query, Web Services,
LDAP, Oracle Discoverer)

Upload Template

Internal Sources
(Oracle Apps)

Run the Report

Conc. Pg
PL/SQL
Reports

Conc. Pg RDF
Reports

Data Template

Oracle XML Publisher - by Dinesh Kumar S

etc..

25

Lets generate XML using RDF Report Output.

Internal Sources

Conc. Pg PL/SQL
Reports

1.1) Choose a Co u e t p og a

Conc. Pg RDF
Reports

Data Template

& et the Output Fo

at as XML .

1.2) When program Successfully completed open the output in browser and
save it in .XML file.

Oracle XML Publisher - by Dinesh Kumar S

26

Lets Choose the below report,

Application

Receivables

Report Name

Customer Open Balance Letter

Step 1.1

Oracle XML Publisher - by Dinesh Kumar S

27

In the Requests window, search for your Job ID and check the status of the job. If the job is
completed, click the View Output button.

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

Oracle XML Publisher - by Dinesh Kumar S

28

Step 2: Create RTF Template


2.1) Create RTF Template
2.2) Load the XML Data
2.3) Preview the Output

Oracle XML Publisher - by Dinesh Kumar S

29

BI Publisher supports several types of templates.


RTF templates are the most common and provide a wide range
of output formats.
Generate XML

Create RTF Template

We can use the BI Publisher Template Builder, which is an Addin to Microsoft Word, to build an RTF template.

Create Data Definition

Upload Template

Run the Report

Oracle XML Publisher - by Dinesh Kumar S

30

Step 2.1: Create RTF Template

Oracle XML Publisher - by Dinesh Kumar S

31

Select Data > Load XML Data from the BI Publisher menu.

Load XML Data.

Select XML saved


from previous step.

Step 2.2: Load XML Data

Oracle XML Publisher - by Dinesh Kumar S

32

Click Preview>PDF from BI Publisher menu to view the report in PDF.

Step 2.3:
Preview the data

Oracle XML Publisher - by Dinesh Kumar S

33

Step 3: Create Data Definitions

Oracle XML Publisher - by Dinesh Kumar S

34

Generate XML

Create RTF Template

Create Data Definition

Upload Template

To publish your report, you must register the data source that
would be merged with the template.
When you register your layout template file (in the next
section), you must assign to it a data definition that exists in the
Template Manager. This associates the two at run time.
Note** multiple templates can use the same data definition.

Run the Report

Oracle XML Publisher - by Dinesh Kumar S

35

Step 3.1) Log in to E-Business Suite and click XML Publisher Administrator.

Oracle XML Publisher - by Dinesh Kumar S

36

Step 3.2) Click the Data Definitions link and you will be on the Data Definition tab for XML
Publisher. Click the Create Data Definition button to create a new data definition.

Oracle XML Publisher - by Dinesh Kumar S

37

Step 3.3) Under Create Data Definition, fill the form as shown below. It is critical that you use
the correct short name of the Concurrent Program - ARXCOBLX to correctly link this data
definition to the underlying Concurrent Program and Oracle Reports report. For the Name
field, you can use whatever you like. Click Apply.

Oracle XML Publisher - by Dinesh Kumar S

38

Step 3.4) You should see a confirmation message. Now you have successfully created the
data definition for the Customer Balance Letter.

Oracle XML Publisher - by Dinesh Kumar S

39

Step 4: Upload Template

Oracle XML Publisher - by Dinesh Kumar S

40

Use the Template Manager to Upload the Template.


Generate XML

Create RTF Template

Step 4.1) On the Template tabbed page for XML Publisher,


click Create Template.

Create Data Definition

Upload Template

Run the Report

Oracle XML Publisher - by Dinesh Kumar S

41

Step 4.2) Enter the template name as Customer Balance Letter - Template.
Select Application name as Receivables using the Lookup icon. Enter code as ARXCOBLX.

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.

Oracle XML Publisher - by Dinesh Kumar S

42

Step 4.3) Select the template type as RTF from the Type drop-down list. Remember, you
had saved your template as an RTF file.

Oracle XML Publisher - by Dinesh Kumar S

43

Step 4.4) You now need to upload the template that you created in Microsoft Word. To
select the template file you created, scroll down to the Template File section. For File,
browse and open the file called Balance Letter - Template.rtf.

Step 4.5) Select the Language as English.

Oracle XML Publisher - by Dinesh Kumar S

44

Step 4.6) Click Apply. You should get a message that your template has been created
successfully.

Oracle XML Publisher - by Dinesh Kumar S

45

Step 5: Run the Report

Oracle XML Publisher - by Dinesh Kumar S

46

Generate XML

Submit the Report.


Create RTF Template

Create Data Definition

Upload Template

Choose the Report Name

Run the Report

Oracle XML Publisher - by Dinesh Kumar S

47

Note that in the Layout field, the layout template file is listed. Click the Options button
to see the other options that you can set after the report is completed.

Oracle XML Publisher - by Dinesh Kumar S

48

The Upon Completion.. window appears. In this window, you can specify what actions can
be taken after the job is executed. You can notify one or more people about the report. You
can send the report to be printed. Click OK.

Oracle XML Publisher - by Dinesh Kumar S

49

In the Requests window, search for your Job ID and check the status. If the job is completed,
click the View Output button.

Oracle XML Publisher - by Dinesh Kumar S

50

Building a Data Template

Oracle XML Publisher - by Dinesh Kumar S

51

About Data Template


XML Publisher reports contain 2 main components.
Data Definition
Template
Data Definition
Template

Generates the XML for XML Publisher Engine.


XML is processed into template to generate the report.

Note** Developers generally use an Oracle reports (or) PL/SQL program to generate XML.

When Data Template are useful?


The data templates are useful when you need to create a XML Publisher report without
using the Oracle Reports (or) PL/SQL program.

Oracle XML Publisher - by Dinesh Kumar S

52

Logical Flow
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.

Oracle XML Publisher - by Dinesh Kumar S

53

Data Template Definition


The data template consists of 4 basic section,
2
Data
Query

Parameter

Data
Template

Triggers

Data
Structures

4
Oracle XML Publisher - by Dinesh Kumar S

54

Before understanding the Data Template components lets understand simple PL/SQL
procedure, which generates tabular report.
1. Creating Procedure with Parameters

2. Data Query is executed

3. Condition is triggered

4. Report Generated in tabular structure

Oracle XML Publisher - by Dinesh Kumar S

55

Data Template Structure

Oracle XML Publisher - by Dinesh Kumar S

56

Element

Description

Data Template

This is the root element.

Property
Section

Required?

Use it to set properties to affect the XML output and data


engine execution.
A parameter is a variable whose value can be set at runtime.
Parameters are especially useful for modifying SELECT
statements and setting PL/SQL variables at runtime.

Yes
Optional

Data Query
Section

This section holds the SQL Query for which XML to be


generated.

Data Trigger

Data triggers execute PL/SQL functions at specific times during


the execution and generation of XML output.
Using the conditional processing capabilities of PL/SQL for
these triggers, you can do things such as perform initialization
tasks and access the database.

Optional

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.
It is required for multiple queries and optional for single
queries.
If omitted for a single query, the data engine will generate flat
XML.

Yes Multiple
Query

Data Structure

Oracle XML Publisher - by Dinesh Kumar S

Yes

Optional
Single Query

57

Data Template Section Attributes


Data Template Attributes:

Attribute Name Description

Required?

name

Template name (User defined).

description

Description of data template (User defined).

version

(Required) Enter a version number for this data template.

defaultPackage

if data template contains lexical references or any other calls Yes if lexical is
used
to PL/SQL.

dataSourceRef

The default data source reference for the entire data


template.

Oracle XML Publisher - by Dinesh Kumar S

Yes
Optional
Yes

Yes

58

Property Section Attributes:

Attribute Name
name

Description
A keyword, unique within a given Data Template, that identifies the
parameter.
Specify the parameter data type as "character", "date", or "number".
Default value is "character".

Required?
Yes

defaultValue

This value will be used for the parameter, if no other value is supplied
from the data at runtime.

Optional

include_in_output

Whether this parameter should appear in XML output or not.


The alid alues a e t ue a d false .

Optional

dataType

Oracle XML Publisher - by Dinesh Kumar S

Optional

59

Data Query Attributes:

Following Column types acceptable,


VARCHAR2, CHAR, NUMBER, DATE, TIMESTAMP, BLOB , CLOB , REF CURSOR

Attribute Name

Description

name

A unique identifying name for the query.


Note that this name will be referred to throughout the data
template.

Oracle XML Publisher - by Dinesh Kumar S

60

Data Trigger Attributes:

Attribute Name

Description

name

The event name to fire this trigger.

source

The PL/SQL <package name>.<function name> where the


executable code resides.

The location of the trigger indicate at what point the trigger fires:
Place a beforeReport trigger anywhere in your data template before the
<dataStructure> section. A beforeRepot trigger fires before the dataQuery is
executed.
Place an afterReport trigger after the <dataStructure> section. An afterReport trigger
fires after you exit and after XML output has been generated.

Oracle XML Publisher - by Dinesh Kumar S

61

Data Structure Attributes:

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.

Below are some group hierarchies,


1) Break Groups
2) Group Filters
3) Summary Column

Oracle XML Publisher - by Dinesh Kumar S

62

Data Template Group Hierarchies

Creating Break Groups:


o Use a break group to produce subtotals or add placeholder columns.
o A break group suppresses duplicate values in sequential records.
o You should set an Order By clause in the SQL query to suppress duplicate values.

Oracle XML Publisher - by Dinesh Kumar S

63

Applying Group Filters:


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.

Oracle XML Publisher - by Dinesh Kumar S

64

Creating Summary Column:


o A summary column performs a computation on another column's data.
o Using the function attribute of the <element> tag, you can create the following
summaries:
Sum
Average
Count
minimum and maximum.

Oracle XML Publisher - by Dinesh Kumar S

65

Exercise

Build XML Report with Source as Data Template.

Oracle XML Publisher - by Dinesh Kumar S

66

Steps to build XML Report using Data Template

Create Data Template

Register Data Template

Create Concurrent Program

Submit the Program

Create RTF Template

Register the Template

Oracle XML Publisher - by Dinesh Kumar S

67

Create Data Template

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
Oracle XML Publisher - by Dinesh Kumar S

68

Register Data Template

Navigation: XML Publisher Administrator -> Data Definitions -> Create Data Definition

Enter the data definition Details and click on Apply.


Note down the Code. The code should be used as the short name of the concurrent
program.

Oracle XML Publisher - by Dinesh Kumar S

69

Associating Data Template with Data Definition.

Click o Add File


previous step.

utto to upload Data Te plate file that as eated in

Oracle XML Publisher - by Dinesh Kumar S

70

Data Template is associated with Data Definition


Oracle XML Publisher - by Dinesh Kumar S

71

Create Concurrent Program

Define a Concurrent Program to generate the Data XML output.


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: We do not need to create a concurrent executable as we use


a seeded executable XDODTEXE

Oracle XML Publisher - by Dinesh Kumar S

72

Note**
1. Output format should be XML
2. Short Name in the concurrent program and Code in the data definition
should be same.
Oracle XML Publisher - by Dinesh Kumar S

73

Concurrent Program Parameters:


Note**
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.

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
template,
we
have
to define
74
Oracle
Publisher
- by
Dinesh
Kumar Sparameter in the concurrent program.

Associate the Concurrent Program to a Request group.

Oracle XML Publisher - by Dinesh Kumar S

75

Submit the Program


4

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.

Oracle XML Publisher - by Dinesh Kumar S

76

Oracle XML Publisher - by Dinesh Kumar S

77

Create RTF Template

Define the RTF Template using the Generated Data XML.


First Load XML Data generated by Concurrent Program

Using the Table Wizard as below to create the 'Table Report Format' with the
columns of demo_products.

Save this file with .RTF extension.


Oracle XML Publisher - by Dinesh Kumar S

78

Register the Template

Registering the Template with BI Publisher


Navigation: XML Publisher Administrator -> Templates -> Create Template

Oracle XML Publisher - by Dinesh Kumar S

79

Few tips for best practices:


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:
Use a WHERE clause instead of a group filter to exclude records.
Perform calculations directly in your query rather than in the template.

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.

Oracle XML Publisher - by Dinesh Kumar S

80

Designing Template Layout


-

Creating Placeholders
Defining Groups
Defining Headers & Footers
Inserting Images

Oracle XML Publisher - by Dinesh Kumar S

81

Creating Placeholders
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.
There are two ways to insert placeholders in your document:
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.

Oracle XML Publisher - by Dinesh Kumar S

82

Basic RTF Method:


Enter the placeholder syntax in your document where you want the XML data value to
appear.
Syntax: <?XML element tag name?>

Oracle XML Publisher - by Dinesh Kumar S

83

Form Field Method:


Use Microsoft Word's Text Form Field Options window to insert the placeholder tags:

Oracle XML Publisher - by Dinesh Kumar S

84

Double-click the form field area to invoke the Text Form Field Options dialog box.

Select the Add Help Text button.

Oracle XML Publisher - by Dinesh Kumar S

85

Select OK to apply.

Oracle XML Publisher - by Dinesh Kumar S

86

he figure below shows the Supplier field from the template with the added form field
markup.

Lets try with an example!

Oracle XML Publisher - by Dinesh Kumar S

87

Build Template using Form Field Method

Oracle XML Publisher - by Dinesh Kumar S

88

Report Name: Payable Invoice Register Report

Following is the XML file that will be used as input to the Payables Invoice Register report
template:

Oracle XML Publisher - by Dinesh Kumar S

89

The Placeholder Entry is the XML element tag name entered in the Form Field Help
Text field

Template Field Name

Default Text Entry


(Form Field Method)

Placeholder Entry (XML Tag Name)

Invoice Num

1234566

<?INVOICE_NUM?>

Invoice Date

1-Jan-2004

<?INVOICE_DATE?>

GL Date

1-Jan-2004

<?GL_DATE?>

Curr

USD

<?INVOICE_CURRENCY_CODE?>

Entered Amt

1000.00

<?ENT_AMT?>

Accounted Amt

1000.00

<?ACCTD_AMT?>

(Total of Entered Amt column) 1000.00

<?ENT_SUM_VENDOR?>

(Total of Accounted Amt


column)

<?ACCTD_SUM_VENDOR?>

1000.00

Oracle XML Publisher - by Dinesh Kumar S

90

After Completing the template looks as below,

Oracle XML Publisher - by Dinesh Kumar S

91

Defining Groups
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.

Oracle XML Publisher - by Dinesh Kumar S

92

To designate a group of repeating fields, insert the grouping tags around the elements to
repeat.
Syntax:
<?for-each:XML group element tag name?>

<?end for-each?>

Now Lets use the same XML data to create the report.

Oracle XML Publisher - by Dinesh Kumar S

93

Report Name: Payable Invoice Register Report

Following is the XML file that will be used as input to the Payables Invoice Register report
template:

Oracle XML Publisher - by Dinesh Kumar S

94

Basic RTF Method:

No lets t y to eate g oups usi g Form Field Method


Oracle XML Publisher - by Dinesh Kumar S

95

Form Field Method:

Oracle XML Publisher - by Dinesh Kumar S

96

Oracle XML Publisher - by Dinesh Kumar S

97

Defining Headers & Footers


BI Publisher supports the use of the native RTF header and footer feature.
Two types Headers & Footers can be inserted,

1. Default word processing application's header and footer insertion tools

2. Using start:body and end body tags

Lets try by inserting using method 2.

Oracle XML Publisher - by Dinesh Kumar S

98

Oracle XML Publisher - by Dinesh Kumar S

99

Inserting Images
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.
2. URL Reference: In Microsoft Word's Format Picture dialog box select
the Web tab. Enter the following syntax in the Alternative text region to reference
the image URL.

url:{'http://image location'}

Oracle XML Publisher - by Dinesh Kumar S

100

Template Features

Oracle XML Publisher - by Dinesh Kumar S

101

Page Breaks
To create a page break after the occurrence of a specific element use the "split-bypage-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:?>

Oracle XML Publisher - by Dinesh Kumar S

102

<?split-by-page-break:?>

Oracle XML Publisher - by Dinesh Kumar S

103

Initial Page number


Some reports require that the initial page number be set at a specified number.
For example, monthly reports may be required to continue numbering from
month to month.
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'?>

Oracle XML Publisher - by Dinesh Kumar S

104

Last Page Only Content


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:

Oracle XML Publisher - by Dinesh Kumar S

105

Summary Information to be
printed at last page of the report.

Oracle XML Publisher - by Dinesh Kumar S

106

The report should show each VENDOR and their INVOICE data with a SUMMARY section that
appears only on the last page, placed at the bottom of the page.

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:

Oracle XML Publisher - by Dinesh Kumar S

107

Conditional Formatting

Oracle XML Publisher - by Dinesh Kumar S

108

Conditional formatting occurs when a formatting element appears only when a


certain condition is met.
BI Publisher supports the usage of
"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.

Oracle XML Publisher - by Dinesh Kumar S

109

IF Statements
Use an if statement to define a simple condition; for example, if a data field is a
specific value.
Syntax:

<?if: condition ?>


<?end if?>

Oracle XML Publisher - by Dinesh Kumar S

110

For example, to set up the Payables Invoice Register to display invoices only when the
Supplier name is "Company A .

Oracle XML Publisher - by Dinesh Kumar S

111

If-then-Else Statements
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:
<? xdofx: if element_condition then result1 else result2 end if ?>
For example, the following statement tests the AMOUNT element value.
If Amount > 1000 then
"Higher";
Else if < 1000 then
"Lower";
Else
"E ual ;
End if;

Oracle XML Publisher - by Dinesh Kumar S

112

Choose Statements
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.
Use the following syntax for these elements:

<? choose: ?>


<? when: expression ?>
<? otherwise?>
For example a choose expression in which the display of a row of data depends on the
value of the fields EXEMPT_FLAG and POSTED_FLAG.
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.

Oracle XML Publisher - by Dinesh Kumar S

113

Oracle XML Publisher - by Dinesh Kumar S

114

Default Text Entry in Example Form Field Help Text Entry in Form Field
<Grp:VAT
<?for-each:G_VAT?>
starts the G_VAT group
<Choose
<?choose:?>
opens the choose statement
<When EXEMPT_FLAG='^'
<?when: EXEMPT_FLAG='^'?>
tests the EXEMPT_FLAG element, if true, use the first table
shown
End When>
<?end when?>
ends the EXEMPT_FLAG test
<Whe POTED_FLAG= *
<? he :POTED_FLAG= * ?>
tests the POSTED_FLAG element, if true, use the table
following
End When>
<?end when?>
ends the POSTED_FLAG test
Otherwise
<?otherwise:?>
If none of above are true then use the following table
End Otherwise>
End Choose>

End Vat>

<?end otherwise?>
ends the otherwise statement
<?end choose?>
ends the choose statement
<?end for-each?>
ends the G_VAT group
Oracle XML Publisher - by Dinesh Kumar S

115

Cell highlighting

Oracle XML Publisher - by Dinesh Kumar S

116

Condition to be used to high light the Cell.

Report Template:

Oracle XML Publisher - by Dinesh Kumar S

117

Default Text Entry Form Field Entry


FE:Account
<?for-each:account?>

Description
Opens the for each-loop for the element
account.
The placeholder for the number element
from the XML file.

1-232-4444

<?number?>

CH1

<?if:debit>1000?><xsl:attribute
xdofo:ctx="block" name="backgroundcolor">red</xsl:attribute><?end if?>

This field holds the code to highlight the


cell red if the debit amount is greater than
1000.

100.00

<?debit?>

The placeholder for the debit element.


IMPORTANT: The <?debit?> element must
reside in its own field.

CH2

<?if:credit>1000?><xsl:attribute
xdofo:ctx="block" name="backgroundcolor">red</xsl:attribute><?end if?>

This field holds the code to highlight the


cell red if the credit amount is greater
than 1000.

100.00

<?credit?>

The placeholder for the credit element.

EFE

<?end for-each?>

Closes the for-each loop.

Oracle XML Publisher - by Dinesh Kumar S

118

Report Output:

Oracle XML Publisher - by Dinesh Kumar S

119

Page Level Calculations

Oracle XML Publisher - by Dinesh Kumar S

120

Display Page Total


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.

Steps to Include Page total:


1. Define a variable to hold the value.
2. Associate it with the element from the XML file that is to be totaled for the page.
3. Define total fields (additional functions on the data in those fields are also allowed).

Syntax:

<?add-page-total:TotalFieldName;'element'?>
TotalFieldName
element

is the name you assign to your total (to reference later)


the XML element field to be totaled.

Oracle XML Publisher - by Dinesh Kumar S

121

To display the total field, enter the following syntax:

<?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.

Oracle XML Publisher - by Dinesh Kumar S

122

Template Layout

Default Text Entry Form Field Help Text Entry


FE
<?for-each:transaction?>

Description
This field defines the opening "for-each" loop for the transaction
group.

100.00

<?debit?><?add-page-total:dt;'debit'?>

This field is the placeholder for the debit 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 debit element is dt.

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:

Oracle XML Publisher - by Dinesh Kumar S

124

Data Handling

Oracle XML Publisher - by Dinesh Kumar S

125

Sorting
You can sort a group by any element within the group.
Syntax:

<?sort:element name; order; data-type?>


element name
order
data-type

Name of the element you want the group sorted by


'ascending' or 'des e di g O de
Is the element data type. Valid values are: 'text' and 'number'.

For Example;
Sorting a Group:
<?for-each:G_VENDOR_NAME?> <?sort:VENDOR_NAME?>
Sorting Multiple Fields:
<?sort:VENDOR_NAME?> <?sort:INVOICE_NUM;'ascending';'number'?>

Oracle XML Publisher - by Dinesh Kumar S

126

XML Bursting

Oracle XML Publisher - by Dinesh Kumar S

127

About Bursting
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.
Example implementations include:

Invoice generation and delivery based on customer-specific layouts and delivery


preference
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

Oracle XML Publisher - by Dinesh Kumar S

128

Bursting Mechanism:
Oracle Bursting Mechanism enables us to deliver a single XML Publisher report/letter
to multiple destinations simultaneously.
One can create a single report/letter , then send it in any format (e.g., PDF or HTML) to
multiple destinations(email ids).
There are two kind of bursting mechanism available within BI publisher
1. Control File Base:- Integrated with EBS.
2. Delivery SQL based:o Part of Enterprise release.
o All delivery, template, output format, locale and other details define through
delivery SQL Query.
o Enterprise Edition assume that this information is stored in data base. The
process create the XML file out if this query and the delivery xml file works as
control file.

Oracle XML Publisher - by Dinesh Kumar S

129

XML Bursting Logical Model

Oracle XML Publisher - by Dinesh Kumar S

130

Steps to Implement Bursting in XML Publisher Reports.

Create Data Template

Create a Bursting File

Attach the bursting file to Data Definition

Setup Temporary directory location

Run the Concurrent Program

Execute Bursting Program

Oracle XML Publisher - by Dinesh Kumar S

131

Create Data Template

Step 1.1) Creating a data template

Oracle XML Publisher - by Dinesh Kumar S

132

Step 1.2) Creating a Concurrent program

Oracle XML Publisher - by Dinesh Kumar S

133

Step 1.3) Register the Data Definition

Oracle XML Publisher - by Dinesh Kumar S

134

Step 1.4) Attach the concurrent program to the request group and execute the program to
generate the XML output.

Oracle XML Publisher - by Dinesh Kumar S

135

Step 1.5) Create the layout template

Oracle XML Publisher - by Dinesh Kumar S

136

Step 1.6) Attach the XML as Preview Data.


Attach the XML generated from the program output to the Preview Data section of the data
definition

Oracle XML Publisher - by Dinesh Kumar S

137

Step 1.7) Register the Template with Data Definition.

Check Preview to see if the template matches with the XML.

Oracle XML Publisher - by Dinesh Kumar S

138

Step 1.8) Execute the report to view the data.

Oracle XML Publisher - by Dinesh Kumar S

139

Create a Bursting File

Sample File Used:

Oracle XML Publisher - by Dinesh Kumar S

140

Explanation of Bursting file

XML tag

Explanation

xapi:request select=

This tag in the control file indicates from which tag/node in


the concurrent program output XML should separated for
bursting

xapi:delivery

This node contains all email related attributes

xapi:email

This tag contains the email attributes like,

server or the email server IP or name

port or the email server port


from or the email address from which the server should send the email
reply-to or the email address to which the replies should be sent
Oracle XML Publisher - by Dinesh Kumar S

141

xapi:message

This tag contains the attributes about the email like,

To or the email address where the email should be sent


Subject or the email subject
attachment , i.e. if the email should contain an attachment
content-type or type of email
The mail body will be enclosed within the tags

Oracle XML Publisher - by Dinesh Kumar S

142

xapi:document This node contains the attachment document and XML template
related tags and attributesThe attributes in this tag are related to the email attachment
Key or unique identifier of each attachment
Output or attachment file name
Output-type or attachment file type

Oracle XML Publisher - by Dinesh Kumar S

143

xapi:template This node contains the template information like,


Type or the file type of the template
Location or the directory of the template file along with the file name

Oracle XML Publisher - by Dinesh Kumar S

144

The following attributes should contain the same values for bursting to function
properly,

1.
2.
3.

Id attribute in xapi:email tag


Id attribute in xapi:message tag
Delivery attribute in xapi:document tag

If the 3 values do not match then delivery will not take place as expected.

Oracle XML Publisher - by Dinesh Kumar S

145

Attach the bursting file to Data Definition

Navigation: XML Publisher Administrator Data Definitions

Upload the bursting file in Bursting Control File


section

Oracle XML Publisher - by Dinesh Kumar S

146

Setup Temporary directory location

A temporary directory has to be provided for XML Publisher engine to use for bursting.
Navigation: XML Publisher Administrator Administration Tab

In Unix, /tmp directory has


write permissions for all
users.

Enter /tmp directory as the


temporary directory.
This directory can be any
directory on which Oracle
apps has write permissions.

Oracle XML Publisher - by Dinesh Kumar S

147

FTP the template.


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,
<xapi:template type=rtf location=/usr/tmp/XXEMPDET.rtf />

Oracle XML Publisher - by Dinesh Kumar S

148

Run the Concurrent Program

Oracle XML Publisher - by Dinesh Kumar S

149

Execute Bursting Program

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.

Oracle XML Publisher - by Dinesh Kumar S

150

Now check the output of the bursting program.

The bursting program output shows that 4 emails were delivered. Lets check
the mail box.

Oracle XML Publisher - by Dinesh Kumar S

151

Oracle XML Publisher - by Dinesh Kumar S

152

Thank You
(Please rate my article in www.planet-source-code.com)

Oracle XML Publisher - by Dinesh Kumar S

153

Você também pode gostar