YOU ARE DOWNLOADING DOCUMENT

Please tick the box to continue:

Transcript
Page 1: 20454411 Oracle XML Publisher

Presenter Name

Date DD/MM/YYYY

Oracle XML Publisher and Template Builder for Microsoft Word

Presenter : Sai NarayanDate : 25-June-08

Page 2: 20454411 Oracle XML Publisher

XML Publisher Paradigm

• Separates data/layout/output format

Data Logic

Layout

TranslationXML Publisher

Report Output

XML

XSL

Page 3: 20454411 Oracle XML Publisher

XML Publisher Benefits

• Templates can be designed by functional user using familiar desktop tools

• Reduced maintenance costs – Enhancements like font changes/logo changes etc can be done by functional user

• Flexibility of output – PDF, Excel, HTML

Page 4: 20454411 Oracle XML Publisher

Getting Started

• Download and Install Oracle XML Publisher Desktop Patch 5.6.3

• Patch # 5887917• http://updates.oracle.com/download/5887917.html• Patch contains Template Builder and Template Viewer

• Template Builder

– Is an extension to Microsoft Word– Allows development of RTF templates

• Template Viewer – Provides report preview capability

Page 5: 20454411 Oracle XML Publisher

Template Builder

• The template builder is an extension to your Microsoft Word

• It is available in the menu and toolbar

Page 6: 20454411 Oracle XML Publisher

Process Overview

• 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• Let’s rock !

Page 7: 20454411 Oracle XML Publisher

Set E-Business Report Output Format

• Navigate as System Administrator->Concurrent->Program->Define

• Set Output Format to XML and save

Page 8: 20454411 Oracle XML Publisher

Run E-Business Report for Sample XML Output

• Run the E-Business report. For example, say Invoice Print (Receivables)

• Click on output and save the XML output to a file

Page 9: 20454411 Oracle XML Publisher

Sample XML Output File

• Note the structure of the XML file

Page 10: 20454411 Oracle XML Publisher

Designing the layout – Get the requirements

• Decide how the report layout should look like on paper

• For example, say the Receivables invoice needs to look like this (at least part of it)

Page 11: 20454411 Oracle XML Publisher

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• Dynamic data columns• Rows per page• Last Page Only content• Re-grouping xml data• Cell highlighting• Page totals

Page 12: 20454411 Oracle XML Publisher

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

Page 13: 20454411 Oracle XML Publisher

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

Page 14: 20454411 Oracle XML Publisher

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

Page 15: 20454411 Oracle XML Publisher

Page Numbering

• Use Microsoft Word page numbering

• From Insert menu, select Page Numbers• Select the position, alignment and format as desired

Page 16: 20454411 Oracle XML Publisher

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:trx_number?>

• No end tag

• Sort on multiple elements possible, use multiple sort tags– Example: <?sort:trx_number?><?sort:trx_date?>

• Sort on calculated fields supported

Page 17: 20454411 Oracle XML Publisher

Additional Sorting

• Sort order descending

• Data type sorting– Number– Date

• Separated by semi-colon (;)

• <?sort:trx_number;

data-type=‘number’;

order=‘descending’?>

Page 18: 20454411 Oracle XML Publisher

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

Page 19: 20454411 Oracle XML Publisher

Calculated Fields

• Use field names and operand(s)

– + - Addition– - - Minus– * - Multiplication

– / - Division

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

Page 20: 20454411 Oracle XML Publisher

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

Page 21: 20454411 Oracle XML Publisher

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

Page 22: 20454411 Oracle XML Publisher

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

Page 23: 20454411 Oracle XML Publisher

Dynamic data columns

Dynamic Column Header <?split-column-header:group element name?>

Dynamic Column Data <?split-column-data:group element name?>

Example: Print departments in column header and demand qty as column data

Column header <?split-column-header:G_DEPT_CLASS?><?DEPT_CLASS?>

Column data <?split-column-data:G_DEPT_CLASS?><?SUM_QTY?>

Page 24: 20454411 Oracle XML Publisher

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?

Page 25: 20454411 Oracle XML Publisher

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

Page 26: 20454411 Oracle XML Publisher

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 group

by country, use the syntax below: <?for-each-group:CD:COUNTRY?>

Page 27: 20454411 Oracle XML Publisher

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

Page 28: 20454411 Oracle XML Publisher

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

Page 29: 20454411 Oracle XML Publisher

Template Builder – Load XML Data

• First step - Load the sample XML output file using Data->Load XML Data

Page 30: 20454411 Oracle XML Publisher

Template Builder – Inserting Placeholders

• Insert placeholders using Insert->Field menu option. • Text form fields• Tag name is visible by clicking the Add Help Text button within the Text form field

• Use Microsoft Word tables for better alignment

Page 31: 20454411 Oracle XML Publisher

Template Builder – Sample template explained

Page 32: 20454411 Oracle XML Publisher

Template/XML/Form Field – How they relate Transaction Number

Template

Text form field

XML

Page 33: 20454411 Oracle XML Publisher

Template Builder Preview

• Preview template as PDF, HTML, Excel or RTF output

• Finetune till desired output is achieved• Save template as .rtf file

Page 34: 20454411 Oracle XML Publisher

Template Manager – E-Business Data Definition

• Navigate to XML Publisher Administrator responsibility• Home->Data Definitions->Then Click on Create Data Definition button• Enter details * Note: the Code is same as the concurrent program short

name – RAXINV_SEL

Page 35: 20454411 Oracle XML Publisher

Template Manager – E-Business Template

• Navigate to XML Publisher Administrator responsibility

• Home->Templates>Then Click on Create Template button• Assign the template to the Data Definition created earlier• Upload the RTF file

Page 36: 20454411 Oracle XML Publisher

Run concurrent using SRS

• Run the concurrent program using SRS

• Click Options button• Select Output Layout Format – Default PDF

Page 37: 20454411 Oracle XML Publisher

Exceptions

• Navigate System Administrator->Concurrent->Manager->Administer• Select Output Post Processor• Click on Processes button• Select the active process• Click on Manager Log button• Review the log for exceptions• More details and options for debugging – Refer Metalink Note 364547.1

Page 38: 20454411 Oracle XML Publisher

References and more info.

• XML Publisher Blog– http://blogs.oracle.com/xmlpublisher/

• XML Publisher Oracle Product Site– http://www.oracle.com/technology/products/xml-publisher/index.html

• XML Publisher Forum– http://forums.oracle.com/forums/forum.jspa?forumID=245

• User Guides– Oracle XML Publisher User’s Guide– Oracle XML Publisher Report Designer’s Guide

• Metalink Notes– Metalink Note 422508.1 – About XML Publisher Release 5.6.3– Metalink Note 364547.1 - Troubleshooting Oracle XML Publisher for Oracle Applications 11i

• Oracle Tutorial for XML Publisher for EBS– http://www.oracle.com/technology/obe/obe_bi/xmlp_ebiz/index.html


Related Documents