XMLPresentation.ppt

176
Presented by: Madhav Vinay Kumar Viswanath Vijayalaxmi Oracle XML/BI Publisher and Template Builder for Microsoft Word XML/BI Publisher

description

Fayaz

Transcript of XMLPresentation.ppt

Page 1: XMLPresentation.ppt

Presented by:Madhav

Vinay KumarViswanath

Vijayalaxmi

Oracle XML/BI Publisher and Template Builder for Microsoft Word

XML/BI Publisher

Page 2: XMLPresentation.ppt

Agenda

• Introduction• Basic need and benefits of XML• Flow • Template Builder – XMLP Directives• XML/BI Bursting in R12

XML/BI Publisher

Page 3: XMLPresentation.ppt

History• Oracle XML Publisher is Oracle Corporation’s latest reporting technology. It was

originally developed to solve the reporting problems faced by Oracle Applications. • Osama Elkady from the Applications Technology Group and Tim Dexter from the

Financials Group were the main drivers for the product.• It was first released with Oracle E-Business suite 11.5.10 in 2003. Since then it has

been integrated into most of Oracle Products including JD Edwards Enterprise One application and PeopleSoft Enterprise, and as a standalone version, XML Publisher Enterprise with no dependency on Oracle Applications. When XML Publisher became part of the Oracle BI Enterprise Edition Suite it was re-branded as Oracle BI Publisher.

• BI Publisher separates the creation of data from the process of formatting it for different uses. The engine can format any well-formed XML data, allowing integration with any system that can generate XML, including Web Services or any data source available through JDBC. BI Publisher can merge multiple data sources into a single output document.

XML/BI Publisher

Page 4: XMLPresentation.ppt

• Oracle XML Publisher offers you the most efficient, scalable reporting solution available for complex, distributed environments.

• It provides a central architecture for generating and delivering information.• It reduces a company's dependency on third party software systems that are

required to format business documentsTemplate Builder • Is an extension to Microsoft Word• Allows development of RTF templates

Template Viewer • Provides report preview capability

Introduction

XML/BI Publisher

Page 5: XMLPresentation.ppt

• XML Publisher provides an opportunity for rapid publishing, development and maintenance.

• It is also possible to have multiple layouts in different languages for the same data structure. Report output can be generated as Excel,HTML,PDF and word at runtime.

• The report layout can be developed in RTF(Rich Text Format),PDF(Portable Definition Format) or eText Format.

• The Development of the report can be separated between the structure of the and the presentation of the layout.

• Basically which is used to reduce the cost, increase the flexibility associated with the development.

Xml publisher mainly Suitable for the following report outputs:• Financial and Business reports• Invoices,purchase orders,receipts,Sales orders and statements• Legal Documents-Tax forms,Payslips,Cheques• Marketing Documents

Basic need of XML/BI: XML/BI Publisher

Page 6: XMLPresentation.ppt

• Multiple document output formats• Report layouts developed and maintained using familiar desktop

applications• Oracle XML Publisher reduces the cost associated with the development,

customization and maintenance of business documents while increasing the efficiency of reports management.

• Reduce the cost and complexity by eliminating third party Software• Developed completely on open standards• Large number of supported document delivery channels and protocols• Enables end users to format batch application output using Oracle XML• BI Publisher supports the Oracle technology stack• It provides a reporting solution migration path for Oracle Fusion• Faster report creation• Layout level Formatting

Benefits of XML/BI:

XML/BI Publisher

Page 7: XMLPresentation.ppt

Version of XML

XML/BI Publisher

Page 8: XMLPresentation.ppt

XML/BI Publisher

Page 9: XMLPresentation.ppt

• Another way to find the Version• PDF Output : open the file in Adobe Acrobat• Navigation file --> Properties --> PDF Producer

XML/BI Publisher

Page 10: XMLPresentation.ppt

XML/BI Publisher

Page 11: XMLPresentation.ppt

XML/BI Publisher Paradigm

Separates data/layout/output format

Layout

TranslationXML Publisher

Report Output

XML

XSL

Data Logic

XML/BI Publisher

Page 12: XMLPresentation.ppt

• Data Logic:

Data extracted from database and converted into an XML string.

• Data Sources to generate XML reports in following ways: 1) Through RDF data model

2) Through Stored Procedure 3) Through XML Tags• Layout: The layout templates to be used for the final output are

stored and managed in the Template Manager.• Translation: The translation handler will manage the translation that

is required at runtime.

XML/BI Publisher

Page 13: XMLPresentation.ppt

Introduction of RTF Template

• Rich Text Format (RTF) is a specification used by common word processing applications, such as Microsoft Word. When you save a document, RTF is a

file type option that you select. The RTF layout can be designed using the Standard features in Word.

Select the size, font, and alignment of text Insert bullets and numbering Draw borders around paragraphs Include a watermark Include images (jpg, gif,) Use table auto formatting features Insert a header and footer

Page 14: XMLPresentation.ppt

Tagging text as Placeholders

Use standard xml PI(processing instruction) syntax:

<? Place Holder ?>

Write placeholders in two ways In normal text In form field’s help text

XML/BI Publisher

Page 15: XMLPresentation.ppt

Normal Text Put XML Elements directly into RTF text

<employee id="1"> <name>Edward Jiang</name> <location>6OP</location> <office>E211</office> </employee>

XML/BI Publisher

Page 16: XMLPresentation.ppt

Form Field’s help text

Insert a form field, put in description, click “Add Help Text…”, and put text in the text area below…

<employee id="1"> <name>Edward Jiang</name> <location>6OP</location> <office>E211</office> </employee>

XML/BI Publisher

Page 17: XMLPresentation.ppt

Template Builder – XMLP Directives

XML/BI Publisher

Page 18: XMLPresentation.ppt

Template Builder – XMLP Directives• for-each loop• data fields• page header/footer• page numbering• sorting• page breaks• calculated fields• extended functions• conditional logic• images/logos• Rows per page• Last Page Only content• Re-grouping xml data• Cell highlighting• Page totals

XML/BI Publisher

Page 19: XMLPresentation.ppt

for-each loop:

• Define groups to notify XML Publisher to loop through repeating information

• Insert the following tag before the first element<?for-each:XML group element tag name?>

• Insert the following tag after the last element<?end for-each?>

• E.g. The XML group element tag name “G_INVOICE” for recurring invoice information<?for-each:G_INVOICE?>……invoice lines……<?end for-each?>

XML/BI Publisher

Page 20: XMLPresentation.ppt

Data fields:

• Placeholders map the template field to the XML data field

• Syntax - <?XML element tag name?>• Placeholder must match XML element tag name

exactly• Case sensitive• E.g. The placeholder <?TRX_NUMBER?> identifies

the Invoice Number

XML/BI Publisher

Page 21: XMLPresentation.ppt

Page Header/Footer:

• Enclose the body area of the report within the following tags<?start:body?><?end body?>

• Elements occurring before the <?start:body?> tag compose the header

• Elements occurring after the <?end body?> tag compose the footer

XML/BI Publisher

Page 22: XMLPresentation.ppt

Page Numbering:

• Use Microsoft Word page numbering Navigation is: From Insert menu, select Page Numbers

• Select the position, alignment and format as desired

XML/BI Publisher

Page 23: XMLPresentation.ppt

Sorting:

• Insert sort tag within the group• <?sort:element name?>, for example to sort by transaction

number– Enter the following after the <?for-each:G_INVOICE?>

<?sort:invoice_number?>

• No end tag• Sort on multiple elements possible, use multiple sort tags

– Example: <?sort:invoice_number?><?sort:hire_date?>

• Sort on calculated fields supported

XML/BI Publisher

Page 24: XMLPresentation.ppt

Example:

This have the output as

XML/BI Publisher

Page 25: XMLPresentation.ppt

You may require the output to be sorted in the Inventory Item ID in ascending order.For this we have to include a tag.

Open the group tag

XML/BI Publisher

Page 26: XMLPresentation.ppt

And the tag below the available tag and Press OK

Now we can see the sorted output

XML/BI Publisher

Page 27: XMLPresentation.ppt

Additional Sorting:

• Sort order descending• Data type sorting– Number– Date

• Separated by semi-colon (;)• <?sort:trx_number; data-type=‘number’;

order=‘descending’?>

XML/BI Publisher

Page 28: XMLPresentation.ppt

Page Breaks:

• Just before the <?end for-each?> tag either…– Insert a Microsoft Page Break• Insert->Break->Page Break-or-• <Ctrl> + <Enter>

– Use XML Publisher directive• <?split-by-page-break:?>• This avoids extra blank page at the end of report

XML/BI Publisher

Page 29: XMLPresentation.ppt

Calculated Fields:

• Use field names and operand(s)– + - Addition– - - Minus– * - Multiplication– / - Division

• Example <?field1 + field2?>• Not required to be in form field

XML/BI Publisher

Page 30: XMLPresentation.ppt

ADDITIONYou can perform mathematical operations in the tag itself. Let us create a new column toshow the addition of INVENTORY_ITEM_ID with 5.In the Template, Create one Column and write the tag in it.

XML/BI Publisher

Page 31: XMLPresentation.ppt

Output

XML/BI Publisher

Page 32: XMLPresentation.ppt

Row Striping

If you would like a striped effect on your rows this can be achieved in the template. We now use two almost identical data rows in the table. The native XSL position() function is used to assign each row a numeric value, an ‘if’ statement is then used to test the value, so at the beginning of each row we get an ifstatement:1st Row: if:position() mod 2=02nd Row: if:position() mod 2=1

The position() function will return a number for the row of data starting at ‘1’. The mod or modulus function will return a 0 or a 1 depending on the result e.g. 2 mod 2 returns 0 and 3 mod 2 returns a 1. So we shade each row as required and add the if statement and at runtime the rows will be alternately shaded, in this case blue and yellow.

XML/BI Publisher

Page 33: XMLPresentation.ppt

The output is

XML/BI Publisher

Page 34: XMLPresentation.ppt

If You use this for 3 lines, the coding will be

XML/BI Publisher

Page 35: XMLPresentation.ppt

Extended functions:

• Some SQL functions can be used in template RPAD, LPAD, REPLACE INSTR, SUBSTR, LENGTH DECODE SYSDATE TO_NUMBER, TO_CHAR UPPER, LOWER GREATEST, LEAST ROUND, CEIL, FLOOR

• Usage is <?xdofx:function_name(params)?>• It is NOT case sensitive• Not required to be in a form field

XML/BI Publisher

Page 36: XMLPresentation.ppt

Conditional logic:

• Support for IF and CASE statements• IF

– <?if:boolean_test?><?end if?>

– Example : to display only invoice lines with a line type of “LINE”– Enclose the invoice line output within the tags below

• <?if:LINE_TYPE='LINE' ?>• <?end if?>

CASE <?choose?>

<?when:boolean_test?><?end when?><?otherwise?><?end otherwise?>

<?end choose?>

XML/BI Publisher

Page 37: XMLPresentation.ppt

Conditional FormattingConditional formatting occurs when a formatting element appears only when a certain condition is met. XML Publisher supports the usage of simple "if" statements, as well as more complex"choose" expressions.· Insert the following syntax to designate the beginning of the conditional area.<?if:condition?>· Insert the following syntax at the end of the conditional area: <?end if?>.Let us create a new template for this purpose and Load the data into it.

Add the if statement into it

XML/BI Publisher

Page 38: XMLPresentation.ppt

The Output will be

XML/BI Publisher

Page 39: XMLPresentation.ppt

IF-THEN-ELSE

XML Publisher supports the common programming construct "if-then-else". This is extremely useful when you need to test a condition and conditionally show a result.Let us write a new Query for if-then-else in the old template itself.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?>

XML/BI Publisher

Page 40: XMLPresentation.ppt

Type the tag as a single line [Don’t use Enter Anywhere]The Result is as per our requirement

Choose StatementsUse the choose, when, and otherwise elements to express multiple conditional tests.This is a very powerful feature of the RTF template. In regular XSL programming, if acondition is met in the choose command then further XSL code is executed.

XML/BI Publisher

Page 41: XMLPresentation.ppt

Use the following syntax for these elements:<?choose:?><?when:expression?><?otherwise?>Let us create a new template for this purpose.

In the Template, write the Coding,

XML/BI Publisher

Page 42: XMLPresentation.ppt

What our requirement is, If the Inventory_item_id = 11816, then, the contents to be highlighted in Blue color. Output is

Let us proceed with another condition in it.If the Inventory_item_id = 12816, then the words are to be highlighted.

XML/BI Publisher

Page 43: XMLPresentation.ppt

The Output is

XML/BI Publisher

Page 44: XMLPresentation.ppt

Now, Use otherwise into it.All the Records to be Highlighted in red Color.

XML/BI Publisher

Page 45: XMLPresentation.ppt

The Output is

XML/BI Publisher

Page 46: XMLPresentation.ppt

Images/Logos…

Use a table for complete control of image behavior Static Images

Paste the image directly into layout template URL

Dummy image on template Specify URL in alternative text section

Double click on image, go to web tab, alternative text field url:{‘www.myspace.com/xml_example/myimage.gif’}

Server-side Images (in EBS) Dummy image on template Specify URL in alternative text section url:{‘${OA_MEDIA} /myimage.gif’}

Also supported URLs and Paths in XML elements or combination of elements BLOBS from database

XML/BI Publisher

Page 47: XMLPresentation.ppt

Rows per page:

Define row counter variable in a form field<?xdoxslt:set_variable($_XDOCTX, ’Counter’, 0)?>

Increment counter for each line (again in a form field)<?xdoxslt:set_variable($_XDOCTX, ’Counter’, xdoxslt:

get_variable($_XDOCTX, ’Counter’) + 1)?> Break if the number of rows is reached (say 6 rows in

this example)<?if: xdoxslt:get_variable($_XDOCTX, ’Counter’) mod 6=0?>

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

<?end if?

XML/BI Publisher

Page 48: XMLPresentation.ppt

Last Page Only Content:

• Create a section break in MSWord (Insert->Break->Section break Next page)

• Insert the following syntax on the final page:<?start@last-page:body?><?end body?>

• Content on the page above and below these tags will appear only on last page

• Headers or footers previously defined for the report must be reinserted on the last page

XML/BI Publisher

Page 49: XMLPresentation.ppt

Re-grouping XML Data:

Not limited by the structure of the data source Use the tags

<?for-each-group: BASE-GROUP;GROUPING-ELEMENT?> <?end for-each-group?>

Can establish nested groupings <?for-each:current-group(); GROUPING-ELEMENT?> <?end for-each-group?>

Example: CD Catalog XML data is grouped by CD. To change to groupby country, use the syntax below: <?for-each-group:CD:COUNTRY?>

XML/BI Publisher

Page 50: XMLPresentation.ppt

Cell highlighting:

• Native XSL embedded within XMLP using xdofo:ctx component

• Example: Change cell color to red if debit amount > 1000<?if:debit>1000?>

<xsl:attribute xdofo:ctx="block“name="background-color">red</xsl:attribute>

<?end if?>

XML/BI Publisher

Page 51: XMLPresentation.ppt

Page totals:

• Declare variable to hold page totals, following data element declaration• <?add-page-total:TotalFieldName;'element'?>

• Display total field• <?show-page-total:TotalFieldName;'Oracle-number-format'?>

• Example: Suppose we want to total the field “debit”• Create a page total variable called “dt” (it follows the placeholder)

<?debit?><?add-page-total:dt;'debit'?>• Insert the show page total syntax in the page footer

<?show-page-total:dt;'C9G990D00';'(C9G990D00)'?>• Page totalling available only for PDF output type

XML/BI Publisher

Page 52: XMLPresentation.ppt

1) Through RDF data model 2) Through Stored Procedure 3) Through XML Tags

Data Sources to generate XML reports in the following ways:

Page 53: XMLPresentation.ppt

1.Process Overview(through RDF Report)

• Set the E-Business Report to generate XML output

• Run the concurrent program using SRS to obtain sample XML output

• Design your template using Microsoft Word Template Builder

• Use Template Viewer with sample XML output to finetune template

• Register E-Business Report as “Data Definition” using Template Manager

• Register and upload template using Template Manager

• Assign the template to the data definition code

XML/BI Publisher

Page 54: XMLPresentation.ppt

Process Diagram

XML/BI Publisher

Page 55: XMLPresentation.ppt

• Create a report and register it as Concurrent Program of type XML

• Build a Data Definition & XML Template using XML Publisher

• Create a relation between the XML Template & Concurrent Program

Steps To Develop XML Report

XML/BI Publisher

Page 56: XMLPresentation.ppt

• First develop a report data model based on requirement.• Then save the file name with extension '.rdf'.• Then move that file into server in appropriate top.• Make executable file and method as “oracle reports” and

define concurrent program of type “xml”.

Registration Steps

XML/BI Publisher

Page 57: XMLPresentation.ppt

• Add Concurrent program to appropriate responsibility.• Then go to that responsibility and submit a request through

“SRS WINDOW”• Run the concurrent program

XML/BI Publisher

Page 58: XMLPresentation.ppt

Generated XML Output

XML/BI Publisher

Page 59: XMLPresentation.ppt

• If you map the oracle report data model and the xml data file. It will look like this

• Save this XML data file as filename.xml

XML/BI Publisher

Page 60: XMLPresentation.ppt

Template Design• Design template based on client Requirement in word.

• Then load data from xml file.

XML/BI Publisher

Page 61: XMLPresentation.ppt

• Load the XML data file to MS Word and save it as .rtf file

XML/BI Publisher

Page 62: XMLPresentation.ppt

Inserting fields into Template

XML/BI Publisher

Page 63: XMLPresentation.ppt

• When we click on Insert-->Field button the following form will be displayed.

• Then we can insert fields into appropriate columns.

XML/BI Publisher

Page 64: XMLPresentation.ppt

Standard Templates

XSL

Adobe Acrobat

MS Word

MS Excel

XSL Editors

desktop applications XML/BI Publisher

Page 65: XMLPresentation.ppt

• When we click on Preview-->RTF the output will be shown as below

XML/BI Publisher

Page 66: XMLPresentation.ppt

Defining Data definitions And Templates• For this we can add XML publisher responsibility to user.

• Then switch to that responsibility.• Then go through the following navigation for defining Data definition• HOME --> Datadefinitions• Then it displays form like below

XML/BI Publisher

Page 67: XMLPresentation.ppt

• In the above form we have to give code as “Concurrent Program short name", which we already defined.

XML/BI Publisher

Page 68: XMLPresentation.ppt

Defining Template• After defining Datadefinitions now we have to define “Template”• For this navigation is• XML publisher Responsibility --> Home --> Templates• Form will look like as below

XML/BI Publisher

Page 69: XMLPresentation.ppt

• In template form also we have to give code as “Concurrent Program short name”

• Type is “RTF”• Give appropriate Application name• Attach “.rtf” file which we created

XML/BI Publisher

Page 70: XMLPresentation.ppt

Submitting Request

Then run the concurrent program by submitting a request in SRS window

XML/BI Publisher

Page 71: XMLPresentation.ppt

View Output• Concurrent Program is completed normal.• Then we can see output by clicking on “view output” button.

XML/BI Publisher

Page 72: XMLPresentation.ppt

XML/BI Publisher

Output of above Concurrent Program:

Page 73: XMLPresentation.ppt

Link Between RDF and XML

• If you open the property inspector in the Data Model of RDF, You can see the XMLSETTINGS Property. This will be helpful in the case of creation of XML Tags.

Page 74: XMLPresentation.ppt

• You can change the name of the XML tag here initially creation_date column XML tag is creation_date

Page 75: XMLPresentation.ppt

• Here we can see the changed XML tag name of creation_date column as DATE

Page 76: XMLPresentation.ppt

• Here we can see the changed xml tag name of creation_date as Date

Page 77: XMLPresentation.ppt

Exclude the column from XML output through RDF• As the name indicates, it will exclude that item from the XML tag.

Page 78: XMLPresentation.ppt

• As the name indicates, it will exclude that item from the XML tag.

Page 79: XMLPresentation.ppt

• You can see the absence of description here

Page 80: XMLPresentation.ppt

2.Through XML Stored Procedure:

Steps to be followed when dealing with Stored Procedure:

Create a Stored Procedure Define Executable Define concurrent Program Add Concurrent Program to Receivables request

group Create data definition Create Template Run the Concurrent Program to see the output

XML/BI Publisher

Page 81: XMLPresentation.ppt

create or replace PROCEDURE oe_xml ( errbuff OUT VARCHAR, retcode OUT NUMBER) AS CURSOR header_select IS SELECT ooh.order_number , oet.name , hzp.party_name FROM oe_order_headers_all ooh, oe_transaction_types_tl oet , hz_parties hzp , hz_cust_accounts hca WHERE 1 =1 AND ooh.order_type_id =oet.transaction_type_id AND ooh.sold_to_org_id=hca.cust_account_id AND hzp.party_id =hca.party_id AND ooh.order_number = '43009'; CURSOR line_select(o_num VARCHAR2) IS SELECT ool.line_number, msi.segment1 , msi.description , ool.ordered_quantity , ool.unit_selling_price FROM oe_order_lines_all ool, oe_order_headers_all ooh , mtl_system_items_b msi

WHERE 1 =1 AND ool.header_id =ooh.header_id AND ool.inventory_item_id= msi.inventory_item_id AND ool.ship_from_org_id = msi.organization_id AND ooh.order_number = o_num ;BEGIN FOR header_rec IN header_select LOOP FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<HEADER>'); FND_FILE.PUT_LINE(FND_FILE.OUTPUT,' <ORDER_NUMBER> ' || header_rec.order_number||' </ORDER_NUMBER>'); FOR line_rec IN line_select(header_rec.order_number) LOOP FND_FILE.PUT_LINE(FND_FILE.OUTPUT,' <LINE>'); FND_FILE.PUT_LINE(FND_FILE.OUTPUT,' <LINE_NUMBER>' ||line_rec.line_number ||'</LINE_NUMBER>' ); FND_FILE.PUT_LINE(FND_FILE.OUTPUT,' <ITEM>' ||line_rec.segment1 ||'</ITEM>' ); FND_FILE.PUT_LINE(FND_FILE.OUTPUT,' <DESCRIPTION>' ||line_rec.description ||'</DESCRIPTION>' ); FND_FILE.PUT_LINE(FND_FILE.OUTPUT,' <ORDERED_QUANTITY>' ||line_rec.ordered_quantity ||'</ORDERED_QUANTITY>' ); FND_FILE.PUT_LINE(FND_FILE.OUTPUT,' <UNIT_PRICE>' ||line_rec.unit_selling_price ||'</UNIT_PRICE>' ); FND_FILE.PUT_LINE(FND_FILE.OUTPUT,' </LINE>'); END LOOP; FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</HEADER>'); END LOOP; END oe_xml;

Stored Procedure:XML/BI Publisher

Page 82: XMLPresentation.ppt

XML/BI Publisher

Define Executable:• Create an executable SampleXmlReport for the above procedure

oe_xml• Give Execution Method as PLSQL Stored Procedure• Give Stored procedure name as Executable File Name Navigation is: System administratorProgramExecutable

Give Stored Procedure Name

Page 83: XMLPresentation.ppt

• Create a new concurrent program SampleXmlReport that will call the SampleXmlReport executable declared above. Make sure that output format is placed as XML.

• Go to Application Developer Responsibility -> Concurrent ->Program

Define concurrent Program:

XML/BI Publisher

Page 84: XMLPresentation.ppt

• Add this new concurrent program with Receivables request group. Either using the following code or through below application screen.

• Go to System Administrator Responsibility->Security->Responsibility->Request

Add Concurrent Program to Receivables request group:

XML/BI Publisher

Page 85: XMLPresentation.ppt

• From the receivables responsibility (depends on which responsibility we added our concurrent program here it is receivables)

• From the menu View->Requests->Submit A New Request->Single Request

Submit a request to generate XML output:

XML/BI Publisher

Page 86: XMLPresentation.ppt

Generated XML Output:

XML/BI Publisher

Page 87: XMLPresentation.ppt

Layout Template

• Click on the required format in Preview tab to see the output• Then create data definitions and data template as follows

XML/BI Publisher

Page 88: XMLPresentation.ppt

Create data definition

• Click on Apply

XML/BI Publisher

Page 89: XMLPresentation.ppt

Create Template

• Then Click on apply• Run the Concurrent Program to get the output.

Upload RTF file

XML/BI Publisher

Page 90: XMLPresentation.ppt

Run the Concurrent Program

• Click on view output to see the final output

XML/BI Publisher

Page 91: XMLPresentation.ppt

Generated Output

XML/BI Publisher

Page 92: XMLPresentation.ppt

3.Through XML Tags:

Steps to be followed when dealing with Stored Procedure:

Design the Data Template XML File. Create data definition Define concurrent Program to generate the Data XML File. Add Concurrent Program to required module request

group Create Template Add Template to data definition Run the Concurrent Program to see the output

XML/BI Publisher

Page 93: XMLPresentation.ppt

• The XML/BI publisher requires a template layout and data XML to generate the report PDF,EXCEL,RTF or HTML format.

• The data XML can be generated from Oracle Report,OA Framework and data Template.

• Using this approach you can develop BI Publisher reports in Oracle EBS,without having to develop an RDF report.

• You can specify an SQL Statement in an XML file, and result of that SQL Statement is published as XMLP Output.

SQL Query to develop BI Publisher Report:

XML/BI Publisher

Design the Data Template XML File.

Page 94: XMLPresentation.ppt

The data template is the XML document whose elements communicate the following information to the data engine.

Data Query : The SQL query with bind parameter specifying the data to be fetched.Bind Parameters : Definition of each bind parameter defined in the query.Data Structure : Definition of the Output XML Structure.Data Triggers : Triggers that should be executed before or after the data query execution. Triggers are used to either do initialization or do some post query operation.

XML/BI Publisher

Page 95: XMLPresentation.ppt

Sample Data Template:

XML/BI Publisher

• Hence Data Template is the means by which we inform the data engine to fetch the data of our interest. Apart from the these , data template also contains other elements. To make our example simple and easy to understand, lets deal with the above 4 elements.

Page 96: XMLPresentation.ppt

Data Template Structure:

XML/BI Publisher

Page 97: XMLPresentation.ppt

Data Template Declaration:

Define Parameters:

XML/BI Publisher

Page 98: XMLPresentation.ppt

Lexical References: You can use lexical references to replace the clauses appearing after SELECT, FROM, WHERE, GROUP BY, ORDER BY, or HAVING. Use a lexical reference when you want the parameter to replace multiple values at runtime.Create a lexical reference using the following syntax: &parametername Define the lexical parameters as follows: Before creating your query, define a parameter in the PL/SQL default package for each lexical reference in the query. The data engine uses these values to replace the lexical parameters.

Create your query containing lexical references.

XML/BI Publisher

Page 99: XMLPresentation.ppt

For example:

Package employeeAS where_clause varchar2(1000); ..... Package body employeeAS ..... where_clause := 'where deptno=10'; ..... Data template definition: <dataQuery> <sqlstatement name="Q1"> <![CDATA[SELECT ENAME, SAL FROM EMP &where_clause]]> </sqlstatement> </dataQuery>

XML/BI Publisher

Page 100: XMLPresentation.ppt

XML/BI Publisher

Data Query: Use <sqlStatement name=""> to define query Performing operations in SQL is faster than performing them in Data Template or PL/SQL. The following are the most common cases where using SQL would improve performance: Use a WHERE clause instead of a group filter to exclude records.

Perform calculations directly in your query rather than in template.

Example: Data Query <parameters> <parameter name="p_DeptNo" dataType="character" /> </parameters> <dataQuery> <sqlStatement name="Q1"> <![CDATA[ SELECT d.DEPTNO,d.DNAME,d.LOC, EMPNO,ENAME,JOB,MGR,HIREDATE,SAL

from dept d, emp e where d.deptno=e.deptno AND d.deptno = nvl(:p_DeptNo,d.deptno) ]]> </sqlStatement> </dataQuery>

Page 101: XMLPresentation.ppt

Data Triggers

Data triggers execute PL/SQL functions at specific times during the execution and generation of XML output. Data triggers are optional, and you can have as many <dataTrigger> elements as necessary. The <dataTrigger> element has a set of related attributes. These are expressed within the <dataTrigger> tag. . For example, the name and source attributes are expressed as follows:<dataTrigger name="beforeReport" source="employee.beforeReport()"/> <dataTrigger name="beforeReport" source="employee.beforeReport(:Parameter)"/>The location of the trigger indicate at what point the trigger fires:

XML/BI Publisher

Page 102: XMLPresentation.ppt

The Data Structure Section:  In the data structure section you define what the XML output will be and how it will be structured. You can do the following:• Create break groups: Order By in SQL query should be set• Apply group filters: WHERE clause Should be use instead of a group filter • Create summary columns: Sum, Average, Count, Maximum and Minimum

Example: <group name="G_DEPT" source="Q1" groupFilter="empdata.G_DEPTFilter(:DEPT_NUMBER)"> <element name="DEPT_NUMBER" value="DEPTNO" /> <element name="DEPTSAL" value="G_EMP.SALARY" function="SUM()"/> <group name="G_EMP" source="Q2"> <element name="EMPLOYEE_NUMBER" value="EMPNO" /> <element name="NAME" value="ENAME"/> <element name="JOB" value="JOB" /> <element name="SALARY" value="SAL"/> </group></group>

XML/BI Publisher

Page 103: XMLPresentation.ppt

Example: Using Link tag <dataQuery> <sqlStatement name="Q1"> <![CDATA[ SELECT DEPTNO,DNAME,LOC from dept where &pwhereclause order by deptno ]]> </sqlStatement> <sqlStatement name="Q2"> <![CDATA[ SELECT EMPNO,ENAME,JOB,MGR,HIREDATE,SAL from EMP ]]> </sqlStatement> <link name="DEPTEMP_LINK" parentQuery="Q1" parentColumn="DEPTNO" childQuery="Q2" childColumn=“DEPTNO“condition="="/> </dataQuery>

Linking Queries: Two ways of linking are supported• Bind variables in your query• Link element <link name="" ……../> Performance Considerations “As far as our test shows that use bind PL/SQL variable for detail query is more efficient to merge the two queries rather than build one single query out of that “This might not apply to all cases.

XML/BI Publisher

Page 104: XMLPresentation.ppt

• For this we Should add XML publisher responsibility to user.• Then switch to that responsibility.• Then go through the following navigation for defining Data definition• HOME --> Datadefinitions• Then it displays form as below

Defining Data definitions

XML/BI Publisher

Page 105: XMLPresentation.ppt

In the above form we have to give code and use the same code as concurrent program short name.

After creating data definitions then click on Apply we will get the following options below of this form

XML/BI Publisher

Page 106: XMLPresentation.ppt

Upload generated data template file

XML Schema:

XML/BI Publisher

Page 107: XMLPresentation.ppt

XML/BI Publisher

Define a Concurrent Program to generate the Data XML File.

Using Responsibility System Administrator --> Concurrent : Program --> Define.

Define a Concurrent Program With executable = XDODTEXE and Output Format = XML.

Page 108: XMLPresentation.ppt

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.

XML/BI Publisher

Page 109: XMLPresentation.ppt

Associate the Concurrent Program to a request group.

XML/BI Publisher

Page 110: XMLPresentation.ppt

Execute the concurrent program “XML Publisher Invoice Program "and click on the output button get the Data XML. Save the XML file. We will use it to generate the RTF Template.

XML/BI Publisher

Page 111: XMLPresentation.ppt

XML/BI Publisher

Page 112: XMLPresentation.ppt

Template Design• Design template based on client Requirement in word.

• Then load data from xml file.

XML/BI Publisher

Page 113: XMLPresentation.ppt

• Load the XML data file to MS Word and save it as .rtf file

XML/BI Publisher

Page 114: XMLPresentation.ppt

Inserting fields into Template

XML/BI Publisher

Page 115: XMLPresentation.ppt

• When we click on Insert-->Field button the following form will be displayed.

• Then we can insert fields into appropriate columns.

XML/BI Publisher

Page 116: XMLPresentation.ppt

Standard Templates

XSL

Adobe Acrobat

MS Word

MS Excel

XSL Editors

desktop applications XML/BI Publisher

Page 117: XMLPresentation.ppt

• When we click on Preview-->RTF the output will be shown as below

XML/BI Publisher

Page 118: XMLPresentation.ppt

Defining Data definitions And Templates• For this we can add XML publisher responsibility to user.

• Then switch to that responsibility.• Then go through the following navigation for defining Data definition• HOME --> Datadefinitions• Then it displays form like below

XML/BI Publisher

Page 119: XMLPresentation.ppt

• In the above form we have to give code as “Concurrent Program short name", which we already defined.

XML/BI Publisher

Page 120: XMLPresentation.ppt

Defining Template• After defining Datadefinitions now we have to define “Template”• For this navigation is• XML publisher Responsibility --> Home --> Templates• Form will look like as below

XML/BI Publisher

Page 121: XMLPresentation.ppt

• In template form also we have to give code as “Concurrent Program short name”

• Type is “RTF”• Give appropriate Application name• Default file name is “.rtf” file name which we already defined.

XML/BI Publisher

Page 122: XMLPresentation.ppt

Submitting Request

Then run the concurrent program by submitting a request in SRS window

XML/BI Publisher

Page 123: XMLPresentation.ppt

View Output• Concurrent Program is completed normal.• Then we can see output by clicking on “view output” button.

XML/BI Publisher

Page 124: XMLPresentation.ppt

XML/BI Publisher

Output of above Concurrent Program:

Page 125: XMLPresentation.ppt

Securing PDF Output in XML Publisher

You can now embed any of the XML Publisher properties into your RTF template <<reference to property lists>> These would then be resolved at runtime by the XML Publisher engine. You can either use hard coded values or embed the values inside the incoming XML data. If you wanted to secure PDF output generated from a template you can use the XML Publisher pdf security properties and obtain the password value from the incoming XML data. To add an XML Publisher property to a template use the Properties dialog (File -> Properties) :

XML/BI Publisher

Page 126: XMLPresentation.ppt

picture 1: xdo-pdf-security picture 2: xdo-pdf-open-password

XML/BI Publisher

Page 127: XMLPresentation.ppt

The XML Publisher properties need to have ‘xdo-’ as a prefix to their regular names so ‘pdf-open-password’ becomes ‘xdo-pdf-open-password’. Just add the XML Publisher properties and their value to the document using the dialog.

Once this is done , opening the PDF will prompt you for a password

XML/BI Publisher

Page 128: XMLPresentation.ppt

Multilayout

Steps for handling multiple layouts in XML.1. After developing the Report definition file (.rdf).2. we have to add one user parameter. 3. This parameter value should be assigned to Place holder

column(CP ).4. We can assign Parameter value either after parameter form

or before report Triggers. In this example we assigned in Before report trigger.

XML/BI Publisher

Page 129: XMLPresentation.ppt

• Develop a Data model, Then save that file name with .rdf extension

Page 130: XMLPresentation.ppt

1. After developing the Report definition file (.rdf) we have to add one more parameter like follows and give data type as Character.

Page 131: XMLPresentation.ppt
Page 132: XMLPresentation.ppt
Page 133: XMLPresentation.ppt
Page 134: XMLPresentation.ppt
Page 135: XMLPresentation.ppt

GETTING TWO KIND OF OUTPUTs AT A TIME(Multi Template)

• The Unique feature of XML Report is to get two kind of reports at a time. For this, we have to do a minor Modification.

• Here, Let us imagine that there is a situation to get both the templates at a time. [Manager1 is asking a report in PDF format and Manager2 is asking a report in Excel format].

Create a Report using a Query in .rdf format.STEP1: Open the Report Builder and Select the option to build the report manually.The Query used is to bring the items created after 01-Jan-2011SELECT inventory_item_id, segment1, description, creation_dateFROM mtl_system_items_bWHERE creation_date > TO_DATE ('01-JAN-2011') AND organization_id = 204

Create the Layout. [Actually, there is no need to create layout for XML report.]

XML/BI Publisher

Page 136: XMLPresentation.ppt

• Create a report and register it as Concurrent Program of type XML

• Build a Data Definition & XML Template using XML Publisher

• Create a relation between the XML Template & Concurrent Program

Steps To Develop XML Report

XML/BI Publisher

Page 137: XMLPresentation.ppt

• First develop a report data model based on requirement.• Then save the file name with extension '.rdf'.• Then move that file into server in appropriate top.• Make executable file and method as “oracle reports” and

define concurrent program of type “xml”.

Registration Steps

XML/BI Publisher

Page 138: XMLPresentation.ppt

• Add Concurrent program to appropriate responsibility.• Then go to that responsibility and submit a request through “SRS

WINDOW”• Run the concurrent program

XML/BI Publisher

Page 139: XMLPresentation.ppt

• Run the concurrent program

XML/BI Publisher

Page 140: XMLPresentation.ppt

• Save it with “.xml” extension

XML/BI Publisher

Page 141: XMLPresentation.ppt

Template Design• Design template based on client Requirement in word.

• Then load data from xml file.

XML/BI Publisher

Page 142: XMLPresentation.ppt

• Load the XML data file to MS Word and save it as .rtf file

XML/BI Publisher

Page 143: XMLPresentation.ppt

• Use Table wizard to design the template.

XML/BI Publisher

Page 144: XMLPresentation.ppt

XML/BI Publisher

Page 145: XMLPresentation.ppt

XML/BI Publisher

Page 146: XMLPresentation.ppt

• Save the layout template with “.rtf” extension

XML/BI Publisher

Page 147: XMLPresentation.ppt

• Click on preview tab to see the output in different formats

XML/BI Publisher

Page 148: XMLPresentation.ppt

Defining Data definitions And Templates• For this we can add XML publisher responsibility to user.

• Then switch to that responsibility.• Then go through the following navigation for defining Data definition• HOME --> Datadefinitions• Then it displays form as below

XML/BI Publisher

Page 149: XMLPresentation.ppt

• In the above form we have to give code as “Concurrent Program short name", which we already defined.

XML/BI Publisher

Page 150: XMLPresentation.ppt

Defining Template• After defining Datadefinitions now we have to define “Template”• For this navigation is• XML publisher Responsibility --> Home --> Templates• Form will look like below

XML/BI Publisher

Page 151: XMLPresentation.ppt

• In template form also we have to give code as “Concurrent Program short name”

• Type is “RTF”• Give appropriate Application name• Attach “.rtf” file which we created

XML/BI Publisher

Page 152: XMLPresentation.ppt

Submitting Request

Then run the concurrent program by submitting a request in SRS window

XML/BI Publisher

Page 153: XMLPresentation.ppt

View Output• Concurrent Program is completed normal.• Then we can see output by clicking on “view output” button.

XML/BI Publisher

Page 154: XMLPresentation.ppt

• Design another rtf template as follows

XML/BI Publisher

Page 155: XMLPresentation.ppt

Here we can observe that for one data definition we have created two templates

Attach this template to the concurrent program

XML/BI Publisher

Page 156: XMLPresentation.ppt

You can see that the Old template was added here. If, You need to change this one click onoptions

XML/BI Publisher

Page 157: XMLPresentation.ppt

• Add the new template as below• If we want to change the output format then click on format and select the desired format

XML/BI Publisher

Page 158: XMLPresentation.ppt

• Here we can see the changed format that is HTML and click on ok

• Here we can see two attached layout templates then click on submit

XML/BI Publisher

Page 159: XMLPresentation.ppt

• Here we can see that two templates will run simultaneously and we will get the output based on the format we specified while adding the templates to the concurrent program

• After running the concurrent program successfully we can see the following outputs by clicking on view output

XML/BI Publisher

Page 160: XMLPresentation.ppt

• First template HTML output • Second template PDF output

XML/BI Publisher

Page 161: XMLPresentation.ppt

Regrouping• If You want to use Grouping by Currency Code ,Supplier name, country code

etc..inside the existing group, You can add this. Syntax: To regroup the data, use the following syntax: <?for-each-group: BASE-GROUP;GROUPING-ELEMENT?> Example: If we regroup the G_INVOICE_NUM listing by currency_code in the

template it will be as follows

XML/BI Publisher

Page 162: XMLPresentation.ppt

• Layout Template for regrouping • Regrouping with currency code output

XML/BI Publisher

Page 163: XMLPresentation.ppt

• To establish nested groupings within the already defined group, use the following syntax: <?for-each:current-group(); GROUPING-ELEMENT?>

Example: <?for-each:current-group(); GL_DATE?>

Nested Grouping:

XML/BI Publisher

Page 164: XMLPresentation.ppt

Regrouping by an Expression Regrouping by an expression allows you to apply a function or command to a data element, and then group the data by the returned result. To use this feature, state the expression within the regrouping syntax as follows: <?for-each:BASE-GROUP;GROUPING-EXPRESSION?>

XML/BI Publisher

Page 165: XMLPresentation.ppt

What is Bursting?

XML Publisher’s bursting engine accepts a data stream and splits it based on multiple Criteria, generates output based on a template, and then delivers the individual documents through the delivery channel of choice. The engine provides a flexible range of possibilities for document generation and delivery. 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).

XML/BI Publisher

Page 166: XMLPresentation.ppt

Benefits of XML bursting• The feature is standard for XML Publisher version 5.6.3• No coding is required• Output is sent via email. User does not need to login to Oracle to get the report• The main report template and the bursting templates can be different from each other. Thus

there can be one output from the concurrent program and a different layout to send as email.Example for Data Template:

<?xml version="1.0"?><dataTemplate name="UserDT" description="User Details" version="1.0"><parameters><parameter name="p_createdby" dataType="Varchar2"/></parameters><dataQuery><sqlStatement name="Q1"><![CDATA[SELECT user_id,user_name,created_by from fnd_user where user_id=nvl(:p_createdby,user_id)]]></sqlStatement><dataStructure><group name="G_User" source="Q1"><element name="user_id" value="user_id"/><element name="User_NAME" value="user_name"/><element name="created_by" value="created_by"/></group></dataStructure></dataTemplate>

XML/BI Publisher

Page 167: XMLPresentation.ppt

Create Concurrent Program

XML/BI Publisher

If we want to define Parameters Click on Parameters Tab

Defining Parameters

Page 168: XMLPresentation.ppt

XML/BI Publisher Register the data definition:

Navigation is:XML Publisher Administrator Data Definition

Upload Data Template File

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

Page 169: XMLPresentation.ppt

Email control file<?xml version="1.0" encoding="UTF-8"?><xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi" listener="oracle.apps.xdo.batch.SampleListener"> <xapi:request select="/RAXINV/LIST_G_ORDER_BY/G_ORDER_BY/LIST_G_INVOICE/G_INVOICE"> <xapi:delivery> <xapi:email server="Mail server" port="25" from="from email address" reply-to ="Reply to email address"> <xapi:message id="Myemail" to="[email protected]" cc="[email protected]" attachment="true" content-type="html/text"subject="Your Invoice #${TRX_NUMBER} ${BILL_CUST_NAME}">Dear Sir/Madam,

XML/BI Publisher

Page 170: XMLPresentation.ppt

Please find attached your invoice <B> #${TRX_NUMBER} </B>............RegardsAccount Receivables Manager</xapi:message> </xapi:email> </xapi:delivery> <xapi:document key="${TRX_NUMBER}" output="${TRX_NUMBER}" output-type="pdf" delivery="Myemail"> <xapi:template type="rtf" locale="" location="xdo://AR.RAXINV.en.US/?getSource=true" translation="" filter=""> </xapi:template> </xapi:document> </xapi:request></xapi:requestset>

XML/BI Publisher

Page 171: XMLPresentation.ppt

<?xml version="1.0" encoding="UTF-8"?><xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi" listener="oracle.apps.xdo.batch.SampleListener"> <xapi:request select="/RAXINV/LIST_G_ORDER_BY/G_ORDER_BY/LIST_G_INVOICE/G_INVOICE"> <xapi:delivery> <xapi:fax server="faxprintername"> <xapi:number id="MyFax">fax number</xapi:number> </xapi:fax> </xapi:delivery> <xapi:document key="${TRX_NUMBER}" output="${TRX_NUMBER}" output-type="pdf" delivery="MyFax"> <xapi:template type="rtf" locale="" location="xdo://AR.RAXINV.en.US/?getSource=true" translation="" filter=""> </xapi:template> </xapi:document> </xapi:request></xapi:requestset>

Fax control file

XML/BI Publisher

Page 172: XMLPresentation.ppt

Printer control file:

<?xml version="1.0" encoding="UTF-8"?><xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi" listener="oracle.apps.xdo.batch.SampleListener"> <xapi:request select="/RAXINV/LIST_G_ORDER_BY/G_ORDER_BY/LIST_G_INVOICE/G_INVOICE"> <xapi:delivery> <xapi:print id="Myprinter"printer="Printer Name" copies="1" /> </xapi:delivery> <xapi:document key="${TRX_NUMBER}" output="${TRX_NUMBER}" output-type="pdf" delivery="Myprinter"> <xapi:template type="rtf" locale="" location="xdo://AR.RAXINV.en.US/?getSource=true" translation="" filter=""> </xapi:template> </xapi:document> </xapi:request></xapi:requestset>

XML/BI Publisher

Page 173: XMLPresentation.ppt

<?xml version="1.0" encoding="UTF-8"?><xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi" listener="oracle.apps.xdo.batch.SampleListener"> <xapi:request select="/RAXINV/LIST_G_ORDER_BY/G_ORDER_BY/LIST_G_INVOICE/G_INVOICE"> <xapi:delivery> <xapi:ftp id="Myftp" server="ftp address" user="${ftp_user}" password="${ftp_password}" remote-directory="/output" remote-file="${${TRX_NUMBER}.pdf"> </xapi:ftp> </xapi:delivery> <xapi:document key="${TRX_NUMBER}" output="${TRX_NUMBER}" output-type="pdf" delivery="Myftp"> <xapi:template type="rtf" locale="" location="xdo://AR.RAXINV.en.US/?getSource=true" translation="" filter=""> </xapi:template> </xapi:document> </xapi:request></xapi:requestset>

FTP control file

XML/BI Publisher

Page 174: XMLPresentation.ppt

Conclusion

Oracle XML Publisher offers you the most efficient, scalable reporting solution available for complex, distributed environments. Oracle XML Publisher reduces the high costs associated with the development, customization and maintenance of business documents.

XML/BI Publisher

Page 175: XMLPresentation.ppt

Any Queries

Page 176: XMLPresentation.ppt

Thank You