P. 1
XML Publisher Doc

XML Publisher Doc

|Views: 801|Likes:
Published by haribaskari

More info:

Published by: haribaskari on Jan 03, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

05/28/2013

pdf

text

original

DOCUMENT ON

XML PUBLISHER

Prepared By

I.Hari Baskar Chain-Sys (India) Pvt Ltd. Chennai.

Reviewed By

Venkateswaran A.S, Chain-Sys (India) Pvt Ltd., Chennai.

On August 04, 2008.

INDEX Introduction to XML Publisher..............................................................................................................................................1 Process Overview.....................................................................................................................................................................3 Design Time..........................................................................................................................................................................3 Runtime.................................................................................................................................................................................4 Creating a RTF Template.......................................................................................................................................................4 Using the XML Publisher Template Builder:.......................................................................................................................4 Associating the XML Data to the Template Layout.............................................................................................................5 a) How to Identify Placeholders and Groups.......................................................................................................................5 Placeholders.....................................................................................................................................................................5 b) Identifying the Groups of Repeating Elements.................................................................................................................5 Basic RTF Method...........................................................................................................................................................5 Form Field Method...........................................................................................................................................................6 How to the initial page number be set at a specified number.............................................................................................8 Conditional Formatting and If statement...........................................................................................................................11 If-then-Else Statements.........................................................................................................................................................12 Choose Statements.................................................................................................................................................................13 Column Formatting...............................................................................................................................................................13 Row Formatting.....................................................................................................................................................................14 How to set a background color.............................................................................................................................................15 How to Displaying Page Totals.............................................................................................................................................15 How to do Running Totals....................................................................................................................................................17 How to create Subtemplate..................................................................................................................................................18 Register the Template in the Template Manager................................................................................................................19 Import the Subtemplate to the Main Template...................................................................................................................19 Call the Subtemplate in Your Main Template.....................................................................................................................19 Register the Template in the Template Manager................................................................................................................19 Import the Sub template to the Main Template..................................................................................................................19 Call the Subtemplate in Your Main Template.....................................................................................................................19 Dening Headers and Footers..............................................................................................................................................21 Native Support....................................................................................................................................................................21 Multiple Headers and Footers............................................................................................................................................21 How to design the xml publisher report..............................................................................................................................31

Introduction to XML Publisher
Oracle XML Publisher was originally developed to solve the reporting problems faced by Oracle Applications. It was first released with Oracle E-Business Suite 11.5.10 in 2003. In the last 5 years XML Publisher has matured and now satisfies all reporting requirements for Oracle Applications. Impressed by its capabilities, the J.D. Edwards EnterpriseOne application has just integrated with XML Publisher and Peoplesoft Enterprise will uptake XML Publisher in the next release. Many customers outside of Oracle Applications face the same reporting issues. On the Oracle World 2004 customers asked for a standalone version of XML Publisher. XML Publisher Enterprise was developed for these customers with no dependency on Oracle Applications. It is a complete web-based reporting application that allows user to:  Manage reports in a folder structure.  Create reports combining multiple databases as well as web services.  Define the report layout in Microsoft Word or Adobe Acrobat.  Connect from Microsoft EXCEL to XML Publisher reports.  Extract and translate the boilerplate text in reports.  Schedule and deliver reports via a variety of delivery channels such as email, fax, or print.

Merits of xml publisher
Oracle XML Publisher is a new, innovative reporting and output management solution that is designed to lower the total cost of ownership of reporting and document output management:  Deploy reports faster and lower your dependence on consulting services  Consolidate your reporting and document output management solution  Consolidate reporting and output management internationally.  Reduce the associated maintenance cost.  Protect investment in existing IT infrastructure. XML Publisher Enterprise: Repository, Report Viewer and Scheduler All XML Publisher solutions – the ones embedded into Oracle applications as well as XML Publisher Enterprise – offer multiple innovations that will be covered in the following sections. COMPLETE SOLUTION A typical enterprise has to create such diverse documents as invoices, purchase orders, sales orders, financial and management reports, government forms, checks, labels and electronic documents. These documents need to be delivered to customer, supplier and partners by email, fax, or print and stored in an archive or document management system. XML Publisher provides a complete solution for creating, managing and delivering all your business documents.

1

etc… XML Publisher allowed Oracle’s IT department to consolidate their printing solution and retire multiple third party solutions. layout. This makes XML Publisher fit into any IT environment and protects your investment into legacy systems. For examples changes to a report query require you to change only a single report file and none of the layouts or translations of this report. government forms. Oracle Oracle XML Publisher Enterprise is Oracle’s revolutionary new reporting and document output management solution.  XML Publisher reduces report customization and maintenance cost – due to the separation of data extract. but now you can design and control how the report outputs will be presented in separate template files. A single instance supports multiple user interface and document languages. EXCEL and Adobe Acrobat Professional — allow functional users to define and customize the layout of documents. German. At runtime. checks. it results in less complex and easier to maintain solutions. Chinese or Arabic (bi-directional) and print them to a local or remote printer. and translation. Since Oracle XML Publisher can replace multiple systems. The same user can create documents in English. management and financial reports. so you can rapidly develop and maintain custom report formats. no single solution was able to satisfy all these requirements. Financial Reports  A single web-based solution for producing and delivering a broad range of business documents such as: sales orders. a report server. XML Publisher merges your designed template files with the report data to create a variety of outputs to meet a variety of business needs. It provides a new approach to report design and publishing by integrating familiar desktop word processing tools with existing E-Business Suite data reporting. Oracle’s XML Publisher is a template-based publishing solution delivered with the Oracle E-Business Suite.  XML Publisher facilitates the global consolidation of your reporting solutions. As a result many businesses – including Oracle – were required to maintain several reporting solutions: invoice server. invoices. such as: End user desktop applications — Microsoft Word. As such it can run on any J2EE compliant application server and can access data from practically any database. XML Publisher offers multiple innovations that substantially lower the total cost of ownership for reporting solutions. labels. and electronic documents (EDI/EFT). a label print server. The flexibility of XML Publisher is a result of the separation of the presentation of the report from its data structure.Solutions that can be consolidated with Oracle XML Publisher Enterprise Before XML Publisher. Since then. a fax server.meaning it is completely based on open standards. purchase orders. This results in a more efficient cooperation between IT and functional departments and reduces the need for external consultants. XML Publisher leverages standard. The collection of the data is still handled by the E-Business Suite. many of Oracle’s customers were able to consolidate their printing and document management solution by replacing multiple systems with XML Publisher. well-known technologies and tools. including: 2 . a check print sever. Oracle XML Publisher is “hot pluggable” .

the data and template produce a "filled-out" form. invoices.  HTML output for optimum online viewing. Process Overview Creating customized reports using XML Publisher can be divided into two phases: Design Time and Runtime. The Template must be assigned to the Data Definition Code of the E-Business Suite report with which it will be merged. Customer-ready PDF documents. 3 . At runtime. Translate the strings in this file and re upload to the Template Manager to make the translation available at runtime. to use as a template for your report. headers and footers. such as financial statements.RTF is a specification used by many word processing applications. Add desired translations of your RTF template. Design Time 1. Your template files can be either in Rich Text Format (RTF) or Portable Document Format (PDF). Register your Template in the Template Manager. font styles. and many other formatting and design options. Design your template. You can download a PDF document.  Flat text files to exchange with business partners for EDI and EFT transmission.rtf extension). and purchase orders utilizing colors. XML Publisher’s translation utility allows you to extract the translatable strings from your template into an XLIFF file. 3. XML Publisher recognizes the formatting features that you apply and converts them to XSL-FO. 4. Insert basic markup tags to the document to prepare it for merging with the XML data. Use Adobe Acrobat to apply markup tags to your custom-designed or downloaded PDF template.  "Filled-out" third-party provided PDF documents. Create a Data Definition in the Template Manager for E-Business Suite reports that you wish to customize using XML Publisher. images. You design the template using your desktop word processing application and save the file as an RTF file type (. such as Microsoft Word. When you create the template in the Template Manager. 2. When you create the Data Definition. such as a government form.  Excel output to create a spreadsheet of your report data. you register and upload your RTF or PDF template files. Register the E-Business Suite report as a Data Definition in the Template Manager. marketing materials. contracts. the Data Definition Code must match the E-Business Suite report Short name.

Available templates are those associated to the report Data Definition in the Template Manager. Set the concurrent program to generate XML. 3. and a set of SQL expressions extended by XML Publisher Using the XML Publisher Template Builder: The Template Builder is an extension to Microsoft Word that simplifies the development of RTF templates. Run the XML Publisher Concurrent Request. Publishing Concurrent Requests with XML. XML Publisher merges your design template with the XML data to generate your customized output. Simply run the request and select your template from the Submit Request user interface and the concurrent manager calls XML Publisher to merge the template and data all in a single step. you add data fields and other markup to your template using XML Publisher’s simplified tags for XSL expressions. Note: The Application Object Library. you can include any XSL element. 2. template locale. The XML Publisher Concurrent Request will prompt you to enter the Request ID from the previous step. If you are familiar with XSL and prefer not to use the simplified tags. Use it in conjunction with this manual to increase your productivity. During design time.Runtime 1. You can therefore create report designs using many of your standard word processing application’s design features and XML Publisher will recognize and maintain the design. Creating a RTF Template Rich Text Format (RTF) is a specification used by common word processing applications. XML Publisher supports other advanced reporting features such as conditional formatting. and to select a template. and output type. It automates many of the manual steps that are covered in this chapter. You are not required to run the XML Publisher Concurrent Request. These tags associate the XML report data to your report layout. When you save a document. fully integrates XML Publisher with the concurrent manager’s standard request submission both in Oracle Forms and HTML-based applications. If you wish to include code directly in your template. In addition to your word processing application’s formatting features. and charts. The Template Builder is tightly integrated with Microsoft Word and allows you to perform the following functions:  Insert data fields  Insert data-driven tables 4 . Run the concurrent program using standard request submission to obtain the XML output.XML Publisher’s RTF Template Parser converts documents saved as the RTF file type to XSL-FO. dynamic data columns. many FO elements. running totals. such as Microsoft Word. XML Publisher also supports the use of pure XSL elements in the template. RTF is a file type option that you select.

Each group of repeating elements in your template must correspond to a parent-child relationship in the XML file. Enter the element’s XML tag name using the syntax: 5 . To map the data fields you define placeholders. The placeholder maps the template report field to the XML element. At runtime the placeholder is replaced by the value of the element of the same name in the XML data file. Insert data-driven forms  Insert data-driven charts  Preview your template with sample XML data  Browse and update the content of form fields  Extract boilerplate text into an XLIFF translation file and test translations Manual steps for performing these functions are covered in this chapter. Form Field Method: (Requires Microsoft Word) Insert the placeholder syntax in Microsoft Word’s Text Form Field Options window. To designate the repeating elements. you define groups Placeholders Each data field in your report template must correspond to an element in the XML file. a) How to Identify Placeholders and Groups Each data field in your template must map to an element in the XML file. Basic RTF Method: Insert the placeholder syntax directly into your template document. There are two ways to insert placeholders in your document: 1.The data fields that are defined on the template 2. Instructions and tutorials for using the Template Builder are available from the readme and help files delivered with the plugin. 2. Enter placeholders in your document using the following syntax: <?XML element tag name?> Note: The placeholder must match the XML element tag name exactly. Basic RTF Method Enter the placeholder syntax in your document where you want the XML data value to appear.The elements of the template that will repeat when the report is run. you define placeholders for the XML elements. Associating the XML Data to the Template Layout 1. This method allows you to maintain the appearance of your template. At runtime the placeholder is replaced by the value of the element of the same name in the XML data file b) Identifying the Groups of Repeating Elements The placeholder maps the template field to the XML element data field. When you mark up your template design. It is case sensitive.

In the example. Double-click the form field area to invoke the Text Form Field Options dialog box. (Optional) Enter a description of the field in the Default text field. Position your cursor in the place you want to create a placeholder. 5. Use Microsoft Word’s Text Form Field Options window to insert the placeholder tags: Enable the Forms toolbar in your Microsoft Word application. 3. 2. 7. In the help text entry field. This action inserts a form field area in your document. Select the Add Help Text button. enter the XML element’s tag name using the syntax: <?XML element tag name?> You can enter multiple element tag names in the text entry field. For the example. 8.<?XML element tag name?> Form Field Method 1. the report field "Supplier" maps to the XML element VENDOR_NAME. enter "Supplier 1". The entry in this field will populate the placeholder’s position on the template. 6. Select OK to apply. In the Form Field Help Text field enter: <?VENDOR_NAME?> The following figure shows the Text Form Field Options dialog box and the Form Field Help Text dialog box with the appropriate entries for the Supplier field. 6 . Select the Text Form Field toolbar icon. 4.

7 .

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. the field called PageBreak contains the split-bypage-break syntax: How to the initial page number be set at a specified number Place the PageBreak field with the <?split-by-page-break:?> syntax immediately before the <?end foreach?> field. In the Help Text of this form field enter the syntax: <?split-by-page-break:?> Example For the following XML. assume you want to create a page break for each new supplier: <SUPPLIER> <NAME>My Supplier</NAME> <INVOICES> <INVOICE> <INVNUM>10001-1</INVNUM> <INVDATE>1-Jan-2005</INVDATE> <INVAMT>100</INVOICEAMT> </INVOICE> <INVOICE> <INVNUM>10001-2</INVNUM> <INVDATE>10-Jan-2005</INVDATE> <INVAMT>200</INVOICEAMT> </INVOICE> </INVOICES> </SUPPLIER> <SUPPLIER> <NAME>My Second Supplier</NAME> <INVOICES> <INVOICE> <INVNUM>10001-1</INVNUM> <INVDATE>11-Jan-2005</INVDATE> <INVAMT>150</INVOICEAMT> </INVOICE> … In the template sample shown in the following figure. To insert a page break between each occurrence of a group. insert the "split-by-page-break" form field within the group immediately before the <?end for-each?> tag that closes the group. The PageBreak field sits inside the end of the SUPPLIER loop. This will ensure a page break is inserted before the occurrence of each Initial Page Number 8 .

Example This example uses the last page only feature for a report that generates an invoice listing with a summary to appear at the bottom of the last page. Last Page Only Content XML Publisher supports the Microsoft Word functionality to specify a different page layout for the first page. To utilize this feature. Create a section break in your template to ensure the content of the final page is separated from the rest of the report. 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. XML Publisher allows you to set the page number in the template to support this requirement. This is useful for documents such as checks. Example 2 . For example. XML Publisher will recognize the settings you make in this dialog. invoices. note that because this command explicitly specifies the content of the final page. To implement these options. Also. Use the following syntax in your template to set the initial page number: <?initial-page-number:pagenumber?> where pagenumber is the XML element or parameter that holds the numeric value. for example: Creating an RTF <REPORT> <PAGESTART>200<\PAGESTART> </REPORT> Enter the following in your template: <?initial-page-number:PAGESTART?> Your initial page number will be the value of the PAGESTART element. and even pages. then select the Layout tab.Some reports require that the initial page number be set at a specified number. monthly reports may be required to continue numbering from month to month. <?xml version="1. simply select Page Setup from the File menu. However. which in this case is 200. Microsoft Word does not provide settings for a different last page only. Enter the following in your template: <?initial-page-number:$PAGESTART?> Note: You must first declare the parameter in your template.XML Publisher provides this ability. Insert the following syntax on the final page: <?start@last-page:body?> <?end body?> Any content on the page that occurs above or below these two tags will appear only on the last page of the report. 2. odd pages. you must: 1. you can pass the initial value by calling the parameter. any desired headers or footers previously defined for the report must be reinserted on the last page.0" encoding="WINDOWS-1252"?> <INVOICELIST> <VENDOR> <VENDOR_NAME>Nuts and Bolts Limited</VENDOR_NAME> 9 .Set page number by passing a parameter value If you define a parameter called PAGESTART. Set page number from XML data element If your XML data contains an element to carry the initial page number.

.68</SUM_ACCTD_AMT> <TAX_CODE>EU22%</TAX_CODE> </SUMMARY> </INVOICELIST> The report should show each VENDOR and their INVOICE data with a SUMMARY section that appears only on the last page. The summary table is shown in the following figure: Last Page Only Layout: 10 . placed at the bottom of the page.. <INVOICE> . insert new line characters to position the summary table at the bottom of the page. For the final page. Redwood City..33</ACCTD_AMT> <VAT_CODE>VAT22%</VAT_CODE> </INVOICE> </VENDOR> <VENDOR> .<ADDRESS>1 El Camino Real.. CA 94065</ADDRESS> <INVOICE> <INV_TYPE>Standard</INV_TYPE> <INVOICE_NUM>981110</INVOICE_NUM> <INVOICE_DATE>10-NOV-04</INVOICE_DATE> <INVOICE_CURRENCY_CODE>EUR</INVOICE_CURRENCY_CODE> <ENT_AMT>122</ENT_AMT> <ACCTD_AMT>122</ACCTD_AMT> <VAT_CODE>VAT22%</VAT_CODE> </INVOICE> <INVOICE> <INV_TYPE>Standard</INV_TYPE> <INVOICE_NUM>100000</INVOICE_NUM> <INVOICE_DATE>28-MAY-04</INVOICE_DATE> <INVOICE_CURRENCY_CODE>FIM</INVOICE_CURRENCY_CODE> <ENT_AMT>122</ENT_AMT> <ACCTD_AMT>20. </INVOICE> </VENDOR> <SUMMARY> <SUM_ENT_AMT>61435</SUM_ENT_AMT> <SUM_ACCTD_AMT>58264. Insert a Microsoft Word section break (type: next page) on the first page of the template.

the first page layout will be used. you can specify that if reported numbers reach a certain threshold. they will display shaded in red. Or. XML Publisher supports the usage of simple "if" statements. for example. as well as more complex "choose" expressions. The conditional formatting that you specify can be XSL or XSL:FO code. Template Builder for Word installation It is important to note that if the report is only one page in length. you can use this feature to hide table columns or rows depending on the incoming XML data. If your reports contains headers and footers that you want to carry over onto the last page. If Statements Use an if statement to define a simple condition. you must reinsert them on the last page. Any content above or below this statement will appear on the last page only. For example.You must insert a section break (type: next page) into the document to specify the last page layout. The content above the statement is regarded as the header and the content below the statement is regarded as the footer. 1. Insert the following syntax to designate the beginning of the conditional area. For more information about headers and footers see Defining Headers and Footers. The "Last Page Placeholder" field contains the syntax: <?start@last-page:body?> <?end body?> to declare the last page layout.The F and E components contain the for-each grouping statements. if a data field is a specific value. <?if:condition?> 11 . The grayed report fields are placeholders for the XML elements. If your report requires that a single page report should default to the last page layout (such as in a check printing implementation) then you can use the following alternate syntax for the "Last Page Placeholder" on the last page: <?start@last-page-first:body?> <?end body?> Substituting this syntax will result in the last page layout for reports that are only one page long. or you can specify actual RTF objects such as a table or data. Conditional Formatting and If statement Conditional formatting occurs when a formatting element appears only when a certain condition is met.

show the word "Lower". If-then-Else Statements XML Publisher supports the common programming construct "if-then-else". For example. insert the syntax <?if:VENDOR_NAME=’COMPANYA’?> before the Supplier field on the template. This is extremely useful when you need to test a condition and conditionally show a result. if it is less than 1000. For example: IF X=0 THEN Y=2 ELSE Y=3 END IF You can also nest these statements as follows: IF X=0 THEN Y=2 ELSE IF X=1 THEN Y=10 ELSE Y=100 END IF Use the following syntax to construct an if-then-else statement in your RTF template: <?xdofx:if element_condition then result1 else result2 end if?> For example. show the word "Higher". This example is displayed in the figure below. or directly into the template. Insert the following syntax at the end of the conditional area: <?end if?>.2. to set up the Payables Invoice Register to display invoices only when the Supplier name is "Company A". Enter the <?end if?> tag after the invoices table. If the value is greater than 1000. if it is equal to 1000. Note that you can insert the syntax in form fields. the following statement tests the AMOUNT element value. show "Equal": <?xdofx:if AMOUNT > 1000 then ’Higher’ else if AMOUNT < 1000 then ’Lower’ else ’Equal’ 12 .

In the template. Use the following syntax for these elements: <?choose:?> <?when:expression?> <?otherwise?> "Choose" Conditional Formatting Example This example shows a choose expression in which the display of a row of data depends on the value of the fields EXEMPT_FLAG and POSTED_FLAG. the row of data will render light gray. When the EXEMPT_FLAG equals "^". and otherwise elements to express multiple conditional tests. the row of data will render with no shading. If certain conditions are met in the incoming XML data then specific sections of the template will be rendered. This is a very powerful feature of the RTF template. In regular XSL programming. Otherwise. Column Formatting You can conditionally show and hide columns of data in your document output. you can actually use visual widgets in the conditional flow (in the following example. when. however. When POSTED_FLAG equals "*" the row of data will render shaded dark gray. represented by the following XML: <items type="PUBLIC"> <! . This example will show a report of a price list. a table). if a condition is met in the choose command then further XSL code is executed.end if?> Choose Statements Use the choose. The following example demonstrates how to set up a table so that a column is only displayed based on the value of an element attribute.> <item> <name>Plasma TV</name> <quantity>10</quantity> <price>4000</price> </item> 13 .can be marked ‘PRIVATE’ .

Examples of row-level formatting are: • Highlighting a row when the data meets a certain threshold. insert the <?if:condition?> <?end if?>tags at the beginning and end of the row. Conditionally Displaying a Row To display only rows that meet a certain condition. • Showing only rows that meet a specific condition. The following figure is a simple template that will conditionally show or hide the quantity column: Row Formatting XML Publisher allows you to specify formatting conditions as the row-level of a table. This is demonstrated in the following sample template. For the "public" version of the list we do not want to show the quantity column in the output. • Alternating background colors of rows to ease readability of reports.<item> <name>DVD Player</name> <quantity>3</quantity> <price>300</price> </item> <item> <name>VCR</name> <quantity>20</quantity> <price>200</price> </item> <item> <name>Receiver</name> <quantity>22</quantity> <price>350</price> </item> </items> Notice the type attribute associated with the items element. within the for-each tags for the group. In this XML it is marked as "PUBLIC" meaning the list is a public list rather than a "PRIVATE" list. if big <?if:SALES>5000?> If statement to display the row only if the element SALES has a value greater than 5000. but we want to develop only one template for both versions based on the list type. Default Text Entry Form Field Help Text Description for-each SALE <?for-each:SALE?> Opens the for-each loop to repeat the data belonging to the SALE group. INDUSTRY 14 .

How to Displaying Page Totals XML Publisher allows you to display calculated page totals in your report. you associate it with the element from the XML file that is to be totalled for the page. You can add this syntax to as many fields as you want to total.<?INDUSTRY?> Data field YEAR <?YEAR?> Data field MONTH <?MONTH?> Data field SALES end if <?end if?> Closes the if statement. you must define a variable to hold the value. To declare the variable that is to hold your page total. <?if@row:position() mod 2=0?> <xsl:attribute name="background-color" xdofo:ctx="incontext">lightgray</xsl: attribute><?end if?> For each alternate row. the background color attribute is set to gray for the row. RTF. insert the following syntax immediately following the placeholder for the element that is to be totalled: <?add-page-total:TotalFieldName. When you define the variable. end SALE <?end for-each?> Closes the SALE loop. you can also perform additional functions on the data in those fields. How to set a background color Conditionally Highlighting a Row This example demonstrates how to set a background color on every other row. 15 . Because the page total field does not exist in the XML input data. Default Text Entry Form Field Help Text Description for-each SALE <?for-each:SALE?> Defines the opening of the for-each loop for the SALE group.format. the totaling function must be executed by the formatting engine. Once you define total fields. Therefore this feature is not available for other outputs types: HTML. Excel. INDUSTRY <?INDUSTRY?> Data field YEAR <?YEAR?> Data field MONTH <?MONTH?> Data field SALES <?SALES?> Data field end SALE <?end for-each?> Closes the SALE for-each loop.’element’?> where TotalFieldName is the name you assign to your total (to reference later) and ’element’ is the XML element field to be totalled. Note: Page totaling is performed in the PDF-formatting layer. Because the page is not created until publishing time.

<?debit?><?add-page-total: This field is the placeholder dt.’number-format’?> where TotalFieldName is the name you assigned to give the page total field above and number-format is the format you wish to use to for the display.<?show-page-total:TotalFieldName. This example uses the following XML: <balance_sheet> <transaction> <debit>100</debit> <credit>90</credit> </transaction> <transaction> <debit>110</debit> <credit>80</credit> </transaction> … <\balance_sheet> The following figure shows the table to insert in the template to hold the values: Default Text Entry FE 100. the page total declaration syntax is added.’debit’?> for the debit element from the XML file. The field defined to hold the total for the debit element is dt. Because we want to total this field by page. The following 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.00 Form Field Help Text Entry Description <?for-each:transaction?> This field defines the opening "for-each" loop for the transaction group. 16 .

credit’?> subtracting the credit values from the debit values.’credit’?> for the credit element from the XML file. the page total declaration syntax is added. page 2-79) can be used to add a running total to your invoice listing report.0" encoding="WINDOWS-1252"?> <INVOICES> <INVOICE> <INVNUM>10001-1</INVNUM> <INVDATE>1-Jan-2005</INVDATE> <INVAMT>100</INVOICEAMT> </INVOICE> <INVOICE> <INVNUM>10001-2</INVNUM> <INVDATE>10-Jan-2005</INVDATE> <INVAMT>200</INVOICEAMT> </INVOICE> <INVOICE> <INVNUM>10001-1</INVNUM> <INVDATE>11-Jan-2005</INVDATE> <INVAMT>150</INVOICEAMT> </INVOICE> </INVOICES> 17 . Example The variable functionality (see Using Variables.00 Net EFE How to do Running Totals <?credit?> <?add-pagetotal: This field is the placeholder ct. This example assumes the following XML structure: <?xml version="1.90.’debit Creates a net page total by . <?end for-each?> Closes the for-each loop. Because we want to total this field by page. The field defined to hold the total for the credit element is ct <add-page-total:net.

Retrieves the RTotalVar value for display. ’RTotalVar’) + INVAMT)? > xdoxslt:get_variable($_ XDOCTX. For create the subtemplate the following tag to the beginning of the section to be included: <?template:template_name?> where template_name is whatever name you choose for the section. ’RTotalVar’. Ends the INVOICE group. 0)? > <?for-each:INVOICE?> <?INVNUM?> <?INVDATE?> <?xdoxslt:set_variable($_ XDOCTX. ’RTotalVar’. Step 4 :Call the sub template in your main template. xdoxslt: get_variable($_XDOCTX. Step 3 :Import the sub template to the main template. EFE How to create Subtemplate There are four steps to create sub template such as Step1: Create the sub template.To create the Running Total field. ’RTotalVar’)?> <?end for-each?> Description Declares the "RTotalVar" variable and initializes it to 0. Invoice Number tag Invoice Date tag Sets the value of RTotalVar to the current value plus the new Invoice Amount.00 Syntax <?xdoxslt:set_variable($_ XDOCTX. Starts the Invoice group. Step 2:Register the sub template in the Template Manager. 18 . define a variable to track the total and initialize it to The template is shown in the following figure: Form Field RtotalVar FE 10001-1 1-Jan-2005 100.

Import the Sub template to the Main Template Call a template from within another template by using the import command as follows: <?import:xdo://APPCODE. as follows: <?call template:template_name?> Where Template name is the name assigned in the template declaration of the subtemplate. Import the Subtemplate to the Main Template Call a template from within another template by using the import command as follows: <?import:xdo://APPCODE..LANG. To define it as a subtemplate. LANG is the template language specified in the Template Manager.LANG. Call the Subtemplate in Your Main Template Once you have imported the template. TERR is the template territory specified in the Template Manager.TERR?> where APPCODE is the Application code for the template defined in the Template Manager. LANG is the template language specified in the Template Manager. TERR is the template territory specified in the Template Manager. use the call template command to render its contents in the position specified. use the call template command to render its contents in the position specified.TERR?> where APPCODE is the Application code for the template defined in the Template Manager. Register the Template in the Template Manager Register the subtemplate in the Template Manager. as follows: <?call template:template_name?> where template_name is the name assigned in the template declaration of the subtemplate. select Subtemplate = YES. TEMPLATE_CODE is the template code defined in the Template Manager.TEMPLATE_CODE. select Subtemplate = YES. so instead 19 . Call the Subtemplate in Your Main Template Once you have imported the template. To define it as a subtemplate. TEMPLATE_CODE is the template code defined in the Template Manager.Register the Template in the Template Manager Register the subtemplate in the Template Manager. For example the company and the address are appearing each every page that is Static strings.TEMPLATE_CODE.

East main road. Anna Nagar. 5. we can place it in one template and reference it from all the others. Step2: Add it to the Template Manager using the following criteria: • Application Code: CUSTOM • Template Code: COMMONCOMPONENTS • Language: English • Territory: United States of America • Select "Yes" for Subtemplate Now this subtemplate and any functions therein can be referenced from any other template.US?> At the position in the template where we you want to display the address. you can insert any valid RTF template functionality in a subtemplate. This functionality is not limited to just strings.of reproduce address in all templates. Save this template as RTF. and even pass parameters from one to the other. 20 .COMMONCOMPONENTS. <?end template?> This defines the string in a function (or XSL template) called MyAddress. enter: <?call template:MyAddress?> At runtime the string will be fetched from the subtemplate and rendered in the layout of the calling template. Step3: To use this subtemplate in another template.en. Step1: <?template:MyAddress?> chains-sys india pvt ltd. first import it by inserting the following syntax at the top of the calling template: <?import:xdo://CUSTOM.

The Payables Invoice Register contains a simple header and footer and therefore does not require the start body/end body tags. The syntax for these extended functions is: <?xdofx:expression?> for extended SQL functions or <?xdoxslt:expression?> for extended XSL functions. the elements occurring before the beginning of the body area will compose the header. create them by using XML Publisher tags to define the body area of your report. SQL Statement Usage 2+3 2-3 2*3 2/3 2**3 <?xdofx:2+3?> <?xdofx:2-3?> <?xdofx:2*3?> <?xdofx:2/3?> <?xdofx:2**3? Description Addition Subtraction Multiplication Division Exponential Concatenation 21 . As an alternative. and then call this sub template from the header or footer region. you can define an internal template in the body of your template. Insert <?end body?> after the Suppliers group closing tag: <?end for-each?> To See version the xml publisher: In the xml output if u wright click we can see the version of the xml publisher. However. use the word processing application’s header and footer insertion tools. define the body area as follows: 1. To create a header or footer. Insert <?start:body?> before the Suppliers group tag: <?for-each:G_VENDOR_ NAME?> 2. Extended SQL and XSL Functions  XSL Equivalents  Using FO Elements XML Publisher has extended a set of SQL and XSL functions for use in RTF templates. or in form fields. When you define the body area. See Header and Footer Template Alternative Multiple Headers and Footers If your template requires multiple headers and footers. if you wanted to add another header to the template. The elements occurring after the body area will compose the footer. Use the following tags to enclose the body area of your report: <?start:body?> <?end body?> Use the tags either directly in the template.Dening Headers and Footers Native Support XML Publisher supports the use of the native RTF header and footer feature.

22 .

Number and Date Formatting Number Formatting XML Publisher supports two methods for specifying the number format: 23 .

where "L" will be replaced by the currency symbol based on the locale at runtime.3455e-3.000. Set the Type to Number.• Microsoft Word’s Native number format mask • Oracle’s format-number function Note: You can also use the native XSL format-number function to format numbers. Using the Microsoft Number Format Mask To format numeric values. If the number format mask is specified using bothmethods. depending on the locale. use Microsoft Word’s field formatting features available from the Text Form Field Options dialog box. This consists of an optional sign ("-") followed by a sequence of zero or more decimal digits (the integer). This is applicable for both the Oracle format mask and the MS formatmask. 24 . Data Source Requirements To use the Oracle format mask or the Microsoft format mask. Using the MS format mask sets the currency in the template so that it cannot be updated at runtime. Open the Form Field Options dialog box for the placeholder field. the numbers in your data source must be in a raw format. Do not include "%" in the format mask because this will fix the location of the percent sign in the number display. while the desired position could be at the beginning or the end of a number. and optionally followed by an exponent. optionally followed by a fraction. 3. L999G999G999D99. Instead. using currency in the Microsoft format mask is not recommended unless you want the data reported in the same currency for all translations.00) the format will not work. Translation Considerations If you are designing a template to be translatable. Select the appropriate Number format from the list of options.00). with no formatting applied (for example: 1000. Note: The XML Publisher parser requires the Java BigDecimal string representation. For example: -123456. For example. Use only one of these methods. the data will be formatted twice. causing unexpected behavior. use the Oracle format mask.The group separator and the number separator will be set at runtime based on thetemplate locale. 2. The following graphic displays an example: To apply a number format to a form field: 1. If the number has been formatted for European countries (for example: 1.

25 .Supported Microsoft Format Mask Denitions The following table lists the supported Microsoft format mask definitions: Using the Oracle Format Mask To apply the Oracle format mask to a form field: 1. Open the Form Field Options dialog box for the placeholder field.

’999G999D99’?> where fieldname is the XML tag name of the data element you are formatting and 999G999D99 is the mask definition. 3.2. Enter the mask definition according to the following example: <?format-number:fieldname. Set the Type to "Regular text". The following graphic shows an example Form Field Help Text dialog entry for the data element "empno": The following table lists the supported Oracle number format mask symbols and their definitions: 26 . In the Form Field Help Text field.

• Specify an explicit date format mask using Oracle’s format-date function. If both the Oracle and MS format masks are Specified. (Recommended for multi language templates. • Specify an abstract date format mask using Oracle’s abstract date format Masks. the date from the XML Data source must be in canonical format.Date Formatting XML Publisher supports three methods for specifying the date format: • Specify an explicit date format mask using Microsoft Word’s native date format mask. This format is: YYYY-MM-DD hh:mm:ss+HH:MM 27 .) Only one method should be used. the data will be formatted twice causing unexpected behaviour. Data Source Requirements To use the Microsoft format mask or the Oracle format mask.

the abstract format mask"MEDIUM" will be used as default. 3. Current Date. or Greenwich Mean Time An example of this construction is: 2005-01-01T09:30:10-07:00 The data after the "T" is optional. 2. This is because the date format mask is part of the template. If you do not specify the mask in the Date format field. and all published reports based on this template will have the same date format regardless of locale. For translatable templates. or Current Time. the time will be formatted to the UTC time. Translation Considerations If you are designing a template to be translatable. explicitly setting a date format maskis not recommended. If it is necessary to explicitly specify a format mask. The following figure shows the Text Form Field Options dialog box with a date format applied: 28 . Open the Form Field Options dialog box for the placeholder field. it is recommended that you use the Oracle abstract date format. therefore the following date: 2005-01-01 can be formatted using either date formatting option. Set the Type to Date. Select the appropriate Date format from the list of options.where • YYYY is the year • MM is the month • DD is the day • T is the separator between the date and time component • hh is the hour in 24-hour format • mm is the minutes • ss is the seconds • +HH:MM is the time zone offset from Universal Time (UTC). Using the Microsoft Date Format Mask To apply a date format to a form field: 1. the Oracle format mask is recommended over the MS format mask to ensure future compatibility. Note that if you do not include the time zone offset.

The abbreviated name of the month. Single-digit hours will have a leading zero. The default date separator defined in DateSeparator. Displays the time zone offset for the system’s current time zone in whole hours only. The period or era. 29 . as defined in DayNames. Single-digit minutes will not have a leading zero. Displays seconds fractions represented in five digits. as defined in MonthNames. The AM/PM designator defined in AMDesignator or PMDesignator. Displays seconds fractions represented in two digits. Displays seconds fractions represented in seven digits. Quoted string. The numeric month. The second. The second. (This element can be used for formatting only) Displays the time zone offset for the system’s current time zone in hours and minutes. Single-digit months will not have a leading zero. The full name of the month. Single-digit minutes will have a leading zero. Quoted string. if any. Single-digit hours will have a leading zero.The following table lists the supported Microsoft date format mask components: Symbol Meaning d dd ddd dddd M MM MMM MMMM yy yyyy gg h hh H HH m mm s ss f ff fff ffff fffff ffffff fffffff tt z zz zzz : / ’ " The day of the month. Single-digit days will have a leading zero. This pattern is ignored if the date to be formatted does not have an associated period or era string. The numeric month. The default time separator defined in TimeSeparator. Single-digit days will not have a leading zero. The day of the month. The minute. Displays seconds fractions represented in six digits. The hour in a 24-hour clock. Displays the literal value of any string between two “ characters. Displays seconds fractions represented in four digits. The full name of the day of the week. Displays seconds fractions represented in three digits. as defined in AbbreviatedDayNames. The year in four digits. The hour in a 12-hour clock. The year without the century. the year is displayed with a leading zero. The minute. Single-digit months will have a leading zero. Single-digit seconds will not have a leading zero. (This element can be used for formatting only) Displays the time zone offset for the system’s current time zone in whole hours only. Single-digit hours will not have a leading zero. Single-digit hours will not have a leading zero. If the year without the century is less than 10. The abbreviated name of the day of the week. Displays the literal value of any string between two ‘ characters. Single-digit seconds will have a leading zero. The hour in a 12-hour clock. The hour in a 24-hour clock. Displays seconds fractions represented in one digit. as defined in AbbreviatedMonthNames.

Base tables: The following base tables used to XDO_LOBS XDO_DS_DEFINITIONS_B XDO_DS_DEFINITIONS_TL XDO_TEMPLATES_B XDO_TEMPLATES_TL stores details of xml publiser 30 .

2 create executable file. Step2: Create concurrent program 31 .How to design the xml publisher report Step1: Create the rdf file (layout is not required) 1.

Save as xml the file. For example:-------------- 32 .Step3: Run the concurrent the program.

3 load into insert fields or individual fields. You can see the menu as shown in the below picture. 2. Load the xml file For example: ---------------- 2. here we can design the layout.Step4: Create Template 1. If Template Builder is already installed on the client machine. 2.1 load the xml file into ms word 2.4 see the preview 33 . Open Ms Word.

use the code name same as the concurrent program short name 34 . Navigation: Home>Data Definitions 3.5 save as the Template in rtf format.1 Create data definitions. Step3: Go to XML PUBLISHER ADMISTRATOR Resp.2.

Attach the Data definitions here.3.2 Go to Templates a. c.select the Application. press Create the Templates 35 . f. set type as RTF e. create code. d. Active is yes g.create template name. b.

6 press Apply button we get confirmation with successfully step4: 4.3.1 we have to run the concurrent program for xml output For Example 36 .

a)It is available in appropriate responsibility if not .we have to attach the xml report publisher concurrent program in corresponding Request Group. Template 3. It will ask for the following parameters 1.2 Run Xml Report Publisher. Template locale (language and territory) output of the xml publisher report: Extended function Base tables Version of the xml publisher Date formatting and number formating 37 .4. Request id 2.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->