Oracle® XML Publisher Enterprise: User's Guide Release 5.6.2
Oracle® XML Publisher Enterprise: User's Guide Release 5.6.2
User’s Guide
Release 5.6.2
Part No. B25951-01
June 2006
Oracle XML Publisher Enterprise User’s Guide, Release 5.6.2
Contributing Author: Ahmed Ali, Tim Dexter, Klaus Fabian, Chiang Guo, Edward Jiang, Incheol
Kang, Kazuko Kawahara, Kei Saito, Ashish Shrivastava, Elise Tung-Loo
The Programs (which include both the software and documentation) contain proprietary information; they
are provided under a license agreement containing restrictions on use and disclosure and are also protected
by copyright, patent, and other intellectual and industrial property laws. Reverse engineering, disassembly,
or decompilation of the Programs, except to the extent required to obtain interoperability with other
independently created software or as specified by law, is prohibited.
The information contained in this document is subject to change without notice. If you find any problems
in the documentation, please report them to us in writing. This document is not warranted to be error-free.
Except as may be expressly permitted in your license agreement for these Programs, no part of these Programs
may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose.
If the Programs are delivered to the United States Government or anyone licensing or using the Programs on
behalf of the United States Government, the following notice is applicable:
The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently
dangerous applications. It shall be the licensee's responsibility to take all appropriate fail-safe, backup,
redundancy and other measures to ensure the safe use of such applications if the Programs are used for such
purposes, and we disclaim liability for any damages caused by such use of the Programs.
The Programs may provide links to Web sites and access to content, products, and services from third parties.
Oracle is not responsible for the availability of, or any content provided on, third-party Web sites. You bear
all risks associated with the use of such content. If you choose to purchase any products or services from a
third party, the relationship is directly between you and the third party. Oracle is not responsible for: (a) the
quality of third-party products or services; or (b) fulfilling any of the terms of the agreement with the third
party, including delivery of products or services and warranty obligations related to purchased products or
services. Oracle is not responsible for any loss or damage of any sort that you may incur from dealing with any
third party.
Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective owners.
Contents
Preface
1 Getting Started
Accessing XML Publisher Enterprise . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
Setting Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
4 Translating Reports
Template Translations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
Report File Translations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
iii
5 Administration
Administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1
Setting Up Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1
Understanding Users and Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
Integrating with LDAP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5
Setting Up Delivery Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-11
Setting Up the Server Configuration File . . . . . . . . . . . . . . . . . . . . . . . 5-13
Setting Up Oracle Single Sign-On . . . . . . . . . . . . . . . . . . . . . . . . . . 5-18
iv
If Statements in Boilerplate Text . . . . . . . . . . . . . . . . . . . . . . . 6-58
If-then-Else Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-59
Choose Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-59
Column Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-61
Row Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-63
Cell Highlighting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-64
Page-Level Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-66
Displaying Page Totals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-66
Brought Forward/Carried Forward Totals . . . . . . . . . . . . . . . . . . . . . 6-69
Running Totals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-72
Data Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-73
Sorting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-73
Checking for Nulls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-73
Regrouping the XML Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-74
Using Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-81
Defining Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-81
Setting Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-83
Advanced Report Layouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-85
Batch Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-85
Cross-Tab Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-87
Dynamic Data Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-90
Number and Date Formatting. . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-93
Calendar and Time Zone Support . . . . . . . . . . . . . . . . . . . . . . . . . . 6-103
Using External Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-104
Advanced Barcode Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . 6-105
Advanced Design Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-106
XPath Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-106
Namespace Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-109
Using the Context Commands . . . . . . . . . . . . . . . . . . . . . . . . . . 6-110
Using XSL Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-112
Using FO Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-114
v
Performing Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-12
Completed PDF Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-13
Runtime Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-14
Creating a Template from a Downloaded PDF . . . . . . . . . . . . . . . . . . . . 8-15
vi
Index
vii
Send Us Your Comments
Oracle welcomes customers' comments and suggestions on the quality and usefulness of this document.
Your feedback is important, and helps us to best meet your needs as a user of our products. For example:
• Are the implementation steps correct and complete?
• Did you understand the context of the procedures?
• Did you find any errors in the information?
• Does the structure of the information help you with your tasks?
• Do you need different information or graphics? If so, where, and in what format?
• Are the examples correct? Do you need more examples?
If you find any errors or have any other suggestions for improvement, then please tell us your name, the
name of the company who has licensed our products, the title and part number of the documentation and
the chapter, section, and page number (if available).
Note: Before sending us your comments, you might like to check that you have the latest version of the
document and if any concerns are already addressed. To do this, access the new Applications Release
Online Documentation CD available on Oracle MetaLink and www.oracle.com. It contains the most
current Documentation Library plus all documents revised or released recently.
Send your comments to us using the electronic mail address: [email protected]
Please give your name, address, electronic mail address, and telephone number (optional).
If you need assistance with Oracle software, then please contact your support representative or Oracle
Support Services.
If you require training or instruction in using Oracle software, then please contact your Oracle local
office and inquire about our Oracle University offerings. A list of Oracle offices is available on our Web
site at www.oracle.com.
ix
Preface
Intended Audience
Welcome to Release 5.6.2 of the Oracle XML Publisher Enterprise User’s Guide.
This guide is intended for users who will use XML Publisher Enterprise to perform
one or all of the following:
• View and Schedule reports
• Design report layouts
• Develop report queries and data models
• Translate reports
• Perform administrative tasks including: setting up users, setting up data sources, and
configuring runtime behaviors
For users who will be developing report queries and data models, knowledge of SQL
or your data source is assumed.
For users who will be designing report layouts, some experience with Microsoft Word
is assumed. If you are designing advanced report layouts, you may benefit by using
an XSL reference.
See Related Information Sources on page xii for more Oracle product information.
Documentation Accessibility
Our goal is to make Oracle products, services, and supporting documentation accessible,
with good usability, to the disabled community. To that end, our documentation
includes features that make information available to users of assistive technology.
This documentation is available in HTML format, and contains markup to facilitate
access by the disabled community. Accessibility standards will continue to evolve over
time, and Oracle is actively engaged with other market-leading technology vendors to
address technical obstacles so that our documentation can be accessible to all of our
customers. For more information, visit the Oracle Accessibility Program Web site at
http://www.oracle.com/accessibility/ .
xi
Accessibility of Code Examples in Documentation
Screen readers may not always correctly read the code examples in this document. The
conventions for writing code require that closing braces should appear on an otherwise
empty line; however, some screen readers may not always read a line of text that consists
solely of a bracket or brace.
Structure
1 Getting Started
2 Viewing and Scheduling Reports
3 Creating a New Report
4 Translating Reports
5 Administration
6 Creating an RTF Template
7 XSL, SQL, and XSL-FO Support
8 Creating a PDF Template
9 Building a Data Template
10 Setting Runtime Properties
11 Using the XML Publisher APIs
A Supported XSL-FO Elements
B Print Server Setup
xii
1
Getting Started
Logging in as Guest:
If your site has enabled a Guest user option, a Guest button will display on the log in
page.
Setting Preferences
Use the Preferences page to set the following:
• UI Language
• Report Locale
• SVG support in HTML
• Password
Access the Preferences page by selecting the Preferences link from any page within
the XML Publisher Enterprise application.
Set UI Language
The UI language is the language that your user interface displays in. The language that
you selected at login will be selected as the default. Choose from the languages that are
available for your installation.
Viewing a Report
The Reports home page offers different functionality depending on your user
permissions.
To view a report
1. Navigate to the report.
The Reports home page displays the report folders and the first three reports
contained in the folder. To see additional reports contained in a folder, either
select the folder name, or select the more... link.
Folder View
Depending on the report definition and your user permissions, you may be
presented with the following options:
• Change parameter values - if the report includes parameters, these are
presented at the top of the View page. To display the report with new
parameter values, enter the desired values and select the View button.
Scheduling a Report
To schedule a report:
1. Select the name of the folder that contains the report to access the Folder view;
or, select the report name to View the report.
• Save data - select this check box if you want the XML data from the report run
saved.
• Save output - select this check box if you want the report output saved. You
must select this option if you want to view your report from the History page.
Navigate to this page by selecting the report folder and then selecting the History link
for the report. Use this page to:
• View current schedules for a report
• Monitor the status of a submitted report
• Delete a scheduled report
• Suspend/Resume a scheduled report
The online Analyzer allows you to create a pivot table of your data. Use the interface
to analyze your report data by dragging and dropping data items into the crosstab
structure. Then quickly rearrange data as desired by dragging items to different
row, column or summary positions.
You can filter the data displayed in your pivot table by defining page-level data
items. Drag and drop the desired field to the Page item area and then choose from the
values that immediately populate the list.
After selecting all the data items for the table, choose whether to view the
Sum, Average, or Count of the data items.
The following example displays the usage of the Analyzer with a simple Sales Analysis
report:
1. Select the Analyzer button from the View Report page.
The Analyzer interface displays the list of data fields on a pane and an empty
crosstab structure on the adjacent pane, as shown in the following figure.
Now you can choose a value from the CATEGORY_NAME list to filter the page data:
You can now see the calculated sales totals as a sum of the data items.
Prerequisites
• Microsoft .NET Framework 2.0
If not installed on your computer, you will be prompted to download it the first time
you use the Analyzer for Excel.
• Microsoft Excel 2000 or later
Features
The Analyzer for Excel allows you to:
• Export the results of the report query to an Excel spreadsheet.
• Log in to XML Publisher Enterprise from Excel to refresh your data, apply new
parameters, and apply a template to the report data.
• Access and run your reports from an Excel session.
The report data will render in your Excel application window and the Oracle XML
Publisher menu will appear on your Excel menu bar. Note that the data are the
results of the report query with no template and default filtering applied.
You can now manipulate the data as you wish in Excel. If the report has
parameters, the parameter names will appear at the top of the sheet, but you must
log in to apply new parameter values. See Using the Oracle XML Publisher Menu,
page 2-12.
If this is the first time you have used the Analyzer for Excel, or if you do not have the
latest version of Analyzer for Excel, you will be prompted to install the latest version.
Show Report Parameters – displays the updateable parameters and available templates
for the report in a toolbar.
To update the data, select a new parameter value then select Refresh Data to refresh the
data in the current sheet.
To apply a template, select the template, then select Refresh Formatted Data. This will
download the report as HTML into a new worksheet. Select the new worksheet to see
the data with the new template applied.
Note: The template you select must have HTML as an available output.
Process Overview
Note: You must be assigned the XML Publisher Developer Role or
Admin Role to create or edit reports.
1. Navigate to the folder in which you want the new report to reside.
To create a new folder for this report, select the Create a new folder link.
2. Select the Create a new report link from the Folder and Report Tasks menu. This
will invoke a text box for you to enter the name of your new report.
Report Editor
This will display the Main Data Set list. This list will be empty until you define a
data set. To define a data set, select New.
• Enter the SQL query or select Query Builder. See Using the Query Builder,
page 3-10 for information on the Query Builder utility.
If you select HTTP (XML Feed)
• Enter the URL for the XML feed.
• Select the Method: Get or Post.
• Enter the Username, Password, and Realm for the URL.
• To add a parameter, select the Add link. Enter the Name and select the
Value. The Value list is populated by the parameter Identifiers defined in
the Parameters section.
Note: The parameters must already be set up in the
Parameters section of the report definition
• To specify a parameter, select the Add link. Select the parameter from the list.
Note: The parameters must already be set up in the
Parameters section of the report definition
Example
1. Enter the WSDL URL in a browser window to see the WSDL
definition. For example: http://xmlme.com/WSCustNews.asmx?WSDL
2. The available methods will be listed in the WSDL definition. For
example: GetCustomNews
3. Once you have the method, you can see the parameters required. For
example: Topic
4. Add the parameters for the WSDL to the report definition.
If you select Data Template
• Copy and paste your data template into the Data Template text box.
Important: The data template must begin with the
<dataTemplate> element. Do not include the XML
declaration.
Use XML Publisher’s data template to create more complex queries. See
Building a Data Template, page 9-1 for features and usage. Please note that
lexical parameters currently are not supported.
For information on creating template layout files, see Creating an RTF Template,
page 6-1 or Creating a PDF Template, page 8-1.
• Upload your layout template file. Use the Browse button to locate it in your local
file system, then select Upload. The template will now appear in the Manage
Template Files region. You can upload as many templates as you want to make
available to this report.
• Select the New icon to create the definition for the new template.
13. After you have uploaded all the templates and set up the Layout Definition, select
Layouts to set the Default template. The list will now be populated with the
templates you have defined.
14. Select the Save icon to save your report definition.
Selecting a Schema
The Schema list contains all the available schemas in the data source. Note that you
may not have access to all that are listed.
Selecting Objects
The Object Selection pane lists the tables, views, and materialized views from the
selected schema. Select the object from the list and it displays on the Design pane. Use
the Design pane to identify how the selected objects will be used in the query.
Supported Column Types
Columns of all types display as objects in the Design pane. Note the following column
restrictions:
• Each can select no more than 60 columns for each query.
• Only the following column types are selectable:
• VARCHAR2, CHAR
• XMLType
Note: When you execute the query in the Query Builder, the
XMLType will display as null. When you save the query to the
Report Builder, you must add the function (such as getClobval())
to extract the XML from the type.
Up and Down Arrows Controls the display order of the columns in the resulting query.
Alias Specify an optional column alias. An alias is an alternative column name. Aliases
are used to make a column name more descriptive, to shorten the column name, or
prevent possible ambiguous references.
Condition The condition modifies the query’s WHERE clause. When specifying a column
condition, you must include the appropriate operator and operand. All standard SQL
conditions are supported. For example:
>=10
=’VA’
IN (SELECT dept_no FROM dept)
BETWEEN SYSDATE AND SYSDATE + 15
Sort Order Enter a number (1, 2, 3, and so on) to specify the order in which selected columns
should display.
Show Select this check box to include the column in your query results. You do not need to
select Show if you need to add a column to the query for filtering only.
For example, suppose you wish to create following query:
SELECT ename FROM emp WHERE deptno = 10
To create this query in Query Builder:
1. From the Object list, select EMP.
3. For the deptno column, in Condition enter =10 and uncheck the Show check box.
Group By Specify columns to be used for grouping when an aggregate function is used. Only
applicable for columns included in output.
As you select columns and define conditions, Query Builder writes the SQL for you.
To view the underlying SQL, click the SQL tab
Saving a Query
Once you have built the query and executed it, select the Save button to return to the
Report Editor. The query will appear in the SQL Query box.
Rename a Report
To rename a report:
1. Navigate to the report folder.
2. Select the Report Actions icon. This will activate the Rename this report option
under the Folder and Report Tasks region.
3. Select the option and enter the new name in the text box.
Copy a Report
To copy a report:
1. Navigate to the report folder.
Download a Report
To download a report:
1. Navigate to the report folder.
2. Select the Report Actions icon. This will activate the Download this report option
under the Folder and Report Tasks region.
3. Select the option to download and save the report.
Note: The report definition will be downloaded as an XML file.
Delete a Report
To delete a report:
Note: You must be assigned the XML Publisher Developer role or XML
Publisher Administration Role to delete reports.
Folder Tasks
Select the Folder Actions icon to expand the menu of available folder tasks. Folder
Tasks include:
• Create a new folder
• Rename this folder
• Copy this folder
• Delete this folder
Note: The Report Actions menu can be viewed only by the XML
Publisher Administrator role and the XML Publisher Developer role.
Renaming a Folder:
1. Select the Folder icon to view all Folder Actions in the Folder and Report Tasks
menu.
Deleting a Folder:
1. Select the Folder icon to view all Folder Actions in the Folder and Report Tasks
menu.
2. Select the Delete this folder link.
3. Confirm the deletion at the prompt.
Template Translations
There are two options for adding translated templates to your report definition:
• Create a separate RTF template that is translated (a localized template)
• Generate an XLIFF file from the original template (at runtime the original template is
applied for the layout and the XLIFF file is applied for the translation)
Use the first option if the translated template requires a different layout from the original
template.
If you only require translation of the text strings of the template layout, use the XLIFF
option.
Important: Regardless of which option you choose, you must name
your translated templates according to the naming standard for
XML Publisher to recognize it at runtime. See Naming Standards for
Translated Files, page 4-5.
A "translatable string" is any text in the template that is intended for display in the
published report, such as table headers and field labels. Text supplied at runtime from
the data is not translatable, nor is any text that you supply in the Microsoft Word form
fields.
You can translate the template XLIFF file into as many languages as desired and then
associate these translations to the original template. See Uploading Translated Files,
page 4-5.
For example, the value for English-United States is "en-US". This combination is also
referred to as a locale.
When you edit the exported XLIFF file you must change the target-language
attribute to the appropriate locale value of your target language. The following table
shows examples of source-language and target-language attribute values appropriate
for the given translations:
Warning: Do not edit or delete the embedded data field tokens or you
will affect the merging of the XML data with the template.
When you initially export the XLIFF file for translation, the source and target elements
are all identical. To create the translation for this template, enter the appropriate
translation for each source element string in its corresponding <target> element.
Therefore if you were translating the sample template into German, you would enter
the following for the Total string:
<source>Total</source>
<target>Gesamtbetrag</target>
The following figure shows the sample XLIFF file from the previous figure updated with
the Chinese translation:
For Chinese (China), Chinese (Taiwan), and Portuguese (Brazil) you must use the
language code and territory code in the translated file name as follows:
ReportName_zh_CN.xlf
Administration
The Administration interface allows you to set up the following:
• Data Sources
• Security for Users and Roles
• Delivery Options
This chapter covers these topics as well as:
• Setting up the server configuration file
• Integrating with LDAP
• Setting up Oracle Single Sign-On
Administration 5-1
• User Name - enter the user name required to access the data source on the
database.
• Password - enter the password associated with the user name for access to the
data source on the database.
• Database Driver Class - enter the database driver class for the connection.
For example: oracle.jdbc.driver.OracleDriver or com.microsoft.
jdbc.sqlserver.SQLServerDriver
Important: The JDBC connection library must be placed under
[JRE_TOP]/lib. If you are using OC4J, the Oracle driver library
will be present with your OC4J install. For other JDBC database
libraries you must place them there manually, and bounce the
server to make them available.
4. If you would like to test the connection, select Test Connection. If the test is
successful, the confirmation message, "Connection established successfully" will
display. If connection error occurs, the message "Could not establish connection,"
will display.
5. Select Apply.
Administration 5-3
Role Privileges
Add a User:
1. From the Security Center, select Users. This will invoke the Security Center Users
page. Here you can see the list of existing users.
2. Select Create User.
3. Add the User Name and Password for the user.
4. Select Apply.
Update a User:
1. From the Security Center, select Users. This will invoke the Security Center Users
page. Here you can see the list of existing users.
Create a Role:
1. From the Security Center, select Roles and Permissions; this will invoke the
Security Center page. Here you can see the list of existing roles and permissions.
2. Select Create Role.
3. Enter a Role Name and Description and select Apply.
Administration 5-5
In the XML Publisher security center module, assign folders to those roles. When a
user logs into the server they will have access to those folders and reports assigned
to the LDAP roles.
To set up the XML Publisher server with Oracle LDAP you’ll need to carry out the
following steps: Using the Enterprise Security Manager login to your LDAP server:
2. Create Roles.
Navigate to the Enterprise Roles node under the OracleDefaultDomain node.
A sample Enterprise Security Manager screen is shown in the following figure:
Administration 5-7
4. Create other functional roles as required by your implementation, for example: HR
Manager, Warehouse Clerk, or Sales Manager.
The following figure shows an example Enterprise Security Manager screen with
multiple roles defined:
Administration 5-9
• Select the user(s) you wish to add to the role and select OK.
This action will close the dialog. Select Apply on the main form to save your
changes.
Now if you expand the Users node under the role, the new users will appear.
For example:
<property name="LDAP_PROVIDER_URL" value="ldap://ldap.server.com:
389/"/>
<property name="LDAP_PROVIDER_ADMIN_USERNAME" value="orcladmin"/>
<property name="LDAP_PROVIDER_ADMIN_PASSWORD" value="welcome"/>
<property name="LDAP_PROVIDER_USER_DN" value="cn=Users,dc=server,d
c=com"/>
3. Select Add Folders to add folders to a particular role using the tree shuttle.
Users can now log in using their LDAP username/password and will have access to
reports in the folders assigned to their roles set up in LDAP.
Administration 5-11
• Filter - enables you to call a conversion utility to convert PDF to Postscript or
PDF to TIFF (for fax) for Windows-based print servers. To specify the filter, pass
the native OS command string with the 2 placeholders for the input and output
filename, {infile} and {outfile}.
This is useful especially if you are trying to call IPP printers directly or IPP
printers on Microsoft Internet Information Service (IIS). Unlike CUPS, those
print servers do not translate the print file to a format the printer can
understand, therefore only limited document formats are supported. With the
filter functionality, you can call any of the native OS commands to transform the
document to the format that the target printer can understand.
For example, to transform a PDF document to a Postscript format, enter the
following PDF to PS command in the Filter field:
pdftops {infile} {outfile}
To call an HP LaserJet printer setup on a Microsoft IIS from Linux, you can
set Ghostscript as a filter to transform the PDF document into the format that
the HP LaserJet can understand. To do this, enter the following Ghostscript
command in the Filter field:
gs -q -dNOPAUSE -dBATCH -sDEVICE=laserjet -sOutputFile={outfile}
{infile}
For fax servers, you can use the filter to transform the file to Tag Image File
Format (TIFF).
Note that this functionality works only if the Buffering Mode is "True" and a
valid Temporary Directory is specified. See Delivery Configuration Options,
page 5-11.
• Security fields: Username and Password required. Authentication Type
(None, Basic, Digest) and Encryption Type (None, SSL).
• Proxy Server fields: Host, Port, User Name, Password, Authentication Type
(None, Basic, Digest)
Note: XML Publisher also uses another configuration file (xdo.cfg) to set
runtime behaviors. For information about this file see Setting Runtime
Properties, page 10-1.
XML Header
The header consists of the XML declaration and the root element with the namespace
attribute:
<?xml version="1.0" encoding="UTF-8"?>
<xmlpConfig xmlns="http://xmlns.oracle.com/oxp/xmlp">
Administration 5-13
Resource Section
Define the location of your repository in the resource section. The resource section is
mandatory. The resource elements are enclosed within <resource> </resource>
tags.
Within the <resource> tags you must define either the <file> element or the <xdb>
element to specify the path to your reports repository.
The <le> Element
If your reports repository exists on your file system, declare the absolute file path using
the file element with its path attribute as follows:
<file path=""/>
Example: <file path="d:/reports"/>
The <xdb> element
If your reports repository is set up on your database, declare the absolute path using the
xdb element with its path attribute as follows:
<xdb path="">
Example: <xdb path="/public/Reports">
The xdb element requires the <connection> element. Within the <connection>
</connection> tags, define the <connectionType>. Valid values for
<connectionType> are "jdbc" or "jndi".
jdbc connectionType
If the <connectionType> is jdbc, the following elements are required:
<url>
<username>
<password>
<driver>
Example:
<resource>
<xdb path="/public/Reports">
<connection>
<connectionType>jdbc</connectionType>
<url>jdbc:oracle:thin:@rpts.mycompany.com:1525:ora10g</url>
<username>scott</username>
<password>tiger</password>
<driver>oracle.jdbc.driver.oracleDriver</driver>
</connection>
</xdb>
</resource>
jndi connectionType
If the connection type is "jndi", the following element is required:
<jndiName>
Example:
Scheduler Section
Define the location of the scheduler server within the <scheduler></scheduler>
tags. The scheduler section is mandatory. The scheduler section requires the
<connection> element. Within the <connection> </connection> tags, define the
<connectionType>. Valid values for <connectionType> are "jdbc" or "jndi". These
are defined in the same way as for the <xdb> element in the <resource> section.
Example of jdbc connectionType:
<scheduler>
<connection>
<connectionType>jdbc</connectionType>
<url>jdbc:oracle:thin:@rpts.mycompany.com:1525:ora10g</url>
<username>scott</username>
<password>tiger</password>
<driver>oracle.jdbc.driver.OracleDriver</driver>
</connection>
</scheduler>
General Properties
The following table lists the general properties that can be specified in the configuration
file. Specify the properties according to the following syntax:
<property name = "PROPERTY_NAME" value="value"/>
Example:
<property name = "CACHE_EXPIRATION" value="120"/>
The properties listed here are not required. If not specified, the default value will be
used. The following table lists the name, valid values, default value, and description of
each property.
Administration 5-15
Property Name Values Description
OUTPUT_FORMAT html, pdf, rtf, excel, xml The output types specified in
this property will be displayed
to the user by default for every
report (PDF templates will still
only allow PDF output). Enter
each output type separated
by a comma. Valid values
are: html, pdf, rtf, excel, xml.
This value is overridden by the
Output Format types selected in
the report definition. See Create
a New Report, page 3-1.
The following properties must be specified if you are using an LDAP server with XML
Publisher Enterprise. For more information about LDAP integration, see Integrating
with LDAP, page 5-5.
In addition to the preceding properties, the following property must be specified if you
are using Oracle Single Sign-On with XML Publisher Enterprise. For more information
about setting up Single Sign-On, see Setting Up Oracle Single Sign-On, page 5-18.
Administration 5-17
Property Name Values Description
<scheduler>
<connection>
<connectionType>jdbc</connectionType>
<url>jdbc:oracle:thin:@rpts.mycompany.com:1525:ora10g</url>
<username>admin</username>
<password>welcome</password>
<driver>oracle.jdbc.driver.OracleDriver</driver>
</connection>
</scheduler>
Set Up Procedure
1. Navigate to the SSO Server home page. Select SSO Server Administration.
2. From the SSO Server Administration page, select Administer Partner Applications.
3. From the Administer Partner Applications page, select Add Partner Application.
4. On the Create Partner Application page, enter the following and select OK:
• Name : xmlpserver
• Home URL : http://<xmlpserver host>:<xmlpserver port>/xmlpserver
• Success URL : http://<xmlpserver host>:<xmlpserver port>/xmlpserver/login.jsp
• Logout URL : http://<xmlpserver host>:<xmlpserver port>/xmlpserver/signout.jsp
The following figure shows a sample Create Partner Application page:
Administration 5-19
5. If the process was successful, you will see the entry "xmlpserver" on the Administer
Partner Applications page. Select the Edit icon
6. From the Edit Partner Application page, note the value of Single Sign-Off URL.
The following figure shows a sample Edit Partner Application page:
</IfModule>
Administration 5-21
<?xml version="1.0" encoding="UTF-8"?>
<xmlpConfig xmlns="http://xmlns.oracle.com/oxp/xmlp">
:
:
<property name="SINGLE_SIGN_OFF_URL" value="http://server1.mycompa
ny.com:7777/pls/orasso/orasso.wwsso_app_admin.ls_logout"/>
</xmlpConfig>
For more information about the xmlpserver config file, see Setting Up the Server
Configuration File, page 5-13.
9. Restart the server:
% opmnctl stopall
% opmnctl startall
10. Access the XML Publisher Enterprise application, and you will be redirected to
the SSO login page.
A sample SSO login page is shown in the following figure:
Introduction
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.
XML Publisher’s RTF Template Parser converts documents saved as the RTF file type
to XSL-FO. 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.
During design time, you add data fields and other markup to your template using XML
Publisher’s simplified tags for XSL expressions. These tags associate the XML report data
to your report layout. If you are familiar with XSL and prefer not to use the simplified
tags, XML Publisher also supports the use of pure XSL elements in the template.
In addition to your word processing application’s formatting features, XML Publisher
supports other advanced reporting features such as conditional formatting, dynamic
data columns, running totals, and charts.
If you wish to include code directly in your template, you can include any XSL
element, many FO elements, and a set of SQL expressions extended by XML Publisher.
Supported Modes
XML Publisher supports two methods for creating RTF templates:
• Basic RTF Method
Use any word processing application that supports RTF version 1.6 writer (or later)
to design a template using XML Publisher’s simplified syntax.
• Form Field Method
Using Microsoft Word’s form field feature allows you to place the syntax in hidden
form fields, rather than directly into the design of your template. XML Publisher
supports Microsoft Word 2000 (or later) with Microsoft Windows version 2000 (or
later).
Note: If you use XSL or XSL:FO code rather than the simplified
syntax, you must use the form field method.
This guide describes how to create RTF templates using both methods.
Overview
Creating an RTF template file consists of two basic steps:
1. Design your template layout.
Use the formatting features of your word processing application and save the file as
RTF.
2. Mark up your template layout.
Insert the XML Publisher simplified tags.
When you design your template layout, you must understand how to associate the XML
input file to the layout. This chapter presents a sample template layout with its input
XML file to illustrate how to make the proper associations to add the markup tags to
the template.
XML files are composed of elements. Each tag set is an element. For example
<INVOICE_DATE> </INVOICE_DATE> is the invoice date element. "INVOICE_DATE"
is the tag name. The data between the tags is the value of the element. For example, the
value of INVOICE_DATE is "10-NOV-03".
The elements of the XML file have a hierarchical structure. Another way of saying this is
that the elements have parent-child relationships. In the XML sample, some elements
are contained within the tags of another element. The containing element is the parent
and the included elements are its children.
Every XML file has only one root element that contains all the other
elements. In this example, VENDOR_REPORT is the root element. The elements
LIST_G_VENDOR_NAME, ACCTD_SUM_REP, and ENT_SUM_REP are contained
between the VENDOR_REPORT tags and are children of VENDOR_REPORT. Each child
element can have child elements of its own.
Creating Placeholders
The placeholder maps the template field to the XML element data field. At runtime the
placeholder is replaced by the value of the element of the same name in the XML data file.
Enter placeholders in your document using the following syntax:
<?XML element tag name?>
Note: The placeholder must match the XML element tag name exactly. It
is case sensitive.
The following figure shows the Payables Invoice Register with the completed form
field placeholder markup.
See the Payables Invoice Register with Completed Basic RTF Markup, page 6-10 for the
completed basic RTF markup.
Dening Groups
By defining a group, you are notifying XML Publisher that for each occurrence of an
element, you want the included fields displayed. At runtime, XML Publisher will loop
through the occurrences of the element and display the fields each time.
In the example, for each occurrence of G_VENDOR_NAME in the XML file, we
want the template to display its child elements VENDOR_NAME (Supplier
Name), G_INVOICE_NUM (the Invoices group), Total Entered Amount, and Total
Accounted Amount. And, for each occurrence of G_INVOICE_NUM (Invoices
Grouping scenarios
Note that the group element must be a parent of the repeating elements in the XML
input file.
• If you insert the grouping tags around text or formatting elements, the text and
formatting elements between the group tags will be repeated.
• If you insert the tags around a table, the table will be repeated.
• If you insert the tags around text in a table cell, the text in the table cell between
the tags will be repeated.
• If you insert the tags around two different table cells, but in the same table row, the
single row will be repeated.
• If you insert the tags around two different table rows, the rows between the tags will
be repeated (this does not include the row that contains the "end group" tag).
Native Support
XML Publisher supports the use of the native RTF header and footer feature. To create a
header or footer, use the your word processing application’s header and footer insertion
tools. As an alternative, or if you have multiple headers and footers, you can use
start:body and end body tags to distinguish the header and footer regions from
the body of your report.
Different First Page and Different Odd and Even Page Support
If your report requires a different header and footer on the first page of your report; or, if
your report requires different headers and footers for odd and even pages, you can
define this behavior using Microsoft Word’s Page Setup dialog.
1. Select Page Setup from the File menu.
2. In the Page Setup dialog, select the Layout tab.
3. In the Headers and footers region of the dialog, select the appropriate check box:
Different odd and even
Different first page
4. Insert your headers and footers into your template as desired.
At runtime your generated report will exhibit the defined header and footer behavior.
Images
XML Publisher supports several methods for including images in your published
document:
Direct Insertion
Insert the jpg, gif, or png image directly in your template.
URL Reference
URL Reference
where
image/jpg is the MIME type of the image (other options might be: image/gif and
image/png)
and
IMAGE_ELEMENT is the element name of the BLOB in your XML data.
or in centimeters:
<fo:instream-foreign-object content type="image/jpg" height="3 cm
" width="4 cm">
...
Chart Support
XML Publisher leverages the graph capabilities of Oracle Business Intelligence Beans
(BI Beans) to enable you to define charts and graphs in your RTF templates that will
be populated with data at runtime. XML Publisher supports all the graph types and
component attributes available from the BI Beans graph DTD.
The BI Beans graph DTD is fully documented in the following technical
note available from the Oracle Technology Network [http://www.oracle.com/
technology/index.html] (OTN): "DTD for Customizing Graphs in Oracle Reports
[http://www.oracle.com/technology/products/reports/htdocs/getstart/whitepapers/
graphdtd/graph_dtd_technote_2.html ]."
The following summarizes the steps to add a chart to your template. These steps will be
discussed in detail in the example that follows:
1. Insert a dummy image in your template to define the size and position of your chart.
2. Add the definition for the chart to the Alternative text box of the dummy image. The
chart definition requires XSL commands.
3. At runtime XML Publisher calls the BI Beans applications to render the image that is
then inserted into the final output document.
This example will show how to insert a chart into your template to display it as a vertical
bar chart as shown in the following figure:
The first element of your chart text must be the chart: element to inform the RTF
parser that the following code describes a chart object.
Next is the opening <Graph> tag. Note that the whole of the code resides within
the tags of the <Graph> element. This element has an attribute to define the chart
type: graphType. If this attribute is not declared, the default chart is a vertical bar
chart. BI Beans supports many different chart types. Several more types are presented in
this section. For a complete listing, see the BI Beans graph DTD documentation.
The following code section defines the chart type and attributes:
<Title text="Company Sales 2004" visible="true" horizontalAlignme
nt="CENTER"/>
<Y1Title text="Sales in Thousands" visible="true"/>
<O1Title text="Division" visible="true"/>
All of these values can be declared or you can substitute values from the XML data at
runtime. For example, you can retrieve the chart title from an XML tag by using the
following syntax:
<Title text="{CHARTTITLE}" visible="true" horizontalAlighment="CE
NTER"/>
where "CHARTTITLE" is the XML tag name that contains the chart title. Note that
the tag name is enclosed in curly braces.
The next section defines the column and row labels:
The LocalGridData element has two attributes: colCount and rowCount. These
define the number of columns and rows that will be shown at runtime. In this example, a
count function calculates the number of columns to render:
colCount="{count(//division)}"
The rowCount has been hard-coded to 1. This value defines the number of sets of data
to be charted. In this case it is 1.
Next the code defines the row and column labels. These can be declared, or a value
from the XML data can be substituted at runtime. The row label will be used in the
chart legend (that is, "Total Sales $1000s").
The column labels for this example are derived from the data: Groceries, Toys, Cars, and
so on. This is done using a for-each loop:
<ColLabels>
<xsl:for-each select="//division">
<Label>
<xsl:value-of select="name"/>
</Label>
</xsl:for-each>
</ColLabels>
This code loops through the <division> group and inserts the value of the <name>
element into the <Label> tag. At runtime, this will generate the following XML:
<ColLabels>
<Label>Groceries</Label>
<Label>Toys</Label>
<Label>Cars</Label>
<Label>Hardware</Label>
<Label>Electronics</Label>
</ColLabels>
Similar to the labels section, the code loops through the data to build the XML that is
passed to the BI Beans rendering engine. This will generate the following XML:
<DataValues>
<RowData>
<Cell>3810</Cell>
<Cell>2432</Cell>
<Cell>6753</Cell>
<Cell>2543</Cell>
<Cell>5965</Cell>
</RowData>
</DataValues>
The following is the code added to the template to render this chart at runtime:
To accommodate the second set of data, the rowCount attribute for the LocalGridData
element is set to 2. Also note the DataValues section defines two sets of data: one
for Total Sales and one for Cost of Sales.
The colors for the bars are defined in the SeriesItems section. The colors are defined
in hexadecimal format as follows:
The MarkerText tag places the data values on the chart bars:
<MarkerText visible="true" markerTextPlace="MTP_CENTER"/>
The PlotArea section defines the background. The SFX element establishes the gradient
and the borderTransparent attribute hides the plot border:
<PlotArea borderTransparent="true">
<SFX fillType="FT_GRADIENT" gradientDirection="GD_LEFT"
gradientNumPins="300">
<GradientPinStyle pinIndex="1" position="1"
gradientPinLeftColor="#999999"
gradientPinRightColor="#cc6600"/>
</SFX>
</PlotArea>
The Title text tag has also been updated to specify a new font type and size:
<Title text="Company Sales 2004" visible="true">
<GraphFont name="Tahoma" bold="false"/>
</Title>
Freehand Drawing
Use the freehand drawing tool in Microsoft Word to create drawings in your template
to be rendered in the final PDF output.
Layering
You can layer shapes on top of each other and use the transparency setting in Microsoft
Word to allows shapes on lower layers to show through. The following graphic shows
an example of layered shapes:
3-D Effects
XML Publisher does not currently support the 3-D option for shapes.
Microsoft Equation
Use the equation editor to generate equations in your output. The following figure
shows an example of an equation:
Organization Chart
Use the organization chart functionality in your templates and the chart will be rendered
in the output. The following image shows an example of an organization chart:
Replicate a Shape
You can replicate a shape based on incoming XML data in the same way you replicate
data elements in a for-each loop. To do this, use a for-each@shape command in
conjunction with a shape-offset declaration. For example, to replicate a shape down the
page, use the following syntax:
<?for-each@shape:SHAPE_GROUP?>
<?shape-offset-y:(position()-1)*100?>
<?end for-each?>
where
for-each@shape opens the for-each loop for the shape context
SHAPE_GROUP is the name of the repeating element from the XML file. For each
occurrence of the element SHAPE_GROUP a new shape will be created.
shape-offset-y: - is the command to offset the shape along the y-axis.
(position()-1)*100) - sets the offset in pixels per occurrence. The XSL position
command returns the record counter in the group (that is 1,2,3,4); one is subtracted
from that number and the result is multiplied by 100. Therefore for the first occurrence
the offset would be 0: (1-1) * 100. The offset for the second occurrence would be 100
pixels: (2-1) *100. And for each subsequent occurrence the offset would be another
100 pixels down the page.
where SHAPETEXT is the element name in the XML data. At runtime the text will be
inserted into the shape.
where SHAPETEXT is the element from the XML data. At runtime the value of the
element SHAPETEXT will be inserted above and along the line.
Moving a Shape
You can move a shape or transpose it along both the x and y-axes based on the XML
data. For example to move a shape 200 pixels along the y-axis and 300 along the
x-axis, enter the following commands in the property dialog of the shape:
<?shape-offset-x:300?>
<?shape-offset-y:200?>
Rotating a Shape
To rotate a shape about a specified axis based on the incoming data, use the following
command:
<?shape-rotate:ANGLE;’POSITION’?>
where
ANGLE is the number of degrees to rotate the shape. If the angle is positive, the rotation
is clockwise; if negative, the rotation is counterclockwise.
POSITION is the point about which to carry out the rotation, for example, ’left/top’.
Valid values are combinations of left, right, or center with center, top, or bottom. The
default is left/top. The following figure shows these valid values:
You can also specify an x,y coordinate within the shape itself about which to rotate.
Skewing a Shape
You can skew a shape along its x or y axis using the following commands:
<?shape-skew-x:ANGLE;’POSITION’?>
<?shape-skew-y:ANGLE;’POSITION’?>
where
ANGLE is the number of degrees to skew the shape. If the angle is positive, the skew
is to the right.
POSITION is the point about which to carry out the rotation, for example, ’left/top’.
Valid values are combinations of left, right, or center with center, top, or bottom. See the
figure under Rotating a Shape, page 6-31. The default is ’left/top’.
For example, to skew a shape by 30 degrees about the bottom right hand corner, enter
the following:
<?shape-skew-x:number(.)*30;’right/bottom’?>
where RATIO is the numeric ratio to increase or decrease the size of the shape. Therefore
a value of 2 would generate a shape twice the height and width of the original. A value
of 0.5 would generate a shape half the size of the original.
To change a shape’s size along the x or y axis, use:
Changing only the x or y value has the effect of stretching or shrinking the shape along
an axis. This can be data driven.
Combining Commands
You can also combine these commands to carry out multiple transformations on a shape
at one time. For example, you can replicate a shape and for each replication, rotate it by
some angle and change the size at the same time.
The following example shows how to replicate a shape, move it 50 pixels down the
page, rotate it by five degrees about the center, stretch it along the x-axis and add the
number of the shape as text:
<for-each@shape:SHAPE_GROUP?>
<?shape-text:position()?>
<?shape-offset-y:position()*50?>
<?shape-rotate:5;’center/center’?>
<?shape-size-x:position()+1?>
<end for-each?>
CD Ratings Example
This example demonstrates how to set up a template that will generate a star-rating
based on data from an incoming XML file.
Assume the following incoming XML data:
Notice there is a USER_RATING element for each CD. Using this data element and the
shape manipulation commands, we can create a visual representation of the ratings so
that the reader can compare them at a glance.
A template to achieve this is shown in the following figure:
The values for the fields are shown in the following table:
F <?for-each:CD?>
TITLE <?TITLE?>
ARTIST <?ARTIST?>
E <?end for-each?>
The form fields hold the simple element values. The only difference with this template
is the value for the star shape. The replication command is placed in the Web tab of
the Format AutoShape dialog.
In the for-each@shape command we are using a command to create a "for...next loop"
construct. We specify 1 as the starting number; the value of USER_RATING as the final
number; and 1 as the step value. As the template loops through the CDs, we create an
inner loop to repeat a star shape for every USER_RATING value (that is, a value of 4
will generate 4 stars). The output from this template and the XML sample is shown
in the following graphic:
You can create a visual representation of this data so that users can very quickly
understand the sales data across all regions. Do this by first creating the composite shape
in Microsoft Word that you wish to manipulate. The following figure shows a composite
shape made up of four components:
The shape consists of three cylinders: red, yellow, and blue. These will represent the
data elements software, hardware, and services. The combined object also contains a
rectangle that is enabled to receive text from the incoming data.
The following commands are entered into the Web tab:
Red cylinder: <?shape-size-y:SOFTWARE div 1000;’left/bottom’?>
Yellow cylinder: <?shape-size-y:HARDWARE div 1000;’left/bottom’?>
Blue cylinder: <?shape-size-y:SERVICES div 1000;’left/bottom’?>
The shape-size command is used to stretch or shrink the cylinder based on the values of
the elements SOFTWARE, HARDWARE, and SERVICES. The value is divided by 1000 to
set the stretch or shrink factor. For example, if the value is 2000, divide that by 1000 to
get a factor of 2. The shape will generate as twice its current height.
The text-enabled rectangle contains the following command in its Web tab:
<?shape-text:REGION?>
At runtime the value of the REGION element will appear in the rectangle.
In this set of commands, the for-each@shape loops over the SALE group. The
shape-offset command moves the next shape in the loop to the right by a specific
number of pixels. The expression (position()-1) sets the position of the object. The
position() function returns a record counter while in the loop, so for the first shape, the
offset would be 1-1*100, or 0, which would place the first rendering of the object in the
position defined in the template. Subsequent occurrences would be rendered at a 100
pixel offset along the x-axis (to the right).
At runtime three sets of shapes will be rendered across the page as shown in the
following figure:
To make an even more visually representative report, these shapes can be superimposed
onto a world map. Just use the "Order" dialog in Microsoft Word to layer the map
behind the grouped shapes.
Microsoft Word 2000 Users: After you add the background map and overlay the shape
group, use the Grouping dialog to make the entire composition one group.
Microsoft Word 2002/3 Users: These versions of Word have an option under Tools
> Options, General tab to "Automatically generate drawing canvas when inserting
autoshapes". Using this option removes the need to do the final grouping of the map
and shapes. We can now generate a visually appealing output for our report as seen
in the following figure:
General Features
• Large blocks of text
• Page breaks
To insert a page break, insert a Ctrl-Enter keystroke just before the closing tag of a
group. For example if you want the template to start a new page for every Supplier
in the Payables Invoice Register:
1. Place the cursor just before the Supplier group’s closing <?end for-each?> tag.
2. Press Ctrl-Enter to insert a page break.
At runtime each Supplier will start on a new page.
Using this Microsoft Word native feature will cause a single blank page to print at
the end of your report output. To avoid this single blank page, use XML Publisher’s
page break alias. See Special Features: Page Breaks, page 6-45.
• Page numbering
Insert page numbers into your final report by using the page numbering methods of
your word processing application. For example, if you are using Microsoft Word:
1. From the Insert menu, select Page Numbers...
2. Select the Position, Alignment, and Format as desired.
Alignment
Use your word processor’s alignment features to align text, graphics, objects, and tables.
Note: Bidirectional languages are handled automatically using your
word processing application’s left/right alignment controls.
Tables
Supported table features include:
• Nested Tables
• Cell Alignment
You can align any object in your template using your word processing application’s
alignment tools. This alignment will be reflected in the final report output.
• Row spanning and column spanning
You can span both columns and rows in your template as follows:
1. Select the cells you wish to merge.
2. From the Table menu, select Merge Cells.
3. Align the data within the merged cell as you would normally.
At runtime the cells will appear merged.
• Table Autoformatting
XML Publisher recognizes the table autoformats available in Microsoft Word.
1. Select the table you wish to format.
2. From the Table menu, select Autoformat.
3. Select the desired table format.
At runtime, the table will be formatted using your selection.
• Cell patterns and colors
You can highlight cells or rows of a table with a pattern or color.
1. Select the cell(s) or table.
2. From the Table menu, select Table Properties.
3. From the Table tab, select the Borders and Shading... button.
4. Add borders and shading as desired.
• Repeating table headers
If your data is displayed in a table, and you expect the table to extend across multiple
pages, you can define the header rows that you want to repeat at the start of each
page.
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.
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. 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:
In the template sample shown in the following figure, the field called PageBreak contains
the split-by-page-break syntax:
where pagenumber is the XML element or parameter that holds the numeric value.
Example 1 - Set page number from XML data element
If your XML data contains an element to carry the initial page number, for example:
Your initial page number will be the value of the PAGESTART element, which in this
case is 200.
Example 2 - Set page number by passing a parameter value
If you define a parameter called PAGESTART, you can pass the initial value by calling
the parameter.
Enter the following in your template:
<?initial-page-number:$PAGESTART?>
Note: You must first declare the parameter in your template. See
Defining Parameters in Your Template, page 6-81.
The report should show each VENDOR and their INVOICE data with a SUMMARY
section that appears only on the last page, placed at the bottom of the page. The template
for this is shown in the following figure:
In this example:
• The F and E components contain the for-each grouping statements.
• The grayed report fields are placeholders for the XML elements.
• The "Last Page Placeholder" field contains the syntax:
<?start@last-page:body?> <?end body?>
to declare the last page layout. Any content above or below this statement will
appear on the last page only. The content above the statement is regarded as the
header and the content below the statement is regarded as the footer.
If your reports contains headers and footers that you want to carry over onto the last
page, you must reinsert them on the last page. For more information about headers and
footers see Defining Headers and Footers, page 6-13.
You must insert a section break (type: next page) into the document to specify the last
page layout. This example is available in the samples folder of the Oracle XML Publisher
Template Builder for Word installation.
It is important to note that if the report is only one page in length, the first page layout
will be used. 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.
If you do not have layout requirements for the final page, but would like a blank page
ejected to force the page count to the preferred odd or even, use the following syntax:
<?section:force-page-count;’end-on-even’?>
or
<?section:force-page-count;’end-on-odd’?>
Hyperlinks
XML Publisher supports several different types of hyperlinks. The hyperlinks can be
fixed or dynamic and can link to either internal or external destinations. Hyperlinks can
also be added to shapes.
• To insert static hyperlinks to either text or a shape, use your word processing
application’s insert hyperlink feature:
1. Select the text or shape.
2. Use the right-mouse menu to select Hyperlink; or, select Hyperlink from the
Insert menu.
3. Enter the URL using any of the methods provided on the Insert Hyperlink
dialog box.
The following screenshot shows the insertion of a static hyperlink using Microsoft
Word’s Insert Hyperlink dialog box.
where SERVER_URL and REPORT are parameters passed to the template at runtime
(note the $ sign) and CUSTOMER_ID is an XML data element. This link may render as:
http://myserver.domain:8888/CustomerReport/cstid=1234
Check Boxes
You can include a check box in your template that you can define to display as checked
or unchecked based on a value from the incoming data.
To define a check box in your template:
2. Right-click the field to open the Check Box Form Field Options dialog.
3. Specify the Default value as either Checked or Not Checked.
4. In the Form Field Help Text dialog, enter the criteria for how the box should
behave. This must be a boolean expression (that is, one that returns a true or false
result).
For example, suppose your XML data contains an element called <population>. You
want the check box to appear checked if the value of <population> is greater than
10,000. Enter the following in the help text field:
<?population>10000?>
Notice that each <country> entry has a <continentindex> entry, which is a numeric
value to represent the continent. Using the drop-down form field, you can create an
index in your template that will cross-reference the <continentindex> value to the
actual continent name. You can then display the name in your published report.
To create the index for the continent example:
1. Position the cursor in your template where you want the value from the drop-down
list to display, and select the Drop-Down Form Field from the Forms tool bar (shown
in the following figure).
2. Right-click the field to display the Drop-Down Form Field Options dialog.
3. Add each value to the Drop-down item field and the click Add to add it to the
Items in drop-down list group. The values will be indexed starting from one for the
first, and so on. For example, the list of continents will be stored as follows:
1 Asia
2 North America
3 South America
4 Europe
5 Africa
6 Australia
4. Now use the Help Text box to enter the XML element name that will hold the index
for the drop-down field values.
For this example, enter
<?continentIndex?>
The following figure shows the Drop-Down Form Field Options dialogs for this
example:
Using the check box and drop-down list features, you can create a report to display
population data with check boxes to demonstrate figures that reach a certain limit. An
example is shown in the following figure:
(check box) <?population>1000000?> Establishes the condition for the check box. If the
value for the population element is greater than
1,000,000, the check box will display as checked.
Conditional Formatting
Conditional 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.
The conditional formatting that you specify can be XSL or XSL:FO code, or you can
specify actual RTF objects such as a table or data. For example, you can specify that if
reported numbers reach a certain threshold, they will display shaded in red. Or, you can
use this feature to hide table columns or rows depending on the incoming XML data.
If Statements
Use an if statement to define a simple condition; for example, if a data field is a specific
value.
1. Insert the following syntax to designate the beginning of the conditional area.
<?if:condition?>
2. Insert the following syntax at the end of the conditional area: <?end if?>.
For example, to set up the Payables Invoice Register to display invoices only when the
Supplier name is "Company A", insert the syntax <?if:VENDOR_NAME=’COMPANY
A’?> before the Supplier field on the template.
Enter the <?end if?> tag after the invoices table.
This example is displayed in the figure below. Note that you can insert the syntax in
form fields, or directly into the template.
because XML Publisher applies the instructions to the block by default. To specify that
the if statement should be inserted into the inline sequence, enter the following:
The program was <?if@inlines:SUCCESS=’N’?>not<?end if?>
successful.
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, the following statement tests the AMOUNT element value. If the value
is greater than 1000, show the word "Higher"; if it is less than 1000, show the word
"Lower"; if it is equal to 1000, show "Equal":
<?xdofx:if AMOUNT > 1000 then ’Higher’
else
if AMOUNT < 1000 then ’Lower’
else
’Equal’
end if?>
Choose Statements
Use the choose, when, and otherwise elements to express multiple conditional
tests. If certain conditions are met in the incoming XML data then specific sections of
the template will be rendered. This is a very powerful feature of the RTF template. In
regular XSL programming, if a condition is met in the choose command then further
XSL code is executed. In the template, however, you can actually use visual widgets in
the conditional flow (in the following example, a table).
Use the following syntax for these elements:
<?choose:?>
<?when:expression?>
<?otherwise?>
Default Text Entry in Example Form Field Help Text Entry in Form Field
<Grp:VAT <?for-each:VAT?>
<Choose <?choose?>
Notice the type attribute associated with the items element. In this XML it is marked
as "PUBLIC" meaning the list is a public list rather than a "PRIVATE" list. For the "public"
version of the list we do not want to show the quantity column in the output, but we
want to develop only one template for both versions based on the list type.
The following figure is a simple template that will conditionally show or hide the
quantity column:
The following table shows the entries made in the template for the example:
The conditional column syntax is the "if" statement syntax with the addition of the
@column clause. It is the @column clause that instructs XML Publisher to hide or show
the column based on the outcome of the if statement.
If you did not include the @column the data would not display in your report as a result
of the if statement, but the column still would because you had drawn it in your template.
Note: The @column clause is an example of a context command. For
more information, see Using Context Commands, page 6-110.
The example will render the output shown in the following figure:
If the same XML data contained the type attribute set to "PRIVATE" the following output
would be rendered from the same template:
for-each SALE <?for-each:SALE?> Defines the opening of the for-each loop for
the SALE group.
format; <?if@row:position() mod 2=0?> For each alternate row, the background
<xsl:attribute name="background-color" color attribute is set to gray for the row.
xdofo:ctx="incontext">lightgray</xsl:
attribute><?end if?>
In the preceding example, note the "format;" field. It contains an if statement with a
"row" context (@row). This sets the context of the if statement to apply to the current
row. If the condition is true, then the <xsl:attribute> for the background color of the row
will be set to light gray. This will result in the following output:
Note: For more information about context commands, see Using Context
Commands, page 6-110.
Cell Highlighting
The following example demonstrates how to conditionally highlight a cell based on
a value in the XML file.
For this example we will use the following XML:
The template lists the accounts and their credit and debit values. In the final report we
want to highlight in red any cell whose value is greater than 1000. The template for this
is shown in the following graphic:
The field definitions for the template are shown in the following table:
Default Text Entry Form Field Entry Description
The "if" statement is testing if the debit value is greater than 1000. If it is, then the
next lines are invoked. Notice that the example embeds native XSL code inside the
"if" statement.
The "attribute" element allows you to modify properties in the XSL.
The xdo:ctx component is an XML Publisher feature that allows you to adjust XSL
attributes at any level in the template. In this case, the background color attribute
is changed to red.
To change the color attribute, you can use either the standard HTML names (for
example, red, white, green) or you can use the hexadecimal color definition (for
example, #FFFFF).
The output from this template is displayed in the following figure:
Page-Level Calculations
Because the page total field does not exist in the XML input data, you must define a
variable to hold the value. When you define the variable, you associate it with the
element from the XML file that is to be totaled for the page. Once you define total
fields, you can also perform additional functions on the data in those fields.
To declare the variable that is to hold your page total, insert the following syntax
immediately following the placeholder for the element that is to be totaled:
<?add-page-total:TotalFieldName;’element’?>
where
TotalFieldName is the name you assign to your total (to reference later) and
’element’ is the XML element field to be totaled.
You can add this syntax to as many fields as you want to total.
where
TotalFieldName is the name you assigned to give the page total field above and
Oracle-number-format is the format you wish to use to for the display, using the
Oracle format mask. For the list of Oracle format mask symbols, see Using the Oracle
Format Mask, page 6-100.
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.
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:
The following table shows the form field entries made in the template for the example
table:
Note that on the field defined as "net" we are actually carrying out a calculation on the
values of the credit and debit elements.
Now that you have declared the page total fields, you can insert a field in your template
where you want the page totals to appear. Reference the calculated fields using the
names you supplied (in the example, ct and dt). The syntax to display the page totals
is as follows:
For example, to display the debit page total, enter the following:
<?show-page-total:dt;’C9G990D00’;’(C9G990D00)’?>
Therefore to complete the example, place the following at the bottom of the template
page, or in the footer:
Page Total Debit: <?show-page-total:dt;’C9G990D00’;’(C9G990D00)’?>
Page Total Credit: <?show-page-total:ct;’C9G990D00’;’(C9G990D00)’?>
Page Total Balance: <?show-page-total:net;’C9G990D00’;’(C9G990D00)’?>
The output for this report is shown in the following graphic:
At the end of the first page, the page total for the Amount element is displayed as the
Carried Forward total. At the top of the second page, this value is displayed as the
Brought Forward total from the previous page. At the bottom of the second page, the
brought forward value plus the total for that page is calculated and displayed as the new
Carried Forward value, and this continues throughout the report.
This functionality is an extension of the Page Totals, page 6-66 feature. The following
example walks through the syntax and setup required to display the brought forward
and carried forward totals in your published report.
Assume you have the following XML:
The following sample template creates the invoice table and declares a placeholder
that will hold your page total:
To display the brought forward total at the top of each page (except the first), use the
following syntax:
The following table describes the elements comprising the brought forward syntax:
Code Element Description and Usage
Brought Forward: This string is optional and will display as the field name on the report.
show-brought-forward Shows the value on the page. It has the following two properties:
• name - the name of the field to show. In this case, "InvAmt". This
property is mandatory.
Insert the brought forward object at the top of the template where you want the brought
forward total to display. If you place it in the body of the template, you can insert the
syntax in a form field.
If you want the brought forward total to display in the header, you must insert the
full code string into the header because Microsoft Word does not support form fields
in the header or footer regions. However, you can alternatively use the start body/end
body syntax which allows you to define what the body area of the report will be. XML
Publisher will recognize any content above the defined body area as header content, and
any content below as the footer. This allows you to use form fields. See Multiple or
Complex Headers and Footers, page 6-13 for details.
Place the carried forward object at the bottom of your template where you want the total
to display. The carried forward object for our example is as follows:
Running Totals
Example
The variable functionality (see Using Variables, page 6-81) can be used to add a running
total to your invoice listing report. This example assumes the following XML structure:
<?xml version="1.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>
Using this XML, we want to create the report that contains running totals as shown
in the following figure:
The values for the form fields in the template are shown in the following table:
Form Field Syntax Description
Data Handling
Sorting
You can sort a group by any element within the group. Insert the following syntax
within the group tags:
<?sort:element name?>
For example, to sort the Payables Invoice Register (shown at the beginning
of this chapter) by Supplier (VENDOR_NAME), enter the following after the
<?for-each:G_VENDOR_NAME?> tag:
<?sort:VENDOR_NAME?>
To sort a group by multiple fields, just insert the sort syntax after the primary sort
field. To sort by Supplier and then by Invoice Number, enter the following
<?sort:VENDOR_NAME?> <?sort:INVOICE_NUM?>
XML Sample
To demonstrate the for-each-group standard, the following XML data sample of a CD
catalog listing will be regrouped in a template:
Using the regrouping syntax, you can create a report of this data that groups the CDs by
country and then by year. You are not limited by the data structure presented.
Regrouping Syntax
To regroup the data, use the following syntax:
<?for-each-group: BASE-GROUP;GROUPING-ELEMENT?>
For example, to regroup the CD listing by COUNTRY, enter the following in your
template:
<?for-each-group:CD;COUNTRY?>
The elements that were at the same hierarchy level as COUNTRY are now children of
COUNTRY. You can then refer to the elements of the group to display the values desired.
To establish nested groupings within the already defined group, use the following syntax:
<?for-each:current-group(); GROUPING-ELEMENT?>
For example, after declaring the CD grouping by COUNTRY, you can then further group
by YEAR within COUNTRY as follows:
<?for-each:current-group();YEAR?>
At runtime, XML Publisher will loop through the occurrences of the new
groupings, displaying the fields that you defined in your template.
Template Example
The following figure shows a template that displays the CDs by Country, then Year, and
lists the details for each CD:
The following table shows the XML Publisher syntax entries made in the form fields of
the preceding template:
This template produces the following output when merged with the XML file:
You want to display this data in a format showing temperature ranges and a count of the
months that have an average temperature to satisfy those ranges, as follows:
The following table shows the form field entries made in the template:
Default Text Entry Form Field Help Text Entry
Months <?count(current-group())?>
Using Variables
Updateable variables differ from standard XSL variables <xsl:variable> in that they are
updateable during the template application to the XML data. This allows you to create
many new features in your templates that require updateable variables.
The variables use a "set and get" approach for assigning, updating, and retrieving values.
Use the following syntax to declare/set a variable value:
<?xdoxslt:set_variable($_XDOCTX, ’variable name’, value)?>
This sets the value of variable ’x’ to its original value plus 1, much like using "x = x
+ 1".
The $_XDOCTX specifies the global document context for the variables. In a
multi-threaded environment there may be many transformations occurring at the same
time, therefore the variable must be assigned to a single transformation.
See the section on Running Totals, page 6-72 for an example of the usage of updateable
variables.
Dening Parameters
You can pass runtime parameter values into your template. These can then be referenced
throughout the template to support many functions. For example, you can filter data in
the template, use a value in a conditional formatting block, or pass property values (such
as security settings) into the final document.
Note: For XML Publisher Enterprise users, all name-value parameter
pairs are passed to the template. You must register the parameters that
you wish to utilize in your template using the syntax described below.
The following figure displays a template that accepts a parameter value to limit the
invoices displayed in the final document based on the parameter value.
In this template, only INVOICE elements with an AMOUNT greater than the InvThresh
parameter value will be displayed. If we pass in a parameter value of 1,000, the following
output shown in the following figure will result:
Notice the second invoice does not display because its amount was less than the
parameter value.
Setting Properties
XML Publisher properties that are available in the XML Publisher Configuration file can
alternatively be embedded into the RTF template. The properties set in the template are
resolved at runtime by the XML Publisher engine. You can either hard code the values in
the template or embed the values in the incoming XML data. Embedding the properties
in the template avoids the use of the configuration file.
Note: See XML Publisher Configuration File, page 10-1 for more
information about the XML Publisher Configuration file and the
available properties.
For example, if you use a nonstandard font in your template, rather than specify the font
location in the configuration file, you can embed the font property inside the template. If
you need to secure the generated PDF output, 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 Microsoft Word Properties
dialog (available from the File menu), and enter the following information:
Name - enter the XML Publisher property name prefixed with "xdo-"
Type - select "Text"
In the Properties dialog set two properties: pdf-security to set the security feature
as enabled or not, and pdf-open-password to set the password. Enter the following
in the Properties dialog:
Name: xdo-pdf-security
Type: Text
Value: {/PO/security}
Name: xdo-pdf-open-password
Type: Text
Value: {/PO/password}
Storing the password in the XML data is not recommended if the XML will persist in
the system for any length of time. To avoid this potential security risk, you can use a
template parameter value that is generated and passed into the template at runtime.
For example, you could set up the following parameters:
• PDFSec - to pass the value for the xdo-pdf-security property
• PDFPWD - to pass the value for the password
You would then enter the following in the Properties dialog:
Name: xdo-pdf-security
Type: Text
Value: {$PDFSec}
Name: xdo-pdf-open-password
Type: Text
Value: {$PDFPWD}
For more information about template parameters, see Defining Parameters in Your
Template, page 6-81.
Batch Reports
It is a common requirement to print a batch of documents, such as invoices or purchase
orders in a single PDF file. Because these documents are intended for different
customers, each document will require that the page numbering be reset and that page
Now for each new occurrence of the G_INVOICE element, a new section will begin. The
page numbers will restart, and if header or footer information is derived from the data, it
will be reset as well.
Cross-Tab Support
The columns of a cross-tab report are data dependent. At design-time you do not know
how many columns will be reported, or what the appropriate column headings will
be. Moreover, if the columns should break onto a second page, you need to be able to
define the row label columns to repeat onto subsequent pages. The following example
shows how to design a simple cross-tab report that supports these features.
This example uses the following XML sample:
</ROWSET>
From this XML we will generate a report that shows each industry and totals the sales
by year as shown in the following figure:
header column <?horizontal-break-table:1?> Defines the first column as a header that should repeat
if the table breaks across pages. For more information
about this syntax, see Defining Columns to Repeat
Across Pages, page 6-90.
for: <?for-each-group@column: Uses the regrouping syntax (see Regrouping the XML
RESULTS;YEAR?> Data, page 6-74) to group the data by YEAR; and the
@column context command to create a table column
for each group (YEAR). For more information about
context commands, see Using the Context Commands,
page 6-110.
for: <?for-each-group:RESULTS; Begins the group to create a table row for each
INDUSTRY?> INDUSTRY.
for: <?for-each-group@cell:current- Uses the regrouping syntax (see Regrouping the XML
group();YEAR?> Data, page 6-74) to group the data by YEAR; and the
@cell context command to create a table cell for each
group (YEAR).
sum(Sales) <?sum(current-group()// Sums the sales for the current group (YEAR).
SALES)
Note that only the first row uses the @column context to determine the number of
columns for the table. All remaining rows need to use the @cell context to create the
table cells for the column. (For more information about context commands, see Using the
Context Commands, page 6-110.)
but you do not know how many Test Score Ranges will be reported. The number of Test
Score Range columns is dynamic, depending on the data.
The following XML data describes these test scores. The number of occurrences of the
element <TestScoreRange> will determine how many columns are required. In this
case there are five columns: 0-20, 21-40, 41-60, 61-80, and 81-100. For each column there
is an amount element (<NumOfStudents>) and a column width attribute (<TestScore
width="15">).
<?xml version="1.0" encoding="utf-8"?>
<TestScoreTable>
<TestScores>
<TestCategory>Mathematics</TestCategory>
<TestScore width ="15">
<TestScoreRange>0-20</TestScoreRange>
<NumofStudents>30</NumofStudents>
</TestScore>
<TestScore width ="20">
<TestScoreRange>21-40</TestScoreRange>
<NumofStudents>45</NumofStudents>
</TestScore>
<TestScore width ="15">
<TestScoreRange>41-60</TestScoreRange>
<NumofStudents>50</NumofStudents>
</TestScore>
<TestScore width ="20">
<TestScoreRange>61-80</TestScoreRange>
<NumofStudents>102</NumofStudents>
</TestScore>
<TestScore width ="15">
<TestScoreRange>81-100</TestScoreRange>
<NumofStudents>22</NumofStudents>
</TestScore>
</TestScores>
<TestScoreTable>
Using the dynamic column tags in form fields, set up the table in two columns as
shown in the following figure. The first column, "Test Score" is static. The second
column, "Column Header and Splitting" is the dynamic column. At runtime this column
will split according to the data, and the header for each column will be appropriately
populated. The Default Text entry and Form Field Help entry for each field are listed in
Group:TestScores <?for-each:TestScores?>
The template will render the output shown in the following figure:
Number Formatting
XML Publisher supports two methods for specifying the number format:
• 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. See: Native XSL Number Formatting, page 6-113.
Use only one of these methods. If the number format mask is specified using both
methods, the data will be formatted twice, causing unexpected behavior.
The group separator and the number separator will be set at runtime based on the
template locale. This is applicable for both the Oracle format mask and the MS format
mask.
Translation Considerations
If you are designing a template to be translatable, using currency in the Microsoft format
mask is not recommended unless you want the data reported in the same currency for
all translations. Using the MS format mask sets the currency in the template so that it
cannot be updated at runtime.
Instead, use the Oracle format mask. For example, L999G999G999D99, where "L" will be
replaced by the currency symbol based on the locale at runtime.
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, depending on the locale.
0 Number Digit. Each explicitly set 0 will appear, if no other number occupies
the position.
Example:
Format mask: 00.0000
Data: 1.234
Display: 01.2340
; Subpattern boundary Separates positive and negative subpatterns. See Note below.
The following table lists the supported Oracle number format mask symbols and their
definitions:
0 Digit. Each explicitly set 0 will appear, if no other number occupies the position.
Example:
Format mask: 00.0000
Data: 1.234
Display: 01.2340
9 Digit. Returns value with the specified number of digits with a leading space if positive or a
leading minus if negative. Leading zeros are blank, except for a zero value, which returns a
zero for the integer part of the fixed-point number.
Example:
Format mask: 99.9999
Data: 1.234
Display: 1.234
D Determines the placement of the decimal separator. The decimal separator symbol used will
be determined at runtime based on template locale.
For example:
Format mask: 9G999D99
Data: 1234.56
Display for English locale: 1,234.56
Display for German locale: 1.234,56
G Determines the placement of the grouping (thousands) separator. The grouping separator
symbol used will be determined at runtime based on template locale.
For example:
Format mask: 9G999D99
Data: 1234.56
Display for English locale: 1,234.56
Display for German locale: 1.234,56
S (before number) Displays positive value with a leading "+" and negative values with a leading "-"
S (after number) Displays positive value with a trailing "+" and negative value with a trailing "-"
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.
Translation Considerations
If you are designing a template to be translatable, explicitly setting a date format mask
is not recommended. This is because the date format mask is part of the template, and
all published reports based on this template will have the same date format regardless
of locale.
For translatable templates, it is recommended that you use the Oracle abstract date
format.
If it is necessary to explicitly specify a format mask, the Oracle format mask is
recommended over the MS format mask to ensure future compatibility.
The following table lists the supported Microsoft date format mask components:
Symbol Meaning
d The day of the month. Single-digit days will not have a leading zero.
dd The day of the month. Single-digit days will have a leading zero.
ddd The abbreviated name of the day of the week, as defined in AbbreviatedDayNames.
dddd The full name of the day of the week, as defined in DayNames.
M The numeric month. Single-digit months will not have a leading zero.
yy The year without the century. If the year without the century is less than 10, the year is
displayed with a leading zero.
yyyy The year in four digits.
gg The period or era. This pattern is ignored if the date to be formatted does not have an
associated period or era string.
h The hour in a 12-hour clock. Single-digit hours will not have a leading zero.
hh The hour in a 12-hour clock. Single-digit hours will have a leading zero.
H The hour in a 24-hour clock. Single-digit hours will not have a leading zero.
HH The hour in a 24-hour clock. Single-digit hours will have a leading zero.
zz Displays the time zone offset for the system’s current time zone in whole hours
only. (This element can be used for formatting only)
zzz Displays the time zone offset for the system’s current time zone in hours and minutes.
’ Quoted string. Displays the literal value of any string between two ‘ characters.
" Quoted string. Displays the literal value of any string between two “ characters.
FF[1..9] Fractional seconds. Use the numbers 1 to 9 after FF to specify the number of digits in the
fractional second portion of the datetime value returned.
Example:
’HH:MI:SS.FF3’
MI Minute (0-59).
RR Lets you store 20th century dates in the 21st century using only two digits.
RRRR Round year. Accepts either 4-digit or 2-digit input. If 2-digit, provides the same return as
RR. If you don’t want this functionality, then simply enter the 4-digit year.
SS Seconds (0-59).
TZD Daylight savings information. The TZD value is an abbreviated time zone string with daylight
savings information. It must correspond to the region specified in TZR.
Example:
PST (for Pacific Standard Time)
PDT (for Pacific Daylight Time)
TZR Time zone region information. The value must be one of the time zone regions supported in
the database. Example: PST (Pacific Standard Time)
WW Week of year (1-53) where week 1 starts on the first day of the year and continues to the
seventh day of the year.
W Week of month (1-5) where week 1 starts on the first day of the month and ends on the seventh.
The following table lists the abstract format masks and the sample output that would be
generated for US locale:
Mask Output for US Locale
SHORT 2/31/99
Calendar Specication
The term "calendar" refers to the calendar date displayed in the published report. The
following types are supported:
• GREGORIAN
• ARABIC_HIJRAH
• ENGLISH_HIJRAH
• JAPANESE_IMPERIAL
• THAI_BUDDHA
• ROC_OFFICIAL (Taiwan)
• Set the calendar type using the profile option XDO: Calendar Type
(XDO_CALENDAR_TYPE).
Note: The calendar type specified in the template will override the
calendar type set in the profile option.
See XML Publisher Configuration File, page 10-1 for more information.
To set the property in the template:
See Setting Properties, page 6-83.
Now you can run your report and XML Publisher will use the font in the output as
designed. For PDF output, the advanced font handling features of XML Publisher
embed the external font glyphs directly into the final document. The embedded
font only contains the glyphs required for the document and not the complete font
definition. Therefore the document is completely self-contained, eliminating the need to
have external fonts installed on the printer.
For an example implementation, see the white paper, "Check Printing Using Oracle
XML Publisher," MetaLink note 312353.1. This document describes how to set up the
MICR font used in check printing.
This command requires a Java class name (this will carry out the encoding) and a
barcode vendor ID as defined by the class. This command must be placed in the template
before the commands to encode the data in the template. For example:
<?register-barcode-vendor:’oracle.apps.xdo.template.rtf.util.barc
oder.BarcodeUtil’;’XMLPBarVendor’?>
where
oracle.apps.xdo.template.rtf.util.barcoder.BarcodeUtil is the Java
class and
XMLPBarVendor is the vendor ID that is defined by the class.
where
data is the element from your XML data source to be encoded. For example: LABEL_ID
barcode_type is the method in the encoding Java class used to format the data (for
example: Code128a).
barcode_vendor_id is the ID defined in the register-barcode-vendor field of
the first command you used to register the encoding class.
For example:
<?format-barcode:LABEL_ID;’Code128a’;’XMLPBarVendor’?>
At runtime, the barcode_type method is called to format the data value and the
barcode font will then be applied to the data in the final output.
XPath Overview
XPath is an industry standard developed by the World Wide Web Consortium (W3C). It
is the method used to navigate through an XML document. XPath is a set of syntax rules
The root node in this example is CATALOG. CD is an element, and it has an attribute
cattype. The sample contains the comment My CD Listing. Text is contained within
the XML document elements.
Locating Data
Locate information in an XML document using location-path expressions.
A node is the most common search element you will encounter. Nodes in the example
CATALOG XML include CD, TITLE, and ARTIST. Use a path expression to locate nodes
within an XML document. For example, the following path returns all CD elements:
//CATALOG/CD
where
Further limit your search by using square brackets. The brackets locate elements with
certain child nodes or specified values. For example, the following expression locates
all CDs recorded by Bob Dylan:
/CATALOG/CD[ARTIST="Bob Dylan"]
Or, if each CD element did not have an PRICE element, you could use the following
expression to return only those CD elements that include a PRICE element:
/CATALOG/CD[PRICE]
Use the bracket notation to leverage the attribute value in your search. Use the @ symbol
to indicate an attribute. For example, the following expression locates all Rock CDs (all
CDs with the cattype attribute value Rock):
//CD[@cattype="Rock"]
This returns the following data from the sample XML document:
<CD cattype=Rock>
<TITLE>Hide Your Heart</TITLE>
<ARTIST>Bonnie Tylor</ARTIST>
<COUNTRY>UK</COUNTRY>
<PRICE>9.90</PRICE>
<YEAR>1988</YEAR>
</CD>
You can also use brackets to specify the item number to retrieve. For example, the first
CD element is read from the XML document using the following XPath expression:
/CATALOG/CD[1]
You can combine statements with Boolean operators for more complex searches. The
following expression retrieves all Folk and Rock CDs, thus all the elements from the
sample:
//CD[@cattype="Folk"]|//CD[@cattype="Rock"]
The pipe (|) is equal to the logical OR operator. In addition, XPath recognizes the logical
OR and AND, as well as the equality operators: <=, <, >, >=, ==, and !=. For example, we
can find all CDs released in 1985 or later using the following expression:
/CATALOG/CD[YEAR >=1985]
Starting Reference
The first character in an XPath expression determines the point at which it should start in
the XML tree. Statements beginning with a forward slash (/) are considered absolute. No
slash indicates a relative reference. An example of a relative reference is:
CD/*
This statement begins the search at the current reference point. That means if the
example occurred within a group of statements the reference point left by the previous
statement would be utilized.
A noted earlier, double forward slashes (//) retrieve every matching element regardless
of location in the document.
Therefore, to access all CDs from the sample XML, use the following expression:
/CATALOG/CD/..
You could also access all the CD tittles released in 1988 using the following:
/CATALOG/CD/TITLE[../YEAR=1988]
The .. is used to navigate up the tree of elements to find the YEAR element at the same
level as the TITLE, where it is then tested for a match against "1988". You could also use
// in this case, but if the element YEAR is used elsewhere in the XML document, you
may get erroneous results.
XPath is an extremely powerful standard when combined with RTF templates allowing
you to use conditional formatting and filtering in your template.
Namespace Support
If your XML data contains namespaces, you must declare them in the template prior to
referencing the namespace in a placeholder. Declare the namespace in the template using
either the basic RTF method or in a form field. Enter the following syntax:
section The statement affects the whole section including the header and footer. For
example, a for-each@section context command creates a new section for each
occurrence - with restarted page numbering and header and footer.
See Batch Reports, page 6-85 for an example of this usage.
column The statement will affect the whole column of a table. This context is typically used
to show and hide table columns depending on the data.
See Column Formatting, page 6-61 for an example.
cell The statement will affect the cell of a table. This is often used together with @column
in cross-tab tables to create a dynamic number of columns.
See Cross-Tab Support, page 6-87 for an example.
block The statement will affect multiple complete fo:blocks (RTF paragraphs). This
context is typically used for if and for-each statements. It can also be used to apply
formatting to a paragraph or a table cell.
See Cell Highlighting, page 6-64 for an example.
inline The context will become the single statement inside an fo:inline block. This context is
used for variables.
incontext The statement is inserted immediately after the surrounding statement. This is the
default for <?sort?> statements that need to follow the surrounding for-each as
the first element.
inblock The statement becomes a single statement inside an fo:block (RTF paragraph). This is
typically not useful for control statements (such as if and for-each) but is useful
for statements that generate text, such as call-template.
inlines The statement will affect multiple complete inline sections. An inline section is text
that uses the same formatting, such as a group of words rendered as bold.
See If Statements in Boilerplate Text, page 6-58.
begin The statement will be placed at the beginning of the XSL stylesheet. This is required
for global variables. See Defining Parameters, page 6-81.
end The statement will be placed at the end of the XSL stylesheet.
The following table shows the default context for the XML Publisher commands:
apply-template inline
attribute inline
call-template inblock
choose block
for-each block
if block
import begin
param begin
sort incontext
template end
value-of inline
variable end
Template Declaration
Use this element to apply a set of rules when a specified node is matched.
XSL Syntax: <xsl:template name="name">
XML Publisher Tag: <?template:name?>
Variable Declaration
Use this element to declare a local or global variable.
XSL Syntax: <xsl:variable name="name">
XML Publisher Tag: <?variable:name?>
Example:
<xsl:variable name="color" select="’red’"/>
Assigns the value "red" to the "color" variable. The variable can then be referenced in
the template.
Import Stylesheet
Use this element to import the contents of one style sheet into another.
Note: An imported style sheet has lower precedence than the importing
style sheet.
Using FO Elements
You can use the native FO syntax inside the Microsoft Word form fields.
For more information on XSL-FO see the W3C Website at http://www.w3.org/2002/
08/XSLFOsummary.html
The full list of FO elements supported by XML Publisher can be found in the
Appendix: Supported XSL-FO Elements, page A-1.
lpad(’aaa’,10,’.’) <?xdofx:lpad(’aaa’,10,’.’)?> The lpad function pads the left side of a string
with a specific set of characters. The syntax for
the lpad function is:
lpad(string1,padded_length,[pad_
string])
string1 is the string to pad characters to (the
left-hand side).
padded_length is the number of characters to
return.
pad_string is the string that will be padded to
the left-hand side of string1 .
rpad(’aaa’,10,’.’) <?xdofx:rpad(’aaa’,10,’.’)?> The rpad function pads the right side of a string
with a specific set of characters.
The syntax for the rpad function is:
rpad(string1,padded_length,[pad_
string]).
string1 is the string to pad characters to (the
right-hand side).
padded_length is the number of characters to
return.
pad_string is the string that will be padded to
the right-hand side of string1
round <?xdofx:round ( number [, integer ] )?> ROUND returns number rounded to integer
places right of the decimal point. If integer
is omitted, then number is rounded to 0
places. integer can be negative to round off
digits left of the decimal point. integer must be
an integer.
greatest <?xdofx:greatest ( expr [, expr]... )?> GREATEST returns the greatest of the list of
exprs. All exprs after the first are implicitly
converted to the datatype of the first expr before
the comparison.
least <?xdofx:least ( expr [, expr]... )?> LEAST returns the least of the list of exprs. All
exprs after the first are implicitly converted
to the datatype of the first expr before the
comparison.
(2+3/4-6*7)/8 <?xdofx:(2+3/4-6*7)/8?>
lpad(substr(’1234567890’,5,3),10,’^’) <?xdofx:lpad(substr(’1234567890’,5,3),10,’^’)?>
decode(’a’,’b’,’c’,’d’,’e’,’1’)||instr(’321’,1,1) <?xdofx:decode(’a’,’b’,’c’,’d’,’e’,’1’)||instr(’321’,
1,1)?>
XSL Equivalents
The following table lists the XML Publisher simplified syntax with the XSL equivalents.
Using FO Elements
You can use most FO elements in an RTF template inside the Microsoft Word form
fields. The following FO elements have been extended for use with XML Publisher RTF
templates. The XML Publisher syntax can be used with either RTF template method.
The full list of FO elements supported by XML Publisher can be found in the
Appendix: Supported XSL-FO Elements, page A-1.
<fo:page-number> <?fo:page-number?>
If you are designing the layout, note that once you have converted to PDF, your layout
is treated like a set background. When you mark up the template, you draw fields on
top of this background. To edit the layout, you must edit your original document and
then convert back to PDF.
For this reason, the PDF template is not recommended for documents that will require
frequent updates to the layout. However, it is appropriate for forms that will have a fixed
layout, such as invoices or purchase orders.
Supported Modes
XML Publisher supports Adobe Acrobat 5.0 (PDF specification version 1.4). If you are
using Adobe Acrobat Professional 6.0 (or later), use the Reduce File Size Option (from
the File menu) to save your file as Adobe Acrobat 5.0 compatible.
For PDF conversion, XML Publisher supports any PDF conversion utility, such as Adobe
Acrobat Distiller.
The following is the XML data that will be used as input to this template:
Creating a Placeholder
You can define a placeholder as text, a check box, or a radio button, depending on how
you want the data presented.
Note: If you are using Adobe Acrobat 5.0, the Form Tool is available
from the standard toolbar. If you are using Adobe Acrobat 6.0 or
later, display the Forms Toolbar from the Tools menu by selecting Tools
> Advanced Editing > Forms > Show Forms Toolbar.
2. For each element in the group, enter the following syntax in the Short Description
field (Acrobat 5.0) or the Tooltip field (Acrobat 6.0):
<?rep_field="T1_Gn"?>
where n is the row number of the item on the template.
For example, the group in the sample report is laid out in three rows.
• For the fields belonging to the row that begins with "PO_LINE_NUM" enter
<?rep_field="T1_G1"?>
• For the fields belonging to the row that begins with "C_FLEX_ITEM_DISP" enter
<?rep_field="T1_G2"?>
• For the fields belonging to the row that begins with "C_SHIP_TO_ADDRESS"
enter
<?rep_field="T1_G3"?>
The following graphic shows the entries for the Short Description/Tooltip field:
<G_DEPTNO>
<DEPTNO>30</DEPTNO>
<LIST_G_EMPNO>
.
.
.
</LIST_G_EMPNO>
<SUMSALPERDEPTNO>9400</SUMSALPERDEPTNO>
</G_DEPTNO>
</LIST_G_DEPTNO>
<SUMSALPERREPORT>29425</SUMSALPERREPORT>
</ROOT>
We want to report the salary information for each employee by department as shown in
the following template:
The Field Properties dialog box for the field is shown in the following figure:
Note that in order for the break to occur, the field must be populated with data from
the XML file.
The sample report with data is shown in the following figure:
Overow Data
When multiple pages are required to accommodate the occurrences of repeating rows
of data, each page will display identically except for the defined repeating area, which
will display the continuation of the repeating data. For example, if the item rows of the
purchase order extend past the area defined on the template, succeeding pages will
display all data from the purchase order form with the continuation of the item rows.
To map the existing form fields to the data from your incoming XML file, you must
rename the fields to match the element names in your XML file.
4. Open the text form field Properties dialog by either double-clicking the field, or by
selecting the field then selecting Properties from the right-mouse menu.
5. In the Name field, enter the element name from your input XML file.
6. Repeat for all fields that you want populated by your data file.
Introduction
The XML Publisher data engine enables you to rapidly generate any kind of XML data
structure against any database in a scalable, efficient manner. The data template is the
method by which you communicate your request for data to the data engine. It is an
XML document whose elements collectively define how the data engine will process the
template to generate the XML.
The data engine supports the following functionality:
1. Schema generation
2. Default RTF template generation
3. Flexfields
4. Single and multiple data queries
5. Query links
6. Parameters
7. Aggregate functions (SUM, AVG, MIN, MAX, COUNT)
8. Event triggers
9. Multiple data groups
The XML output generated by the data engine supports the following:
• Unicode for XML Output
Unicode is a global character set that allows multilingual text to be displayed in a
single application. This enables you to develop a single multilingual application
and deploy it worldwide.
• Canonical format
The data engine generates date elements using the canonical ISO date
format: YYYY-MM-DDTHH24:MI:SS.FF3TZH:TZM for a mapped date element, and
######.## for number elements in the data template XML output.
• description
• version (Required)
• dataSourceRef - the default data source reference for the entire data
template. Required in the following cases:
• XML Publisher Enterprise implementations: Always required.
parameter Attributes:
• name (Required) - the parameter name that will be referenced in the
template.
• defaultValue - value to use for the parameter if none supplied from the data
• oracle.apps.fnd.flex.kff.select
• oracle.apps.fnd.flex.kff.where
• oracle.apps.fnd.flex.kff.order_by
link Attributes:
• parentQuery - specify the parent query name.
• condition - the SQL operator that defines the relationship between the
parent column and the child column. The following values for condition
are supported: =, <, <=, >, >=
dataTrigger Attributes:
• name (Required) - the event name to fire this trigger
dataStructure (Required for multiple queries) Defines the structure of the output
XML. Consists of <group> and <element> elements to specify the
structure. This section is optional for single queries; if not specified, the data
engine will generate flat XML.
group Consists of one or more <element> elements and sub <group> elements.
Attributes:
• name (Required) - the XML tag name to be assigned to the group.
• groupFilter - the filter to apply to the output data group set. Define the
filter as: <package name>.<function name>.
Note: Applying a filter has performance impact. Do not use this
functionality unless necessary. When possible, filter data using a
WHERE clause in your query.
• value (Required) - the column name for the SQL statement. Note that for
aggregations in which the column name is in another group, the value
must be defined as <group name>.<column/alias name>.
dataSourceRef The default data source reference for the entire data
template. Required in the following cases:
• XML Publisher Enterprise implementations: Always
required.
• YYYY-MM-DDTHH24:MI:SS.FF3TZH:TZM
If your column names are not unique, you must use aliases in your SELECT statements
to ensure the uniqueness of your column names. If you do not use an alias, then the
default column name is used. This becomes important when you specify the XML output
in the dataStructure section. To specify an output XML element from your query you
declare a value attribute for the element tag that corresponds to the source column.
Tip: Performing operations in SQL is faster than performing them in
the data template or PL/SQL. It is recommended that you use SQL for
the following operations:
• Use a WHERE clause instead of a group filter to exclude records.
• Perform calculations directly in your query rather than in the
template.
parentQuery Specify the parent query name. This must be the name that you
assigned to the corresponding <sqlstatement> element. See
How to Define Queries, page 9-6.
childQuery Specify the child query name. This must be the name that you
assigned to the corresponding <sqlstatement> element. See
How to Define Queries, page 9-6.
The location of the trigger indicate at what point the trigger fires:
• Place a beforeReport trigger anywhere in your data template before the
<dataStructure> section.. A beforeRepot trigger fires before the dataQuery is
executed.
• Place an afterReport trigger after the <dataStructure> section. An afterReport
trigger fires after you exit and after XML output has been generated.
The following table lists the attributes for the <element> element tag:
An example of the group filter in your data template definition would be:
<group name="G_DEPT" source="Q1" groupFilter="empdata.G_EMPFilter
(:DEPTSAL)">
<element name="DEPT_NUMBER" value="DEPTNO" />
<element name="DEPT_NAME" value="DNAME"/>
<element name="DEPTSAL" value="G_EMP.SALARY" function="SUM(
)"/>
The break group determines when to reset the value of the summary column. For
example:
<group name="G_DEPT" source="Q1">
<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>
Flexeld Support
Note: This section applies to data templates written to query the Oracle
Applications database.
<lexicals ...
<lexical type="oracle.apps.fnd.flex.kff..."
name="<Name of the lexical>"
comment="<comment>"
/>
<lexical type="oracle.apps.fnd.flex.kff..."
name="<Name of the lexical>"
comment="<comment>"
/>
</lexicals>
<dataQuery>
<sqlStatement ...
</dataTemplate>
Flexeld Lexicals
There are four types of KFF-related lexicals. These are:
• oracle.apps.fnd.flex.kff.segments_metadata
• oracle.apps.fnd.flex.select
• oracle.apps.fnd.flex.kff.where
• oracle.apps.fnd.flex.kff.order_by
Following are descriptions of each type of KFF lexical:
oracle.apps.fnd.ex.kff.segments_metadata
Use this type of lexical to retrieve flexfield-related metadata. Using this lexical, you are
not required to write PL/SQL code to retrieve this metadata. Instead, define a dummy
SELECT statement, then use this lexical to get the metadata.
The XML syntax for this lexical is as follows:
The following table lists the attributes for the segements_metadata lexical:
Attribute Description
show_parent_segments (Optional) Valid values are "Y" and "N". Default value
is "Y". If a dependent segment is displayed, the parent
segment is automatically displayed, even if it is not
specified as displayed in the segments attribute.
Example
This example shows how to request the above_prompt of the GL Balancing
Segment, and the left_prompt of the GL Account Segment.
<lexicals>
<lexical type="oracle.apps.fnd.flex.kff.segments_metadata"
name="FLEX_GL_BALANCING_APROMPT"
comment="Comment"
application_short_name="SQLGL"
id_flex_code="GL#"
id_flex_num=":P_ID_FLEX_NM"
segments="GL_BALANCING"
metadata_type="ABOVE_PROMPT"/>
<lexical type="oracle.apps.fnd.flex.kff.segments_metadata"
name="FLEX_GL_ACCOUNT+LPROMPT"
comment="Comment"
application_short_name="SQLGL"
id_flex_code="GL#"
id_flex_num=":P_ID_FLEX_NUM"
segments="GL_ACCOUNT"
metadata_type="LEFT_PROMPT"/>
</lexicals>
oracle.apps.fnd.ex.kff.select
This type of lexical is used in the SELECT section of the statement. It is used to retrieve
and process key flexfield (kff) code combination related data based on the lexical
definition.
The syntax is as follows:
<lexicals>
<lexical
type="oracle.apps.fnd.flex.kff.select"
name="Name of the lexical"
comment="Comment"
application_short_name="Application Short Name of the KFF"
id_flex_code="Internal code of the KFF"
id_flex_num="Internal number of the KFF structure"
multiple_id_flex_num="Are multiple structures allowed?"
code_combination_table_alias="Code Combination Table Alias"
segments="Segments for which this data is requested"
show_parent_segments="Should the parent segments be listed?"
output_type="output type"/>
</lexicals>
show_parent_segments (Optional) Valid values are "Y" and "N". Default value
is "Y". If a dependent segment is displayed, the parent
segment is automatically displayed, even if it is not
specified as displayed in the segments attribute.
Example
This example shows how to report concatenated values, concatenated descriptions, the
value of the GL Balancing Segment, and the full description of the GL Balancing Segment
for a single structure:
SELECT &FLEX_VALUE_ALL alias_value_all,
&FLEX_DESCR_ALL alias_descr_all,
&FLEX_GL_BALANCING alias_gl_balancing,
&FLEX_GL_BALANCING_FULL_DESCR alias_gl_balancing_full_descr,
...
FROM gl_code_combinations gcc,
some_other_gl_table sogt
<lexicals>
<lexical
type="oracle.apps.fnd.flex.kff.select"
name="FLEX_VALUE_ALL"
comment="Comment"
application_short_name="SQLGL"
id_flex_code="GL#"
id_flex_num=":P_ID_FLEX_NUM"
multiple_id_flex_num="N"
code_combination_table_alias="gcc"
segments="ALL"
show_parent_segments="Y"
output_type="VALUE"/>
<lexical
type="oracle.apps.fnd.flex.kff.select"
name="FLEX_DESCR_ALL"
comment="Comment"
application_short_name="SQLGL"
id_flex_code="GL#"
id_flex_num=":P_ID_FLEX_NUM"
multiple_id_flex_num="N"
code_combination_table_alias="gcc"
segments="ALL"
show_parent_segments="Y"
output_type="DESCRIPTION"/>
<lexical
type="oracle.apps.fnd.flex.kff.select"
name="FLEX_GL_BALANCING"
comment="Comment"
application_short_name="SQLGL"
id_flex_code="GL#"
id_flex_num=":P_ID_FLEX_NUM"
multiple_id_flex_num="N"
code_combination_table_alias="gcc"
segments="GL_BALANCING"
show_parent_segments="N"
output_type="VALUE"/>
<lexical
type="oracle.apps.fnd.flex.kff.select"
name="FLEX_GL_BALANCING_FULL_DESCR"
comment="Comment"
application_short_name="SQLGL"
id_flex_code="GL#"
id_flex_num=":P_ID_FLEX_NUM"
multiple_id_flex_num="N"
code_combination_table_alias="gcc"
segments="GL_BALANCING"
show_parent_segments="N"
output_type="FULL_DESCRIPTION"/>
</lexicals>
The attributes for this lexical are listed in the following table:
Attribute Description
Example
This example shows a filter based on the GL Account segment and the GL Balancing
Segment:
<lexicals>
<lexical
type="oracle.apps.fnd.flex.kff.where"
name="FLEX_WHERE_GL_ACCOUNT"
comment="Comment"
application_short_name="SQLGL"
id_flex_code="GL#"
id_flex_num=":P_ID_FLEX_NUM"
code_combination_table_alias="gcc"
segments="GL_ACCOUNT"
operator="="
operand1=":P_GL_ACCOUNT"/>
<lexical
type="oracle.apps.fnd.flex.kff.where"
name="FLEX_WHERE_GL_BALANCING"
comment="Comment"
application_short_name="SQLGL"
id_flex_code="GL#"
id_flex_num=":P_ID_FLEX_NUM"
code_combination_table_alias="gcc"
segments="GL_BALANCING"
operator="BETWEEN"
operand1=":P_GL_BALANCING_LOW"
operand2=":P_GL_BALANCING_HIGH"/>
</lexicals>
oracle.apps.fnd.ex.kff.order_by
This type of lexical is used in the ORDER BY section of the statement. It returns a list of
column expressions so that the resulting output can be sorted by the flex segment values.
The syntax for this lexical is as follows:
<lexicals>
<lexical
type="oracle.apps.fnd.flex.kff.order_by"
name="Name of the lexical"
comment="Comment"
application_short_name="Application Short Name of the KFF"
id_flex_code="Internal code of the KFF"
id_flex_num="Internal number of the KFF structure"
multiple_id_flex_num="Are multiple structures allowed?"
code_combination_table_alias="Code Combination Table Alias"
segments="Segment(s)for which data is requested"
show_parent_segments="List parent segments?"/>
</lexicals>
The attributes for this lexical are listed in the following table:
show_parent_segments (Optional) Valid values are "Y" and "N". Default value
is "Y". If a dependent segment is displayed, the parent
segment is automatically displayed, even if it is not
specified as displayed in the segments attribute.
Example
The following example shows results sorted based on GL Account segment and GL
Balancing segment for a single structure KFF.
<lexicals>
<lexical
type="oracle.apps.fnd.flex.kff.order_by"
name="FLEX_ORDER_BY_GL_ACCOUNT"
comment="Comment"
application_short_name="SQLGL"
id_flex_code="GL#"
id_flex_num=":P_ID_FLEX_NUM"
code_combination_table_alias="gcc"
segments="GL_ACCOUNT"
show_parent_segments="Y"/>
<lexical
type="oracle.apps.fnd.flex.kff.order_by"
name="FLEX_ORDER_BY_GL_BALANCING"
comment="Comment"
application_short_name="SQLGL"
id_flex_code="GL#"
id_flex_num=":P_ID_FLEX_NUM"
code_combination_table_alias="gcc"
segments="GL_BALANCING"
show_parent_segments="N"/>
</lexicals>
The following code sample is an annotated snippet of the Java code used to process the
data template by the data engine:
while (it.hasNext())
{
Parameter p = (Parameter) it.next();
if (p.getName().equals("p_DeptNo"))
// Here we assign the value ‘10’ to the p_DeptNo parameter.
// This could have been entered from a report submission
// screen or passed in from another process.
p.setValue(new "10");
}
// The parameter values now need to be assigned
// to the data template; there are two methods
// available to do this: 1. Use the setParameters
// method to assign the ’parameters’ object to the template:
dataProcessor.setParameters(parameters);
<dataTrigger name="beforeReport"
source="employee.beforeReportTrigger"/>
<dataStructure>
- The following section specifies the XML hierarchy
- for the returning data:
<group name="G_DEPT" source="Q1"
groupFilter="employee.G_DEPTFilter(:DEPT_NUMBER)">
- There is a group filter placed on the DEPT group.
- This is returned from the employee.G_DEPTFilter plsql package.
- It passes the DEPT_NUMBER value ("name" attribute) rather
- than the DEPTNO value ("value" attribute)
/
- This is the package body, it contains the code for the
- functions/procedures
RETURN (TRUE);
end;
END;
/
value="G_HEADERS.H_TOT_STAT_AMT"/>
<element name="B_TOTAL_STAT" function="sum" dataType="number"
value="G_HEADERS.H_Total_Stat"/>
<group name="G_HEADERS" dataType="varchar2" source="Q_MAIN">
<element name="Header_id" dataType="number"
value="Header_id"/>
<element name="Header_Name" dataType="varchar2"
value="Header_Name"/>
<element name="Category" dataType="varchar2"
value="Category"/>
<element name="Header_Reference" dataType="varchar2"
value="Header_Reference"/>
<element name="Currency_Code" dataType="varchar2"
value="Currency_Code"/>
<element name="H_TOT_DR" dataType="number" value="H_TOT_DR"/>
<element name="H_Total_Dr" function="sum" dataType="number"
value="G_LINES.Line_Acc_Dr"/>
<element name="H_TOT_CR" dataType="number" value="H_TOT_CR"/>
<element name="H_Total_Cr" function="sum" dataType="number"
value="G_LINES.Line_Acc_Cr"/>
<element name="H_TOT_STAT_AMT" function="sum"
dataType="number"
value="G_LINES.Line_Stat_Amount"/>
<element name="H_Total_Stat" function="sum" dataType="number"
Namespace
The namespace for this configuration file is:
http://xmlns.oracle.com/oxp/config/
Structure
The <config> element is the root element. It has the following structure:
Attributes
version
The version number of the configuration file format. Specify 1.0.0.
xmlns
The namespace for XML Publisher’s configuration file. Must be http://xmlns.
oracle.com/oxp/config/
Description
The root element of the configuration file. The configuration file consists of two parts:
• Properties (<properties> elements)
• Font definitions (<fonts> elements)
The <fonts> and <properties> elements can appear multiple times. If conflicting
definitions are set up, the last occurrence prevails.
Properties
This section describes the <properties> element and the <property> element.
Description
The <properties> element defines a set of properties. You can specify the locales
attribute to define locale-specific properties. Following is an example:
Example
<!-- Properties for all locales -->
<properties>
...Property definitions here...
</properties>
Attributes
name
Specify the property name.
Description
Property is a name-value pair. Specify the property name (key) to the name attribute and
the value to the element value.
Example
<properties>
<property name="system-temp-dir">d:\tmp</property>
<property name="system-cache-page-size">50</property>
<property name="pdf-replace-smart-quotes">false</property>
</properties>
List of Properties
The following tables list the available properties. They are organized into the following
groups:
• General Properties
• PDF Output Properties
• PDF Security
• RTF Output
• HTML Output
• FO Processing Properties
• PDF Template Properties
• RTF Template Properties
• PDF Document Merger Property
• XLIFF Extraction Properties
General Properties
General properties are shown in the following table:
Property Name Default Value Description
system-temp-dir N/A Enter the directory path for the temporary directory
to be used by the FO Processor when processing
large files. It is strongly recommended that you set a
temporary directory to avoid "Out of Memory" errors.
pdf-hide-menubar False Specify "True" to hide the viewer application’s menu bar when
the document is active.
pdf-hide-toolbar False Specify "True" to hide the viewer application’s toolbar when
the document is active.
pdf-replace- True Set to "False" if you do not want curly quotes replaced with
smartquotes straight quotes in your PDF output.
PDF Security
Use the following properties to control the security settings for your output PDF
documents:
Property Name Default Value Description
pdf-security False If you specify "True," the output PDF file will be
encrypted. You must also specify the following
properties:
• pdf-open-password
• pdf-permissions-password
• pdf-encryption-level
pdf-encryption-level 0 - low Specify the encryption level for the output PDF file. The
possible values are:
• 0: Low (40-bit RC4, Acrobat 3.0 or later)
• pdf-no-changing-the-document
• pdf-no-cceda
• pdf-no-accff
When pdf-encryption-level is set to 1, the following
properties are available:
• pdf-enable-accessibility
• pdf-enable-copying
• pdf-changes-allowed
• pdf-printing-allowed
• 2: High resolution
RTF Output
The following properties can be set to govern RTF output files:
Property Name Default Value Description
rtf-track-changes False Set to "True" to enable change tracking in the output RTF
document.
rtf-protect- False Set to "True" to protect the document for tracked changes.
document-for-
tracked-changes
HTML Output
The following properties can be set to govern HTML output files:
html-image-base-uri N/A Base URI which is inserted into the src attribute of the
image tag before the image file name. This works only
when the image is embedded in the template.
html-image-dir N/A Enter the directory for XML Publisher to store the image
files that are embedded in the template.
html-css-base-uri N/A Base URI which is inserted into the HTML header to
specify where the cascading stylesheets (CSS) for your
output HTML documents will reside. You must set this
property when make-accessible is true.
html-css-dir N/A The CSS directory where XML Publisher stores the css
file. You must set this property when make-accessible
is true.
html-replace- True Set to "False" if you do not want curly quotes replaced
smartquotes with straight quotes in your HTML output.
make-accessible False Specify true if you want to make the HTML output
accessible.
FO Processing Properties
The following properties can be set to govern FO processing:
digit-substitution None Valid values are "None" and "National". When set to
"None", Eastern European numbers will be used. When
set to "National", Hindi format (Arabic-Indic digits) will
be used. This setting is effective only when the locale is
Arabic, otherwise it is ignored.
xslt-scalable False Controls the scalable feature of the XDO parser. The
property xslt-xdoparser must be set to "True" for
this property to be effective.
rtf-checkbox-glyph Default value: Albany WT The XML Publisher default PDF output font does
J;9746;9747/A not include a glyph to represent a checkbox. If your
template contains a checkbox, use this property
to define a Unicode font for the representation of
checkboxes in your PDF output. You must define the
Unicode font number for the "checked" state and the
Unicode font number for the "unchecked" state using
the following syntax: fontname;<unicode font
number for true value’s glyph >;<unicode
font number for false value’s glyph>
Example: Albany WT J;9746;9747/A
Note that the font that you specify must be made
available to XML Publisher at runtime.
pdf-tempfile-max- unlimited This property sets the maximum size for the
size temporary file used during batch processing
by the PDF Document Merger. Enter
the maximum size in bytes. For more
information, see PDF Document Merger,
page 11-30.
XLIFF Extraction
The following properties can be set to govern XLIFF extraction:
Font Denitions
Font definitions include the following elements:
• <fonts>
• <font>
• <font-substitute>
• <truetype>
• <type1>
For the list of Truetype and Type1 fonts, see Predefined Fonts, page 10-15.
<fonts> element
The <fonts> element is structured as follows:
<fonts locales="cdata">
<font> ... </font> [0..n]
<font-substitute> ... </font-substitute> [0..n]
</fonts>
Attributes
locales
Specify the locales for this font definition. This attribute is optional.
<font> element
Following is the structure of the <font> element:
<font family="cdata" style="normalitalic"
weight="normalbold">
<truetype>...</truetype>
or <type1> ... <type1>
</font>
Attributes
family
Specify any family name for the font. If you specify "Default" for this attribute, you can
define a default fallback font. The family attribute is case-insensitive.
style
Specify "normal" or "italic" for the font style.
weight
Specify "normal" or "bold" for the font weight.
Description
Defines an XML Publisher font. This element is primarily used to define fonts for
FO-to-PDF processing (RTF to PDF). The PDF Form Processor (used for PDF templates)
does not refer to this element.
Example
<!-- Define "Arial" font -->
<font family="Arial" style="normal" weight="normal">
<truetype path="/fonts/Arial.ttf"/>
</font>
<font-substitute> element
Following is the structure of the font-substitute element:
<font-substitute name="cdata">
<truetype>...</truetype>
or <type1>...</type1>
</font-substitute>
Description
Defines a font substitution. This element is used to define fonts for the PDF Form
Processor.
Example
<font-substitute name="MSGothic">
<truetype path="/fonts/msgothic.ttc" ttccno=0"/>
</font-substitute>
<type1> element>
The form of the <type1> element is as follows:
<type1 name="cdata"/>
Attributes
name
Specify one of the Adobe standard Latin1 fonts, such as "Courier".
Description
<type1> element defines an Adobe Type1 font.
Example
<!--Define "Helvetica" font as "Serif" -->
<font family="serif" style="normal" weight="normal">
<type1 name="Helvetica"/>
</font>
Locales
A locale is a combination of an ISO language and an ISO country. ISO languages are
defined in ISO 639 and ISO countries are defined in ISO 3166.
The structure of the locale statement is
ISO Language-ISO country
Locales are not case-sensitive and the ISO country can be omitted.
Example locales:
• en
• en-US
• EN-US
• ja
• ko
• zh-CN
For example:
Suppose for a particular template, there are different font mapping sets assigned at the
site and template levels, with the mappings shown in the following table:
Level Font Family Style Weight Language Territory Target Font
At runtime if the locale of the template file is Japanese/Japan, the following font
mappings will be used:
Font Family Style Weight Target Font
Note that even though there is a mapping for Arial at the template level, the site level
value is used because it has a better match for the locale.
Predened Fonts
XML Publisher has several predefined fonts. These fonts do not require any font setting
in the Administration interface.
The Type1 fonts are listed in the following table:
The TrueType fonts are listed in the following table. All TrueType fonts will be subsetted
and embedded into PDF.
Introduction
This chapter is aimed at developers who wish to create programs or applications that
interact with XML Publisher through its application programming interface. This
information is meant to be used in conjunction with the Javadocs available from your
installation CD.
This section assumes the reader is familiar with Java programming, XML, and XSL
technologies.
Merging XML Data with a PDF Template Using Input/Output File Names
Input:
• Template file name (String)
• XML file name (String)
• Metadata XML file name (String)
Output:
• PDF file name (String)
Example
import oracle.apps.xdo.template.FormProcessor;
.
.
FormProcessor fProcessor = new FormProcessor();
fProcessor.process();
fProcessor.setTemplate(fIs);
fProcessor.setData(fIs2); // Input Data
fProcessor.setOutput(fOs);
fProcessor.setMetaInfo(fIs3);
fProcessor.process();
fIs.close();
fOs.close();
The following code example shows how the API can be used:
Example
import oracle.apps.xdo.template.FormProcessor;
import oracle.apps.xdo.template.pdf.xfdf.XFDFObject;
.
.
.
FormProcessor fProcessor = new FormProcessor();
fProcessor.setTemplate(filePath); // Input File (PDF) name
XFDFObject xfdfObject = new XFDFObject(fProcessor.getFieldInfo());
System.out.println(xfdfObject.toString());
From this XML you want to generate the following XFDF format:
<fields>
<field name="SUPPLIER1">
<value>Supplier</value>
</field>
<field name="SUPPLIERNUMBER1">
<value>Supplier Number</value>
</field>
<field name="CURRCODE1">
<value>Currency</value>
</field>
...
</fields>
You can then use the XFDFObject to convert XML to the XFDF format using an XSLT
as follows:
Example
import java.io.*;
import oracle.apps.xdo.template.pdf.xfdf.XFDFObject;
.
.
.
XFDFObject xfdfObject = new XFDFObject();
System.out.print(xfdfObject .toString());
Generating XSL
The RTF processor engine takes an RTF template as input. The processor parses the
template and creates an XSL-FO template. This can then be passed along with a data
source (XML file) to the FO Engine to produce PDF, HTML, RTF, or Excel (HTML) output.
Use either input/output file names or input/output streams as shown in the following
examples:
FO Processor Engine
The following figure shows one option of how the horizontal table break will handle the
wide table. In this example, a horizontal table break is inserted after the third column.
System.exit(0);
}
System.exit(0);
System.exit(0);
}
Creating XSL-FO from Two XML Files and Two XSL les
Input:
• XML File 1
• XML File 2
• XSL File 1
• XSL File 2
Output:
• XSL-FO (InputStream)
if (mergedFOStream == null)
{
System.out.println("Merge failed.");
System.exit(1);
}
System.exit(0);
}
// creates Array
String[] input = {args[0], args[1]};
System.exit(0);
}
processor.setOutput(pdfOutputStream);
// Set output format (for PDF generation)
processor.setOutputFormat(FOProcessor.FORMAT_PDF);
// Start processing
try
{
processor.generate();
}
catch (XDOException e)
{
e.printStackTrace();
System.exit(1);
}
}
// Initialize inputStreams
FileInputStream[] inputStreams = new FileInputStream[inputNu
mbers];
inputStreams[0] = new FileInputStream(args[0]);
inputStreams[1] = new FileInputStream(args[1]);
// Initialize outputStream
FileOutputStream outputStream = new FileOutputStream(args[2]
);
// Initialize PDFDocMerger
PDFDocMerger docMerger = new PDFDocMerger(inputStreams, outp
utStream);
return true;
}
catch(Exception exc)
{
exc.printStackTrace();
return false;
}
}
{
try
{
// Initialize PDFDocMerger
PDFDocMerger docMerger = new PDFDocMerger(inputStreams, outp
utStream);
// Set Background
docMerger.setBackground(backgroundStream);
return true;
}
catch(Exception exc)
{
exc.printStackTrace();
return false;
}
}
return true;
}
catch(Exception exc)
{
exc.printStackTrace();
return false;
}
}
return true;
}
catch(Exception exc)
{
exc.printStackTrace();
return false;
}
}
// Closes inputStreams
return true;
}
catch(Exception exc)
{
exc.printStackTrace();
return false;
}
}
where
bookBinder.setConfig(new Properties());
bookBinder.process();
• server-alias
<xapi:document output-type="pdf">
<xapi:template type="pdf"
location="d:\mywork\template1.pdf">
<xapi:data>
<field1>The first set of data</field1>
</xapi:data>
<xapi:data>
<field1>The second set of data</field1>
</xapi:data>
</xapi:template>
</xapi:document>
</xapi:request>
</xapi:requestset>
<xapi:document output-type="pdf">
<xapi:template type="pdf"
location="d:\mywork\template1.pdf">
<xapi:data>
<field1>The first set of data</field1>
</xapi:data>
<xapi:data>
<field1>The second set of data</field1>
</xapi:data>
</xapi:template>
<xapi:template type="pdf"
location="d:\mywork\template2.pdf">
<xapi:data>
<field1>The third set of data</field1>
</xapi:data>
<xapi:data>
<field1>The fourth set of data</field1>
</xapi:data>
</xapi:template>
</xapi:document>
</xapi:request>
</xapi:requestset>
<xapi:document output-type="pdf">
<xapi:template type="pdf"
location="http://your.server:9999/templates/template1.pdf">
<xapi:data>
<field1>The first page data</field1>
</xapi:data>
<xapi:data>
<field1>The second page data</field1>
</xapi:data>
</xapi:template>
<xapi:template type="pdf"
location="http://your.server:9999/templates/template2.pdf">
<xapi:data>
<field1>The third page data</field1>
</xapi:data>
<xapi:data>
<field1>The fourth page data</field1>
</xapi:data>
</xapi:template>
</xapi:document>
</xapi:request>
</xapi:requestset>
<xapi:document output-type="pdf">
<xapi:template type="pdf"
location="http://your.server:9999/templates/template1.pdf">
<xapi:data location="http://your.server:9999/data/data_1.xml
"/>
<xapi:data location="http://your.server:9999/data/data_2.xml
"/>
</xapi:template>
<xapi:template type="pdf"
location="http://your.server:9999/templates/template2.pdf">
<xapi:data>
<field1>The third page data</field1>
</xapi:data>
<xapi:data>
<field1>The fourth page data</field1>
</xapi:data>
</xapi:template>
</xapi:document>
</xapi:request>
</xapi:requestset>
<xapi:request>
<xapi:delivery>
<xapi:filesystem output="d:\temp\out_2.pdf"/>
</xapi:delivery>
<xapi:document output-type="pdf">
<xapi:template type="pdf"
location="d:mywork\template2.pdf">
<xapi:data>
<field1>The third set of data</field1>
</xapi:data>
<xapi:data>
<field1>The fourth set of data</field1>
</xapi:data>
</xapi:template>
</xapi:document>
</xapi:request>
</xapi:requestset>
<xapi:request>
<xapi:delivery>
<xapi:filesystem output="d:\temp\out7-2.pdf"/>
</xapi:delivery>
<xapi:document output-type="pdf">
<xapi:template type="pdf"
location="d:\mywork\template2.pdf">
<xapi:data>
<field1>The third page data</field1>
</xapi:data>
<xapi:data>
<field1>The fourth page data</field1>
</xapi:data>
</xapi:template>
<xapi:pagenumber initial-value="3" initial-page-index="1"
x-pos="300" y-pos="20" />
</xapi:document>
</xapi:request>
</xapi:requestset>
Invoke Processors
The following code samples show how to invoke the document processor engine using
an input file name and an input stream.
Bursting Engine
XML Publisher’s bursting engine accepts a data stream and splits it based on multiple
criteria, generates output based on a template, then delivers the individual documents
through the delivery channel of choice. The engine provides a flexible range of
possibilities for document generation and delivery. Example implementations include:
• Invoice generation and delivery based on customer-specific layouts and delivery
preference
• Financial reporting to generate a master report of all cost centers, bursting out
individual cost center reports to the appropriate manager
• Generation of payslips to all employees based on one extract and delivered via e-mail
Usage
The bursting engine is an extension of the Document Processor Engine, page 11-30 and
has its own method be called to invoke it. The Document Processor CML structure
has been extended to handle the new components required by the bursting engine. It
supports all of the delivery functionality that the Document Processor supports using
the same format. It accepts the XML data to be burst and a control file that takes
the Document Processor XML format (see Hierarchy and Elements of the Document
Processor XML File, page 11-30).
• Use the attribute id under the lowest level of the delivery structure (for example, for
the delivery element email, the id attribute belongs to the message element. This
assigns an ID to the delivery method to be referenced later in the XML file.
Example
<xapi:message id="123" to="[email protected]"
• Use the delivery attribute under the document element. This assigns the delivery
method for the generated document as defined in the id attribute for the delivery
element. You can specify multiple delivery channels separated by a comma.
Example
<xapi:document output-type="pdf" delivery="123">
• Use the filter attribute on the template element. Use this to apply a layout
template based on a filter on your XML data.
Example
<xapi:template type="rtf" location="/usr/tmp/empGeneric.rtf">
<xapi:template type="rtf" location="usr\tmp\empDet.rtf" filter="./
/EMPLOYEE[ENAME=’SMITH’]"/>
This will apply the empDet template only to those employees with the name
"SMITH". All other employees will have the empGeneric template applied. This filter
can use any XPATH expression to determine the rules for the template application.
At runtime the value of the to attribute will be set to the value of the EMAIL element
from the input XML file.
You can also set the value of an attribute by passing a parameter to API in a Properties
object.
Bursting Listeners
The bursting engine provides a listening interface that allows you to listen to the
various stages of the bursting process. Following are the supported modes that you
can subscribe to:
• beforeProcess() - before the bursting process starts.
• afterProcess() - after the bursting process completes.
• beforeProcessRequest(int requestIndex) - before the bursting request
starts. This interface provides an assigned request ID for the current request.
• afterProcessRequest(int requestIndex)- after the bursting request has
completed; provides the request ID for the current request.
where
xmlCtrlInput - is the control file for the bursting process. This can be a string reference
to a file, an inputStream object, or a Reader object.
xmlDataInput - is the XML data to be burst. This can a string reference to a file, an
inputStream object, or a Reader object.
tmpDir - is a temporary working directory. This takes the format of a String object. This
is optional as long as the main XML Publisher temporary directory has been set.
Simple Example Java Class
The following is a sample Java class:
}
public void beforeProcessDocument(int requestIndex,int
documentIndex)
{
System.out.println("Start of Process Document");
System.out.println(" Request Index "+requestIndex);
System.out.println(" Document Index " +documentIndex);
}
public void afterProcessDocument(int requestIndex,int
documentIndex,
Vector documentOutputs)
{
System.out.println(" ========End of Process Document");
System.out.println(" Outputs :"+documentOutputs);
}
public void beforeDocumentDelivery(int requestIndex,int
documentIndex,
String deliveryId)
{
System.out.println(" ========Start of Delivery");
System.out.println(" Request Index "+requestIndex);
System.out.println(" Document Index " +documentIndex);
System.out.println(" DeliveryId " +deliveryId);
}
public void afterDocumentDelivery(int requestIndex,int documentI
ndex,
String deliveryId,Object deliveryObject,Vector attachments)
{
System.out.println(" ========End of Delivery");
System.out.println(" Attachments : "+attachments);
Passing a Parameter
To pass a parameter holding a value to be used in the control file for delivery, add the
following code:
…
Properties prop= new Properties();
prop.put("user-variable:ADMIN_EMAIL","[email protected]");
dp.setConfig(prop);
dp.process();
…
Setting Properties
The properties can be set in two ways:
• At runtime, specify the property as a Java Property object to pass to the FO Processor.
System.exit(0);
}
/**
* Return true if this encoder support a specific type of barcode
* @param type the type of the barcode
* @return true if supported
*/
public boolean isSupported(String type);
/**
* Encode a barcode string by given a specific type
* @param data the original data for the barcode
* @param type the type of the barcode
* @return the formatted data
*/
public String encode(String data, String type);
Place this class in the classpath for the middle tier JVM in which XML Publisher is
running.
Note: For E-Business Suite users, the class must be placed in the
classpath for the middle tier and any concurrent nodes that are present.
import java.util.Hashtable;
import java.lang.reflect.Method;
import oracle.apps.xdo.template.rtf.util.XDOBarcodeEncoder;
import oracle.apps.xdo.common.log.Logger;
// This class name will be used in the register vendor
// field in the template.
ENCODERS.put("code128a",mUtility.getClass().getMethod("code1
28a", clazz));
ENCODERS.put("code128b",mUtility.getClass().getMethod("code1
28b", clazz));
ENCODERS.put("code128c",mUtility.getClass().getMethod("code1
28c", clazz));
} catch (Exception e) {
// This is using the XML Publisher logging class to push
// errors to the XMLP log file.
Logger.log(e,5);
}
}
// The getVendorID method is called from the template layer
// at runtime to ensure the correct encoding method are used
public final String getVendorID()
{
return BARCODE_VENDOR_ID;
}
//The isSupported method is called to ensure that the
// encoding method called from the template is actually
// present in this class.
// If not then XMLP will report this in the log.
public final boolean isSupported(String s)
{
if(s != null)
return ENCODERS.containsKey(s.trim().toLowerCase());
else
return false;
DataToEncode = DataToEncode.trim();
weightedTotal = ((int)C128_Start) - 100;
for( int i = 1; i <= DataToEncode.length(); i++ )
{
//get the value of each character
CurrentChar = DataToEncode.charAt(i-1);
if( ((int)CurrentChar) < 135 )
CurrentValue = ((int)CurrentChar) - 32;
if( ((int)CurrentChar) > 134 )
CurrentValue = ((int)CurrentChar) - 100;
CurrentValue = CurrentValue * i;
weightedTotal = weightedTotal + CurrentValue;
DataToEncode = DataToEncode.trim();
weightedTotal = ((int)C128_Start) - 100;
for( int i = 1; i <= DataToEncode.length(); i++ )
{
//get the value of each character
CurrentChar = DataToEncode.charAt(i-1);
if( ((int)CurrentChar) < 135 )
CurrentValue = ((int)CurrentChar) - 32;
if( ((int)CurrentChar) > 134 )
CurrentValue = ((int)CurrentChar) - 100;
CurrentValue = CurrentValue * i;
weightedTotal = weightedTotal + CurrentValue;
}
//divide the WeightedTotal by 103 and get the remainder,
//this is the CheckDigitValue
CheckDigitValue = weightedTotal % 103;
if( (CheckDigitValue < 95) && (CheckDigitValue > 0) )
C128_CheckDigit = (char)(CheckDigitValue + 32);
if( CheckDigitValue > 94 )
C128_CheckDigit = (char)(CheckDigitValue + 100);
if( CheckDigitValue == 0 ){
C128_CheckDigit = (char)194;
}
Once you create the class and place it in the correct classpath, your template creators
can start using it to format the data for barcodes. You must give them the following
information to include in the template commands:
• The class name and path.
In this example:
oracle.apps.xdo.template.rtf.util.barcoder.BarcodeUtil
• The barcode vendor ID you created.
In this example: XMLPBarVendor
• The available encoding methods.
In this example, code128a, code128b and code128c They can then use this
information to sucessfully encode their data for barcode output.
They can then use this information to successfully encode their data for barcode output.
• last
• rest
• any
• inherit
odd-or-even
• odd
• even
• any
• inherit
blank-or-not-blank
• blank
• not-blank
• any
• inherit
• end-on-even
• end-on-odd
• end-on-even-layout
• end-on-odd-layout
• no-force
• inherit
format
block-properties inheritable-properties
id
border-padding-background-properties background-color
background-image
background-position-vertical
background-position-horizontal
border
border-after-color
border-after-style (none, dotted, dashed, solid, double)
border-after-width
border-before-color
border-before-style (none, solid)
border-before-width
border-bottom
border-bottom-color
border-bottom-style (none, dotted, dashed, solid, double)
border-bottom-width
border-color
border-end-color
border-end-style (none, dotted, dashed, solid, double)
border-end-width
border-left
border-left-color
border-left-style (none, dotted, dashed, solid, double)
border-left-width
border-right
border-right-color
border-right-style (none, dotted, dashed, solid, double)
border-right-width
border-start-color
border-start-style (none, dotted, dashed, solid, double)
border-start-width
border-top
border-top-color
border-top-style (none, dotted, dashed, solid, double)
border-top-width
border-width
padding
padding-after
padding-before
padding-bottom
padding-end
padding-left
padding-right
padding-start
padding-top
Supported XSL-FO Elements A-7
Property Group Properties
box-size-properties height
width
character-properties font-properties
text-decoration
empty-inline-properties character-properties
border-padding-background-properties
id
color
flow-properties inheritable-properties
id
flow-name
font-properties font-family
font-size
font-style (normal, italic, oblique)
font-weight (normal, bold)
table-omit-header-at-break (TRUE, FALSE, inherit)
table-omit-footer-at-break (TRUE, FALSE, inherit)
graphic-properties border-padding-background-properties
margin-properties-inline
box-size-properties
font-properties
keeps-and-breaks-properties-atomic
id
inheritable-properties border-padding-background-properties
box-size-properties
margin-properties-inline
area-properties
character-properties
line-related-properties
leader-properties
keeps-and-breaks-properties-block
color
inline-properties inheritable-properties
id
keeps-and-breaks-properties-block keeps-and-breaks-properties-inline
keeps-and-breaks-properties-inline keeps-and-breaks-properties-atomic
keep-together
keep-together.within-line
keep-together.within-column
keep-together.within-page
margin-properties-block margin-properties-CSS
space-after
space-after.optimum
space-before
space-before.optimum
start-indent
end-indent
margin-properties-CSS margin
margin-bottom
margin-left
margin-right
margin-top
margin-properties-inline margin-properties-block
space-start
space-start.optimum
space-end
space-end.optimum
region-properties border-padding-background-properties
area-properties
region-name
side-region-properties region-properties
extent
Setting Up CUPS
The delivery manager requires CUPS to print and fax documents. This section describes
how to set up CUPS for printing and faxing on RedHat Linux.
The following diagram shows the integration between XML Publisher and CUPS:
The following procedures describe how to add a printer or fax to CUPS and how to
test your setup. For more information, see the CUPS Software Administrators Manual
(http://www.cups.org/doc-1.1/sam.html) and the Redhat Advanced Server online help.
Prerequisites
• RedHat Advanced Server 3.0
• Fax Modem connected to the Linux box
• Development Tools for the RedHat Advanced Server installed
Example:
/usr/bin/lp -d efax1 -t 5556231 myfax.pdf
Windows XP Setup
This section describes how to set up Internet Printing Protocol (IPP) on a Windows
XP server.
Prerequisite:
Microsoft Windows XP
• With World Wide Web Service highlighted, select Details. Ensure that Printers
virtual directory is selected (shown in the following figure).
6. Open a browser in a remote machine and enter the following URL: http://<your
server name>/printers
You will see the list of shared printers.
A configuration file
administration interface, 5-1 <properties> element, 10-3
alignment <root> element, 10-2
RTF template, 6-39 structure, 10-2
Analyzer for Excel, 2-11 xmlp-server-config.xml, 5-13
context command, 6-110
copy report, 3-14
B cross-tab reports, 6-87
background support CUPS setup, B-1
RTF templates, 6-43
barcode formatting, 6-105
D
APIs, 11-55
bidirectional language alignment data engine
RTF template, 6-39 api, 9-20
body tags data sources
PDF template, 8-7 adding, 5-1
RTF template, 6-13 data template
bookmarks calling, 9-20
generating PDF bookmarks from an RTF constructing, 9-4
template, 6-53 data template definition, 9-1
inserting in RTF templates, 6-50 date fields in RTF templates, 6-42
brought forward/carried forward page totals, 6-69 delete report, 3-15
bursting engine, 11-42 display
setting language, 1-2
download report, 3-15
C drawing support, 6-27
calculations in PDF template, 8-12 drop-down form field support
calendar profile option, 6-103 RTF templates, 6-55
calendar specification, 6-103 dynamic data columns, 6-90
cell highlighting example, 6-91
conditional in RTF templates, 6-64 dynamic table of contents in RTF template, 6-53
charts
building in RTF templates, 6-16 E
check box placeholder
creating in PDF template, 8-5 end on even page, 6-49
check box support even page
RTF templates, 6-53 force report to end on, 6-49
choose statements, 6-59 Excel Analyzer, 2-11
clip art support, 6-27 prerequisites, 2-11
columns
fixed width in tables, 6-40 F
conditional columns
fixed-width columns
rtf template, 6-61
RTF templates, 6-40
conditional formatting, 6-57
FO
table rows, 6-63
supported elements, A-1
conditional formatting features, 6-57
Index-1
FO elements L
using in RTF templates, 6-114, 7-5 language
font definitions setting display language, 1-2
configuration file, 10-12 setting report preference, 1-2
font fallback mechanism, 10-15 last page
fonts support for special content, 6-47
external, 6-104 ldap
setting up, 6-104 integration, 5-5
footers locale
RTF template, 6-13 setting report preference, 1-2
for-each-group XSL 2.0 standard, 6-74 locales
form field method configuration file, 10-14
inserting placeholders, 6-7
form field properties options in PDF template, 8-4
form fields in the PDF template, 8-3 M
formatting options in PDF templates, 8-4 markup
adding to the PDF template, 8-3
adding to the RTF template, 6-6
G merging PDF files, 11-27
Generate XLIFF button, 4-6 multicolumn page support, 6-42
groups multiple headers and footers
basic RTF method, 6-10 RTF template, 6-13
defining in PDF template, 8-6
defining in RTF template, 6-9
syntax, 6-10 N
defining in RTF templates, 6-5 Namespace support in RTF template, 6-109
form field method, 6-11 naming standards
grouping scenarios in RTF template, 6-10 translated files, 4-5
in RTF templates, 6-4 native page breaks and page numbering, 6-38
nulls
how to test for in XML data, 6-73
H
headers and footers
different first page , 6-14 O
different odd and even pages, 6-14 Out of memory error
inserting placeholders, 6-13 avoiding, 10-4
multiple, 6-13 overflow data in PDF templates, 8-15
resetting within one output file, 6-85
RTF template, 6-13
hidden text P
support in RTF templates, 6-39 page breaks
horizontal table break, 6-90 PDF templates, 8-8
hyperlinks RTF template, 6-38, 6-45
bookmarks, 6-50 page breaks and page numbering
dynamic, 6-50 native support, 6-38
inserting in RTF template, 6-50 page number
internal, 6-50 setting initial
static, 6-50 RTF templates, 6-46
page numbers
PDF templates, 8-8
I restarting within one output file, 6-85
IF statements RTF template, 6-38
in free-form text, 6-58 page totals
if statements, 6-57, 6-57 brought forward/carried forward, 6-69
if-then-else statements, 6-59 inserting in RTF template, 6-66
images password
including in RTF template, 6-14 changing, 1-2
PDF files
Index-2
merging, 11-27 rename report, 3-14
PDF template repeating elements
adding markup, 8-3 See groups
placeholders report actions
types of, 8-4 copy, 3-14
PDF templates delete report, 3-15
completed example, 8-13 download, 3-15
creating from downloaded file, 8-15 rename, 3-14
defining groups, 8-6 report actions icon, 3-13
definition of, 8-1 report file, 4-6
overflow data, 8-15 Rich Text Format (RTF)
page breaks, 8-8 definition, 6-1
page numbering, 8-8 row breaking
placeholders preventing in RTF templates, 6-40
check box, 8-5 row formatting
radio button group, 8-6 conditional, 6-63
text, 8-4 RTF placeholders
placement of repeating fields at runtime, 8-14 syntax, 6-6
runtime behaviors, 8-14 RTF template
sample purchase order template, 8-2 adding markup, 6-6
saving as Adobe Acrobat 5.0 compatible, 8-1 applying design elements, 6-5
sources for document templates, 8-1 definition, 6-1
supported modes, 8-1 designing, 6-2
when to use, 8-1 groups, 6-4
placeholders including images, 6-14
basic RTF method, 6-6, 6-6 native formatting features, 6-38
form field RTF method, 6-6, 6-7 placeholders, 6-4
in PDF templates, 8-3 prerequisites, 6-2
in RTF templates, 6-4 sample template design, 6-2
defining, 6-5, 6-6 supported modes, 6-1
inserting in the header and footer of RTF basic method, 6-1
template, 6-13 form field method, 6-1
PDF templates using XSL or XSL:FO, 6-1
check box, 8-5 RTF template design
radio button group, 8-6 headers and footers, 6-13
text, 8-4 RTF template placeholders, 6-6
types of, 8-4 running totals
predefined fonts, 10-15 RTF templates, 6-72
preferences
setting, 1-2
setting display language, 1-2 S
setting passwords, 1-2 sample RTF template
setting report locale, 1-2 completed markup, 6-9
SVG settings, 1-2 section context command, 6-85
printers security
setup model, 5-2
Unix/Linux, B-1 setRowsetTag method, 9-23
Windows XP, B-5 setRowsTag method, 9-23
properties setSQL method, 9-23
setting at template level, 6-83 setting the initial page number
properties element RTF templates, 6-46
configuration file, 10-3 shape support, 6-27
single sign-on
setting up, 5-18
R sorting
radio button group RTF template, 6-73
creating in PDF templates, 8-6 SQL functions
regrouping, 6-74 using in RTF templates, 6-106
Index-3
XML Publisher syntax for, 7-1 U
SQL functions extended for XML Publisher, 7-1 updateable variables
svg RTF templates, 6-81
enabling and disabling for HTML, 1-2
syntax
RTF template placeholder, 6-6 V
variables
T RTF templates, 6-81
table borders
configure overlapping borders, 10-9 W
table features watermarks
fixed-width columns, 6-40 RTF templates, 6-43
preventing rows breaking across pages
RTF template, 6-40
text truncation, 6-41 X
table features XLIFF files
repeating table headers naming, 4-5
RTF template, 6-39 report file, 4-6
RTF template, 6-39 uploading, 4-5
table of contents support XML data file
RTF template, 6-53 example, 6-3
dynamic TOC, 6-53 XML file
tables how to read, 6-4
horizontal table break, 6-90 XPath Support in RTF Templates, 6-106
Template Builder, 6-2 XSL elements
text placeholder apply a template rule, 6-112
creating in PDF template, 8-4 call template, 6-113
text truncation in tables, 6-41 copy the current node, 6-112
totals define the root element of the stylesheet, 6-113
brought forward/carried forward, 6-69 import stylesheet, 6-113
inserting page totals in RTF template, 6-66 template declaration, 6-113
running using in RTF templates, 6-112
RTF templates, 6-72 variable declaration, 6-113
translating, 4-6 XML Publisher syntax for , 7-4
translations, 4-6 XSL:FO elements
naming standards, 4-5 using in RTF templates, 6-106
Index-4
Index-5