Академический Документы
Профессиональный Документы
Культура Документы
Destinations
XML / EFT / EDI
Many Types of Report Outputs
Classic Reporting Tools Issue
Report file
Translation
Less flexibility
XML Publisher Reporting Paradigm
Separate data / layout / translation
Data Logic
Layout
XML Publisher
Report
Translation
output
More flexibility
Reduced maintenance
XML Publisher Overview
Translations PDF
Email
XLIFF Translations
RTF
HTML Printer
Excel
XML Publisher Fax
Application
Logic
XSL XML
External
•Word EFT
HTML
XML Publisher
EXCEL
RTF
EDI
Control HTML
Batch
Data File
PDF
XML
Publisher
XML
Templates
Quality, Performance, Security and Language Support are the main features
of XML Publisher.
Benefits for all Stakeholders
End User
• Consistent user interface
• Report in multiple formats
• Language and locale options
• Multiple delivery channels
Creating Groups
Use Of Tables
Conditional Formatting
Sorting
Dynamic Columns
Follow the following screen shots to add the Table of Invoices to the RTF file.
RTF Template Basics (Cont..)
In the Table wizard window, select the Table option and click Next.
RTF Template Basics (Cont..)
For the Grouping field select the last item with list of Invoices from the drop down
list. Click Next.
RTF Template Basics (Cont..)
Select the fields shown in the image below and move them into the right pane.
Click Next.
RTF Template Basics (Cont..)
Select the fields shown in the image below and move them into the right pane.
Click Next.
RTF Template Basics (Cont..)
In the Sort by window, select Transaction Date from the drop-down list. Let the
sort be Ascending order, which is default. Click Finish.
RTF Template Basics (Cont..)
1. Create a form-field
2. Write the text “<?for-each:GROUP_NAME?>” in the “help text“of the form-
field. This indicates the starting of the GROUP. Where GROUP_NAME is the
“Group Element Tag Name” in the XML output.
3. Create another form-field and write the text “<?end for-each?>” in the “help
text” of the form-field. This indicates the end of the GROUP.
4. Create as many form-fields, to display the records of the group, in between
the above 2 form-fields
Use Of Tables
Table -> Insert -> Enter Number of Setting Row height and Width
columns and number of rows
Use Of Tables (Cont..)
Setting Row height and Width Preventing the Row Breaking and Header to
repeat on each page
Conditional Formatting
Conditional Formatting occurs when a formatting element appears only when a
certain condition is met. For eg. You can specify that if a report number reach
certain threshold, they will be displayed in red.
If Statements:
1. Insert the following syntax to designate the beginning of the conditional area.
<?if:condition?>
2. Insert the following syntax at the end of conditional area: <?end if?>
Use the following RTF and XML file to test the conditional Formatting. In this
example the report will print the output only if the vendor ‘ABC Ltd’ and if the
entered amount is greater than 100 then the amount will be highlighted.
Number and Date Formatting
Adding Page Numbers
To add page numbers, define a field in the template where you want the page
number to appear and enter an initial value in that field as follows:
Decide the position on the template where you want the page number to
be displayed.
Create a placeholder field called @pagenum@
Enter a starting value for the page number in the Default field. If the XML data
includes a value for this field, the start value assigned in the template will be
overridden. If no start value is assigned, it will default to 1. The fig below shows
the Field Properties dialog for a page number field:
Adding Page Breaks
You can define a page break in your template to occur after a repeatable field. To insert a
page break after the occurrence of a specific field, add the following to the syntax in the
Short Description field of the Field Properties dialog box
page_break="yes"
For example:
<?rep_field="T1_G3", page_break="yes"?>
We want to report the salary information for each employee by department as shown in
the following template
Adding Page Breaks (Cont..)
Example:
To insert a page break after each department, insert the page break syntax in the
Short Description (or Tooltip field) for the SUMSALPERDEPTNO field as follows:
<?rep_field="T1_G3", page_break="yes"?> The Field Properties dialog box for the
field is shown in the following figure
Printing Summary in the Last Page
In this example we will discuss about the summary or content that needs to be
displayed on the last page of the document only.
Use the below attached RTF, XML and Output file.
In second page, define a section break and enter last page header and body.
Printing Summary in the Last Page
(Cont..)
XML Basics
Introduction
– What is XML?
•You create your own elements and you assign them any name you
like, hence the term extensible.
XML document
XML and HTML …
•XML is not a replacement for HTML
•XML allows the author to define his own tags and his own document
structure, hence the term extensible.
The Anatomy of XML Document
<?xml version:”1.0”?>
XML Processing
Declaration instruction
<?xml-stylesheet type="text/xsl" href=“template.xsl"?>
•Attributes
• Describes an element; e.g. data type, data range, etc.
• Can only appear on beginning tag
– Example: <Book ISBN = “1-111-123”>
•Processing instructions
• Encoding specification (Unicode by default)
• Namespace declaration
• Schema declaration
XML declaration
•The XML declaration looks like this:
– Names must not start with the letters xml (or XML or Xml ..)
• <Book>
…
<Publisher> McGraw Hill </Publisher>
…
</Book>
Implementation Steps
Practice Assignment 1
Practice Assignment 2
Practice Assignment 3
include_null_Element Indicates whether to remove or keep the null elements in the output.
Valid values are:
True (default)
False
xml_tag_case Allows you to set the case for the output XML element names.
Valid values are:
upper (default)
lower
as_are (The case will follow the definition in the dataStructure section.)
db_fetch_size Sets the number of rows fetched at a time through the jdbc connection. The default value is 500.
scalable_mode Sets the data engine to execute in scalable mode. This is required when processing a large volume of data.
Valid values:
on
off (default)
include_rowsettag Allows you to include or exclude the Rowset Tag from the output.
Valid values:
true (default)
false
Lexical Reference
Architecture Cont… Data Triggers
Example – Data Triggers
Before Report Trigger
Source The name of the column that contains the data on which the
summary calculation is to be performed. The source remains
unchanged
Function The aggregation function to be performed. The type tells the
XDO Engine how to compute the summary column values.
Valid Values are :-
SUM()
AVG()
COUNT()
MAX()
MIN()
Example – Summary Column
Summary Function
Architecture Cont… Formula Col, Place Holder
•Requirement – Report need column segment1 and description in Report Output.
•SQL Query will call Database Function ( Formula Column ) and Database Function (
Formula Column)
•To return both the value to Report.
•
Example – Formula Column + Place
Holder
Creating Groups
Use Of Tables
Conditional Formatting
Logos/Digital Signatures
Sorting
Dynamic Columns
2-3 <?xdofx:2-3?>
2*3 <?xdofx:2*3?>
2/3 <?xdofx:2/3?>
2**3 <?xdofx:2**3?>
3||2 <?xdofx:3||2?>
lpad('aaa',10,'.') <?xdofx:lpad('aaa',10,'.')?>
rpad('aaa',10,'.') <?xdofx:rpad('aaa',10,'.')?>
decode('xxx','bbb','ccc','xxx','ddd') <?xdofx:decode('xxx','bbb','ccc','xxx','ddd')?>
Instr('abcabcabc','a',2) <?xdofx:Instr('abcabcabc','a',2)?>
substr('abcdefg',2,3) <?xdofx:substr('abcdefg',2,3)?>
replace(name,'John','Jon') <?xdofx:replace(name,'John','Jon')?>
to_number('12345') <?xdofx:to_number('12345')?>
Extended Function Support in RTF Templates
(Cont..)
SQL Statement or XSL Expression Usage
to_char(12345) <?xdofx:to_char('12345')?>
to_date <?xdofx:to_date ( char [, fmt [, 'nlsparam']] )
sysdate() <?xdofx:sysdate()?>
Minimum <?xdoxslt:minimum(ELEMENT_NAME)?>
Maximum <?xdoxslt:minimum(ELEMENT_NAME)?>
Maximum <?xdoxslt:maximum(ELEMENT_NAME)?>
Chr <?xdofx:chr(n)?>
Ceil <?xdofx:ceil(n)?>
Floor <?xdofx:floor(n)?>
round <?xdofx:round ( number [, integer ] )?>
Lower <?xdofx:lower (char)?>
Upper <?xdofx:upper(char)?>
Length <?xdofx:length(char)?>
Greatest <?xdofx:greatest ( expr [, expr]... )?>
Least <?xdofx:least ( expr [, expr]... )?>
Extended Function Support in RTF
Templates (Cont..)
Dynamic Columns
•The ability to construct dynamic data columns is a very powerful feature of the RTF template.
Using this feature you can design a template that will correctly render a table when the number
of columns required by the data is variable.
•For example, you are designing a template to display columns of test scores within specific
ranges. However, you do not how many ranges will have data to report. You can define a dynamic
data column to split into the correct number of columns at runtime.
•Use the following tags to accommodate the dynamic formatting required to render the data
correctly:
• Dynamic Column Header
• <?split-column-header:group element name?>
• Use this tag to define which group to split for the column headers of a table.
Dynamic Columns (Cont..)
•Use one of these tags to define the width of the column when the width is described in the XML
data.
Defining Columns (Cont..)
•Sample Files :
RTF Template - 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.
• Using a parameter in a template
•2. Refer to the parameter in the template by prefixing the name with a "$" character. For
example, if you declare the parameter name to be "InvThresh", then reference the value using
"$InvThresh".
RTF Template – Parameters (Cont..)
RTF Template – Parameters (Cont..)
RTF Template – Parameters (Cont..)
Sample Files:
RTF Template – 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.
•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.
RTF Template – Variables &
Calculations - Example
Declare Variable
Variable Name - ORIG_AMT
RTF Template – Variables &
Calculations - Example
Display Variable
RTF Template – Variables &
Calculations - Example
•Sample Files
Bursting using XML Publisher
EDI
Control HTML
Batch
Data File
PDF
XML
Publisher
XML
Templates