Top Banner
1 Oracle XML Publisher - by Dinesh Kumar S
153

Oracle XML Publisher - by Dinesh Kumar S

Sep 08, 2015

Download

Documents

Oracle XML Publisher - by Dinesh Kumar S

In this guide i have explained the basics concepts of XML Publisher. I have covered important concepts that are in real time use in Developments from basics to advance.
Welcome message from author
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
  • 1 Oracle XML Publisher - by Dinesh Kumar S

  • Contents

    2 2 Oracle XML Publisher - by Dinesh Kumar S

    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

  • 3 Oracle XML Publisher - by Dinesh Kumar S

    Introduction to XML Publisher

  • 4

    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

  • 5

    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

  • 6

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

    Oracle XML Publisher - by Dinesh Kumar S

    About Classic Reporting Tool

  • 7

    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

    Translation Oracle XML Publisher - by Dinesh Kumar S

  • 8

    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 /reports/ 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

  • 9

    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 in-

    house 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

  • 10 Oracle XML Publisher - by Dinesh Kumar S

    Key features of XML Publisher

  • 11

    Report Output

    Data Logic

    Layout

    Translation

    Oracle BI Publisher Paradigm

    Oracle XML Publisher - by Dinesh Kumar S

  • 12

    1. Flexible Deployment Options

    Oracle XML Publisher - by Dinesh Kumar S

  • 13

    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

  • 14

    3. Extract Once Publish Many times

    Oracle XML Publisher - by Dinesh Kumar S

  • 15

    4. Report Bursting

    Oracle XML Publisher - by Dinesh Kumar S

  • 16

    5. Distributed Delivery

    Oracle XML Publisher - by Dinesh Kumar S

  • 17

    6. Multiple Language Support

    Oracle XML Publisher - by Dinesh Kumar S

  • 18

    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

  • 19 Oracle XML Publisher - by Dinesh Kumar S

    BI Publisher Architecture

  • 20

    BI Publisher Architecture

    Oracle XML Publisher - by Dinesh Kumar S

  • 21

    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

  • 22 Oracle XML Publisher - by Dinesh Kumar S

    Steps to Create XML Publisher Reports

  • 23

    Steps for Generating XML Publisher Reports

    Generate XML

    Create RTF Template

    Create Data Definition

    Upload Template

    Run the Report

    1

    2

    3

    4

    5

    Oracle XML Publisher - by Dinesh Kumar S

  • 24

    Step 1: Generate XML

    Oracle XML Publisher - by Dinesh Kumar S

  • 25

    Generate XML

    Create RTF Template

    Create Data Definition

    Upload Template

    Run the Report

    We can generate XML from multiple sources as below,

    External Sources

    (DWH, MDX Query, Web Services,

    LDAP, Oracle Discoverer)

    Internal Sources

    (Oracle Apps)

    Conc. Pg PL/SQL Reports

    Conc. Pg RDF Reports

    Data Template etc..

    Oracle XML Publisher - by Dinesh Kumar S

  • 26

    Internal Sources

    Conc. Pg PL/SQL Reports

    Conc. Pg RDF Reports

    Data Template

    Lets generate XML using RDF Report Output.

    1.1) Choose a Co u e t p og a & 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

  • 27

    Lets Choose the below report, Application Receivables

    Report Name Customer Open Balance Letter

    Step 1.1

    Oracle XML Publisher - by Dinesh Kumar S

  • 28

    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

  • 29

    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

  • 30

    Generate XML

    Create RTF Template

    Create Data Definition

    Upload Template

    Run the Report

    BI Publisher supports several types of templates.

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

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

    Oracle XML Publisher - by Dinesh Kumar S

  • 31

    Step 2.1: Create RTF Template

    Oracle XML Publisher - by Dinesh Kumar S

  • 32

    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

  • 33

    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

  • 34

    Step 3: Create Data Definitions

    Oracle XML Publisher - by Dinesh Kumar S

  • 35

    Generate XML

    Create RTF Template

    Create Data Definition

    Upload Template

    Run the Report

    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.

    Oracle XML Publisher - by Dinesh Kumar S

  • 36

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

    Oracle XML Publisher - by Dinesh Kumar S

  • 37

    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

  • 38

    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

  • 39

    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

  • 40

    Step 4: Upload Template

    Oracle XML Publisher - by Dinesh Kumar S

  • 41

    Generate XML

    Create RTF Template

    Create Data Definition

    Upload Template

    Run the Report

    Use the Template Manager to Upload the Template.

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

    click Create Template.

    Oracle XML Publisher - by Dinesh Kumar S

  • 42

    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

  • 43

    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

  • 44

    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

  • 45

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

    successfully.

    Oracle XML Publisher - by Dinesh Kumar S

  • 46

    Step 5: Run the Report

    Oracle XML Publisher - by Dinesh Kumar S

  • 47

    Generate XML

    Create RTF Template

    Create Data Definition

    Upload Template

    Run the Report

    Submit the Report.

    Choose the Report Name

    Oracle XML Publisher - by Dinesh Kumar S

  • 48

    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

  • 49

    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

  • 50

    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

  • 51 Oracle XML Publisher - by Dinesh Kumar S

    Building a Data Template

  • 52

    About Data Template

    XML Publisher reports contain 2 main components.

    Data Definition Template

    Data Definition Generates the XML for XML Publisher Engine. Template 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

  • 53

    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

  • 54

    Data Template Definition

    The data template consists of 4 basic section,

    Data Template

    Data Query

    Triggers

    Data Structures

    Parameter 1

    2

    3

    4

    Oracle XML Publisher - by Dinesh Kumar S

  • 55

    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

  • 56

    Data Template Structure

    Oracle XML Publisher - by Dinesh Kumar S

  • 57

    Element Description Required?

    Data Template This is the root element. Yes

    Property

    Section

    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.

    Optional

    Data Query

    Section

    This section holds the SQL Query for which XML to be generated.

    Yes

    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

    Data Structure 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

    Optional Single Query

    Oracle XML Publisher - by Dinesh Kumar S

  • 58

    Data Template Section Attributes

    Data Template Attributes:

    Attribute Name Description Required?

    name Template name (User defined). Yes

    description Description of data template (User defined). Optional

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

    defaultPackage if data template contains lexical references or any other calls

    to PL/SQL.

    Yes if lexical is

    used

    dataSourceRef The default data source reference for the entire data

    template.

    Yes

    Oracle XML Publisher - by Dinesh Kumar S

  • 59

    Property Section Attributes:

    Attribute Name Description Required?

    name A keyword, unique within a given Data Template, that identifies the

    parameter.

    Yes

    dataType Specify the parameter data type as "character", "date", or "number".

    Default value is "character".

    Optional

    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

    Oracle XML Publisher - by Dinesh Kumar S

  • 60

    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

  • 61

    Data Trigger Attributes:

    Attribute Name Description

    name The event name to fire this trigger.

    source The PL/SQL . 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 section. A beforeRepot trigger fires before the dataQuery is

    executed.

    Place an afterReport trigger after the section. An afterReport trigger fires after you exit and after XML output has been generated.

    Oracle XML Publisher - by Dinesh Kumar S

  • 62

    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

  • 63

    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.

    Data Template Group Hierarchies

    Oracle XML Publisher - by Dinesh Kumar S

  • 64

    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

  • 65

    Creating Summary Column:

    o A summary column performs a computation on another column's data.

    o Using the function attribute of the tag, you can create the following

    summaries:

    Sum Average Count minimum and maximum.

    Oracle XML Publisher - by Dinesh Kumar S

  • 66

    Exercise

    - Build XML Report with Source as Data Template.

    Oracle XML Publisher - by Dinesh Kumar S

  • 67

    Steps to build XML Report using Data Template

    1 Create Data Template

    2 Register Data Template

    3 Create Concurrent Program

    4 Submit the Program

    5 Create RTF Template

    6 Register the Template

    Oracle XML Publisher - by Dinesh Kumar S

  • 68

    1 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

  • 69

    2 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

  • 70

    Associating Data Template with Data Definition.

    Click o Add File utto to upload Data Te plate file that as eated in previous step.

    Oracle XML Publisher - by Dinesh Kumar S

  • 71

    Data Template is associated with Data Definition

    Oracle XML Publisher - by Dinesh Kumar S

  • 72

    3 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

  • 73

    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

  • 74

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

  • 75

    Associate the Concurrent Program to a Request group.

    Oracle XML Publisher - by Dinesh Kumar S

  • 76

    4 Submit the Program

    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

  • 77 Oracle XML Publisher - by Dinesh Kumar S

  • 78

    5 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

  • 79

    6 Register the Template

    Registering the Template with BI Publisher

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

    Oracle XML Publisher - by Dinesh Kumar S

  • 80

    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

  • 81

    - Creating Placeholders

    - Defining Groups

    - Defining Headers & Footers

    - Inserting Images

    Oracle XML Publisher - by Dinesh Kumar S

    Designing Template Layout

  • 82

    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

  • 83

    Basic RTF Method:

    Enter the placeholder syntax in your document where you want the XML data value to

    appear.

    Syntax:

    Oracle XML Publisher - by Dinesh Kumar S

  • 84

    Form Field Method:

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

    Oracle XML Publisher - by Dinesh Kumar S

  • 85

    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

  • 86

    Select OK to apply.

    Oracle XML Publisher - by Dinesh Kumar S

  • 87

    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

  • 88

    Build Template using Form Field Method

    Oracle XML Publisher - by Dinesh Kumar S

  • 89

    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

  • 90

    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 Date 1-Jan-2004

    GL Date 1-Jan-2004

    Curr USD

    Entered Amt 1000.00

    Accounted Amt 1000.00

    (Total of Entered Amt column) 1000.00

    (Total of Accounted Amt

    column)

    1000.00

    Oracle XML Publisher - by Dinesh Kumar S

  • 91

    After Completing the template looks as below,

    Oracle XML Publisher - by Dinesh Kumar S

  • 92

    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

  • 93

    To designate a group of repeating fields, insert the grouping tags around the elements to

    repeat.

    Syntax:

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

    Oracle XML Publisher - by Dinesh Kumar S

  • 94

    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

  • 95

    Basic RTF Method:

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

    Oracle XML Publisher - by Dinesh Kumar S

  • 96

    Form Field Method:

    Oracle XML Publisher - by Dinesh Kumar S

  • 97 Oracle XML Publisher - by Dinesh Kumar S

  • 98

    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

  • 99 Oracle XML Publisher - by Dinesh Kumar S

  • 100

    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

  • 101 Oracle XML Publisher - by Dinesh Kumar S

    Template Features

  • 102

    Page Breaks

    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:

    Oracle XML Publisher - by Dinesh Kumar S

  • 103

    Oracle XML Publisher - by Dinesh Kumar S

  • 104

    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:

    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:

    Oracle XML Publisher - by Dinesh Kumar S

  • 105

    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

  • 106

    Summary Information to be

    printed at last page of the report.

    Oracle XML Publisher - by Dinesh Kumar S

  • 107

    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

  • 108

    Conditional Formatting

    Oracle XML Publisher - by Dinesh Kumar S

  • 109

    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

  • 110

    IF Statements

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

    Syntax:

    Oracle XML Publisher - by Dinesh Kumar S

  • 111

    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

  • 112

    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:

    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

  • 113

    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:

    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

  • 114 Oracle XML Publisher - by Dinesh Kumar S

  • 115

    Default Text Entry in Example Form Field Help Text Entry in Form Field

    opens the choose statement

    ends the EXEMPT_FLAG test

    ends the POSTED_FLAG test

    Otherwise

    If none of above are true then use the following table

    End Otherwise>

    ends the otherwise statement

    End Choose>

    ends the choose statement

    End Vat>

    ends the G_VAT group

    Oracle XML Publisher - by Dinesh Kumar S

  • 116

    Cell highlighting

    Oracle XML Publisher - by Dinesh Kumar S

  • 117

    Condition to be used to high light the Cell.

    Report Template:

    Oracle XML Publisher - by Dinesh Kumar S

  • 118

    Default Text Entry Form Field Entry Description

    FE:Account Opens the for each-loop for the element

    account.

    1-232-4444 The placeholder for the number element

    from the XML file.

    CH1 red

    This field holds the code to highlight the

    cell red if the debit amount is greater than

    1000.

    100.00 The placeholder for the debit element.

    IMPORTANT: The element must

    reside in its own field.

    CH2 red

    This field holds the code to highlight the

    cell red if the credit amount is greater

    than 1000.

    100.00 The placeholder for the credit element.

    EFE Closes the for-each loop.

    Oracle XML Publisher - by Dinesh Kumar S

  • 119

    Report Output:

    Oracle XML Publisher - by Dinesh Kumar S

  • 120

    Page Level Calculations

    Oracle XML Publisher - by Dinesh Kumar S

  • 121

    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:

    TotalFieldName is the name you assign to your total (to reference later) element the XML element field to be totaled.

    Oracle XML Publisher - by Dinesh Kumar S

  • 122

    To display the total field, enter the following syntax:

    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

  • 123

    Default Text Entry Form Field Help Text Entry Description

    FE This field defines the opening "for-each" loop for the transaction

    group.

    100.00 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 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 Creates a net page total by subtracting the credit values from the

    debit values.

    EFE Closes the for-each loop.

    Template Layout

    Oracle XML Publisher - by Dinesh Kumar S

  • 124

    Report Output:

    Oracle XML Publisher - by Dinesh Kumar S

  • 125

    Data Handling

    Oracle XML Publisher - by Dinesh Kumar S

  • 126

    Sorting

    You can sort a group by any element within the group.

    Syntax:

    element name Name of the element you want the group sorted by order 'ascending' or 'des e di g O de data-type Is the element data type. Valid values are: 'text' and 'number'.

    For Example;

    Sorting a Group:

    Sorting Multiple Fields:

    Oracle XML Publisher - by Dinesh Kumar S

  • 127 Oracle XML Publisher - by Dinesh Kumar S

    XML Bursting

  • 128

    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

  • 129

    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

  • 130

    XML Bursting Logical Model

    Oracle XML Publisher - by Dinesh Kumar S

  • 131

    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

    1

    2

    3

    4

    5

    6

    Oracle XML Publisher - by Dinesh Kumar S

  • 132

    Create Data Template 1

    Step 1.1) Creating a data template

    Oracle XML Publisher - by Dinesh Kumar S

  • 133

    Step 1.2) Creating a Concurrent program

    Oracle XML Publisher - by Dinesh Kumar S

  • 134

    Step 1.3) Register the Data Definition

    Oracle XML Publisher - by Dinesh Kumar S

  • 135

    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

  • 136

    Step 1.5) Create the layout template

    Oracle XML Publisher - by Dinesh Kumar S

  • 137

    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

  • 138

    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

  • 139

    Step 1.8) Execute the report to view the data.

    Oracle XML Publisher - by Dinesh Kumar S

  • 140

    Create a Bursting File 2

    Sample File Used:

    Oracle XML Publisher - by Dinesh Kumar S

  • 141

    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

  • 142

    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

  • 143

    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

  • 144

    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

  • 145

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

    properly,

    1. Id attribute in xapi:email tag

    2. Id attribute in xapi:message tag

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

  • 146

    Attach the bursting file to Data Definition 3

    Navigation: XML Publisher Administrator Data Definitions

    Upload the bursting file in Bursting Control File

    section

    Oracle XML Publisher - by Dinesh Kumar S

  • 147

    Setup Temporary directory location 4

    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

  • 148

    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,

    Oracle XML Publisher - by Dinesh Kumar S

  • 149

    Run the Concurrent Program 5

    Oracle XML Publisher - by Dinesh Kumar S

  • 150

    Execute Bursting Program 6

    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

  • 151

    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

  • 152 Oracle XML Publisher - by Dinesh Kumar S

  • 153 Oracle XML Publisher - by Dinesh Kumar S

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