Professional Documents
Culture Documents
Oracle XML Publisher
Oracle XML Publisher
Data Logic
XSL
XML
Layout
XML Publisher
Translation
Report Output
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
Template Builder
The template builder is an extension to your Microsoft Word It is available in the menu and toolbar
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 Lets rock !
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?>
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 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 Numbering
Use Microsoft Word page numbering From Insert menu, select Page Numbers Select the position, alignment and format as desired
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
Additional Sorting
Sort order descending Data type sorting Number Date Separated by semi-colon (;) <?sort:trx_number; data-type=number; order=descending?>
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
Calculated Fields
Use field names and operand(s) + - Addition - - Minus * - Multiplication / - Division Example <?field1 + field2?> Not required to be in form field
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
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?>
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
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 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
Template
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