1.) Define Header some where in the page as per requirement. (call header )
<?Call:header?>
<?template: header?>
<?end template?>
——————————
2) For body Contents
<?start:body?>
<?end body?>
——————————
3)Last Page Only Content:
Insert the following syntax on the final page:
<?start@last-page:body?>
<?end body?>
——————————
4) Sort (Data sorting)
<?sort:trx_number?>
Sort descending
<?sort:trx_number;data-type=‘number’;order=‘descending’?>
multiple sort tags
<?sort:trx_number?><?sort:trx_date?&g
—————————–
Oracle Number Format Mask
<?format-number:fieldname;’999G999D99’?>
——————————
Mask Output for US Locale
– SHORT =2/31/99
– MEDIUM =Dec 31, 1999
– LONG =Friday, December 31, 1999
– SHORT_TIME =12/31/99 6:15 PM
– MEDIUM_TIME =Dec 31, 1999 6:15 PM
– LONG_TIME =Friday, December 31, 1999 6:15 PM
– SHORT_TIME_TZ =12/31/99 6:15 PM GMT
– MEDIUM_TIME_TZ =Dec 31, 1999 6:15 PM GMT
– LONG_TIME_TZ =Friday, December 31, 1999 6:15 PM GMT
4) Page Breaks:
<?split-by-page-break:?>
——————————
5)Arthemitical Calculated Fields:
<?field1 + field2?>
<?field1 – field2?>
<?field1 * field2?>
<?field1 / field2?>
——————————
6) Dynamic data columns:
Dynamic Column Header
<?split-column-header:group element name?>
Dynamic Column Data
<?split-column-data: group element name?>
——————————
7)Rows per page:
Define row counter variable in a form field
<?xdoxslt:set_variable($_XDOCTX, ’Counter’, 0)?>
Increment counter for each line (again in a form field)
<?xdoxslt:set_variable($_XDOCTX, ’Counter’, xdoxslt:
get_variable($_XDOCTX, ’Counter’) + 1)?>
Break if the number of rows is reached (say 6 rows in this example)
<?if: xdoxslt:get_variable($_XDOCTX, ’Counter’) mod 6=0?>
<?split-by-page-break:?>
<?end if?
——————————
8)Re-grouping XML Data:
Not limited by the structure of the data source
Use the tags
<?for-each-group: BASE-GROUP;GROUPING-ELEMENT?>
<?end for-each-group?>
Can establish nested groupings
<?for-each:current-group(); GROUPING-ELEMENT?>
<?end for-each-group?>
——————————
9)Conditional Cell Highlighting
Allows to conditionally highlight individual cells, columns, or rows in final output.
<?if:XML_ELEMENT>Value?>
<xsl:attribute xdofo:ctx=”block” name=”background-color”>COLOR
</xsl:attribute>
<?end-if?>
——————————
10)Page totals:
Declare variable to hold page totals, following data element declaration
<?add-page-total:TotalFieldName;’element’?>
Display total field
<?show-page-total:TotalFieldName;’Oracle-number-format’?>
——————————
11) If no data found message in a report
<?if:CS_CNT_ORD =0?>*************NO DATA FOUND*************<?end if?>
——————————
12) SQL Functions
lpad function
<?xdofx:lpad(‘aaa’,10,’.’)?>
——————————
Concatenation Function
<?xdofx:3||2?>
——————————
rpad function
<?xdofx:rpad(‘aaa’,10,’.’)?>
trim function
<?xdoxslt:trim(‘ a ‘)?>
ltrim function
<?xdoxslt:ltrim(‘ a ‘)?>
rtrim function
<?xdoxslt:rtrim(‘ a ‘)?>
decode function
<?xdofx:decode(‘xxx’,’bbb’,’ccc’,’xxx’,’ddd’)?>
Instr function
<?xdofx:Instr(‘abcabcabc’,’a’,2)?>
substr function
<?xdofx:substr(‘abcdefg’,2,3)?>
left function
<?xdoxslt:left(‘abcdefg’, 3)?>
right function
<?xdoxslt:right(‘abcdefg’, 3)?>
replace function
<?xdofx:replace(name,’John’,’Jon’)?>
to_number function
<?xdofx:to_number(‘12345’)?>
sysdate function
<?xdofx:sysdate()?>
<?xdofx:sysdate(‘dd-mon-yyyy’)?>
<?xdofx:sysdate(‘dd-mm-yyyy’)?>
<?xdofx:sysdate(‘day-dd-month-yyyy’)?>
lower
<?xdofx:lower (char)?>
upper
<?xdofx:upper(char)?>
length
<?xdofx:length(char)?>
——————————
Returns the minimum value of the element in the set
<?xdoxslt:minimum(ELEMENT_NAME)?>
Returns the maximum value of the element in the set.
<?xdoxslt:maximum(ELEMENT_NAME)?>
——————————
Copy the Current Node
Use this element to create a copy of the current node.
XSL Syntax: <xsl:copy-of select=”name”>
BI Publisher Tag: <?copy-of:name?>
——————————
xxx) Call Template
XSL Syntax: <xsl:call-template name=”name”>
BI Publisher Tag: <?call-template:name?>
xxx-1) Call Template – Template Declaration
XSL Syntax: <xsl:template name=”name”>
BI Publisher Tag: <?template:name?>
——————————
Import Stylesheet
XSL Syntax: <xsl:import href=”url”>
BI Publisher Tag: <?import:url?>
——————————–
Variables
Declaration and Assigning Value
<?xdoxslt:set_variable($_XDOCTX,‘variable name’, 0)?>
Variables -1
Sets the value of variable_name to the current value plus the element amount
xdoxslt:set_variable($_XDOCTX,‘variable name’, xdoxslt:get_variable($_XDOCTX,‘variable name’)+element name)
Variables -2
Get Value
<?xdoxslt:get_variable($_XDOCTX, ‘variable name’)?>
Oracle Number Format Mask
<?format-number:fieldname;’999G999D99’?>
——————————
<?format-date:fieldname;’MASK’?>
Mask Output for US Locale
– SHORT =2/31/99
– MEDIUM =Dec 31, 1999
– LONG =Friday, December 31, 1999
– SHORT_TIME =12/31/99 6:15 PM
– MEDIUM_TIME =Dec 31, 1999 6:15 PM
– LONG_TIME =Friday, December 31, 1999 6:15 PM
– SHORT_TIME_TZ =12/31/99 6:15 PM GMT
– MEDIUM_TIME_TZ =Dec 31, 1999 6:15 PM GMT
– LONG_TIME_TZ =Friday, December 31, 1999 6:15 PM GMT
—————————–
for-each loop
<?for-each:XML group element tag name?>
<?end for-each?>
———————
IF Stament
– <?if:boolean_test?>
<?end if?>
<?if:LINE_TYPE=’LINE’ ?>
<?end if?>
——————————
Rows per page (Examples 6 rows per pages)
Define row counter variable in a form field
<?xdoxslt:set_variable($_XDOCTX, ’Counter’, 0)?>
Increment counter for each line (again in a form field)
<?xdoxslt:set_variable($_XDOCTX, ’Counter’, xdoxslt:
get_variable($_XDOCTX, ’Counter’) + 1)?>
Break if the number of rows is reached (say 6 rows in this example)
<?if: xdoxslt:get_variable($_XDOCTX, ’Counter’) mod 6=0?>
<?split-by-page-break:?>
<?end if?
——–****************************************
xdo user guied xml tags
Defining Groups?
<?for-each:XML group element tag name?>
<?end for-each?>
Defining body area?
Use the following tags to enclose the body area of your report:
<?start:body?>
<?end body?>
Images ?
url:{IMAGE_LOCATION}
url:{concat(SERVER,’/’,IMAGE_DIR,’/’,IMAGE_FILE)}
url:{concat(‘${OA_MEDIA}’,’/’,IMAGE_FILE)}
To change a shape’s size along the x or y axis, use:
<?shape-size-x:RATIO?>
<?shape-size-y:RATIO?>
To insert Page Break?
Page Breaks
<?split-by-page-break:?>
To insert Initial Page number in different page?
Initial Page Number
<?initial-page-number:pagenumber?>
To display contents in last page?
Last Page Only Content
<?start@last-page:body?>
<?end body?>
End on Even or End on Odd Page
<?section:force-page-count;’end-on-even-layout’?>
To end on an even page with layout
<?section:force-page-count;’end-on-even-layout’?>
To end on an odd page layout:
<?section:force-page-count;’end-on-odd-layout’?>
Generating Bookmarks in PDF Output
<?copy-to-bookmark:?>
directly above your table of contents and
<?end copy-to-bookmark:?>
Check Boxes implimention XDOUserGuide page no – 172.
Drop Down Lists
Conditional Formatting
<?if:VENDOR_NAME=’COMPANY A’?>
<?end if?>
If-then-Else Statements XDOUserGuide page no – 178.
Choose Statements
<?choose:?>
<?when:expression?>
<?otherwise?>
Column Formatting XDOUserGuide page no – 180.
Row Formatting XDOUserGuide page no – 183.
Conditionally Displaying a Row
Conditionally Highlighting a Row
Cell Highlighting
Displaying Page Totals
<?add-page-total:TotalFieldName;’element’?>
<?show-page-total:TotalFieldName;’Oracle-number-format’?>
EG Oracle format mask (for example: C9G999D00)
Brought Forward/Carried Forward Totals XDOUserGuide page no – 191
<xdofo:inline-total
display-condition=”exceptfirst” <!–>
name=”InvAmt”>
Brought Forward: <!–>
<xdofo:show-brought-forward <!–>
name=”InvAmt”
format=”99G999G999D00″/>
</xdofo:inline-total>
<xdofo:inline-total
display-condition=”exceptlast” <!–>
name=”InvAmt”>
Carried Forward: <!–>
<xdofo:show-carry-forward <!–>
name=”InvAmt”
format=”99G999G999D00″/>
</xdofo:inline-total>
Running Totals
————–
Declares the “RTotVar”
variable and initializes it to 0.
<?xdoxslt:set_variable($_XDOCTX, ‘RTotVar’, 0)?>
Sets the value of RTotalVar to the current value plus the new Invoice Amount.
Retrieves the RTotalVar value for display.
<?xdoxslt:set_variable($_XDOCTX, ‘xml_tag’, xdoxslt:get_variable($_XDOCTX, ‘RTotVar’) + xml_tag)?><?xdoxslt:get_variable($_XDOCTX, ‘RTotVar’)?>
Data Handling
Sorting
———-
<?sort:xml_tag?>
<?sort:xml_tag1?> <?sort:xml_tag2?><?sort:xml_tag2?>
Regrouping
———-
To regroup the data, use the following syntax:
<?for-each-group: BASE-GROUP;GROUPING-ELEMENT?>
Regrouping by an Expression
To establish nested groupings within the already defined group, use the following
<?for-each:current-group(); GROUPING-ELEMENT?>
Using Variables
—————
Use the following syntax to declare/set a variable value:
<?xdoxslt:set_variable($_XDOCTX, ‘variable name’, value)?>
Use the following syntax to retrieve a variable value:
<?xdoxslt:get_variable($_XDOCTX, ‘variable name’)?>
You can use this method to perform calculations.
<?xdoxslt:set_variable($_XDOCTX, ‘x’, xdoxslt:get_variable($_XDOCTX, ‘x’+1)?>
Defining Parameters
——————-
Declare the parameter in the template.
Use the following syntax to declare the parameter:
<?param@begin:parameter_name;parameter_value?>
parameter_name is the name of the parameter
parameter_value is the default value for the parameter (the parameter_value is optional)
Setting Properties
Advanced Report Layouts
<?for-each@section:group name?>
where group_name is the name of the element for which you want to begin a new
section.
For example, the for-each grouping statement for this example will be as follows:
<?for-each@section:G_INVOICE?>
The closing <?end for-each?> tag is not changed.
Dynamic Data Columns
——————–
• Dynamic Column Header
<?split-column-header:group element name?>
• Dynamic Column <?split-column-data:group element name?>
• Dynamic Column Width
<?split-column-width:name?> or
<?split-column-width:@width?>
• Dynamic Column Width’s unit value (in points) <?split-column-width-unit:
value?>
Defining Columns to Repeat Across Pages
<?horizontal-break-table:number?>
Number and Formatting
Using the Oracle Format Mask for Number
<?format-number:fieldname;’999G999D99′?>
Date Formatting
Using the Oracle Format Mask for Date
<?format-date:date_string;’ABSTRACT_FORMAT_MASK’;’TIMEZONE’?>
or
<?format-date-and-calendar:date_string;
‘ABSTRACT_FORMAT_MASK’;’CALENDAR_NAME’;’TIMEZONE’?>
or
<?format-date:hiredate;’YYYY-MM-DD’?>
Calendar and Timezone Support tags are avaliable
Using External Fonts
1. Copy the font to your <WINDOWS_HOME>/fonts directory.
Advanced Barcode Formatting
Register the Barcode Encoding Class
Advanced Design Options
Locating Data
Using XSL Elements
Apply a Template Rule
———————
Use this element to apply a template rule to the current element’s child nodes.
XSL Syntax: <xsl:apply-templates select=”name”>
BI Publisher Tag: <?apply:name?>
This function applies to <xsl:template-match=”n”> where n is the element name.
Copy the Current Node
———————-
Use this element to create a copy of the current node.
XSL Syntax: <xsl:copy-of select=”name”>
BI Publisher Tag: <?copy-of:name?>
Call Template
————-
Use this element to call a named template to be inserted into or applied to the current
template. For example, use this feature to render a table multiple times.
XSL Syntax: <xsl:call-template name=”name”>
BI Publisher Tag: <?call-template:name?>
Template Declaration
——————–
Use this element to apply a set of rules when a specified node is matched.
XSL Syntax: <xsl:template name=”name”>
BI Publisher Tag: <?template:name?>
Variable Declaration
——————–
Use this element to declare a local or global variable.
XSL Syntax: <xsl:variable name=”name”>
BI 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.
XSL Syntax: <xsl:import href=”url”>
BI Publisher Tag: <?import:url?>
Define the Root Element of the Stylesheet
—————————————–
This and the <xsl:stylesheet> element are completely synonymous elements. Both are used to define the root element of the style sheet.
Note: An included style sheet has the same precedence as the including
style sheet.
XSL Syntax: <xsl:stylesheet xmlns:x=”url”>
BI Publisher Tag: <?namespace:x=url?>
Native XSL Number Formatting
Extended Function Support in RTF Templates
Extended SQL and XSL Functions
==========================================
2+3 <?xdofx:2+3?> Addition
2-3 <?xdofx:2-3?> Subtraction
2*3 <?xdofx:2*3?> Multiplication
2/3 <?xdofx:2/3?> Division
2**3 <?xdofx:2**3?> Exponential
3||2 <?xdofx:3||2?> Concatenation
———————————————
lpad(‘aaa’,10,’.’)
<?xdofx:lpad(‘aaa’,10,’.’)?>
lpad(string1,padded_length,[pad_string])
———————————————
rpad(‘aaa’,10,’.’)
<?xdofx:rpad(‘aaa’,10,’.’)?>
rpad(string1,padded_length,[pad_string])
———————————————
decode(‘xxx’,’bbb’,’ccc’,’xxx’,’ddd’)
<?xdofx:decode(‘xxx’,’bbb’,’ccc’,’xxx’,’ddd’)?>
decode(expression, search, result[,search, result]…[, default])
—————————————————————–
Instr(‘abcabcabc’,’a’,2)
<?xdofx:Instr(‘abcabcabc’,’a’,2)?>
instr(string1,string2,[start_position],[nth_appearance])
——————————————————–
substr(‘abcdefg’,2,3)
<?xdofx:substr(‘abcdefg’,2,3)?>
substr(string, start_position,[length])
———————————————
replace(name,’John’,’Jon’)
<?xdofx:replace(name,’John’,’Jon’)?>
replace(string1,string_to_replace,[replacement_string])
——————————————————-
to_number(‘12345’) <?xdofx:to_number(‘12345’)?>
———————————————-
to_char(12345) <?xdofx:to_char(‘12345’)?>
———————————————–
to_date <?xdofx:to_date ( char [, fmt [,’nlsparam’]] )
———————————————–
sysdate() <?xdofx:sysdate()?>
—————————————————-
minimum
<?xdoxslt:minimum(ELEMENT_NAME)?>
Returns the minimum value of the element in the set.
—————————————————-
maximum
<?xdoxslt:maximum(ELEMENT_NAME)?>
Returns the maximum value of the element in the set.
—————————————————-
chr <?xdofx:chr(n)?>
—————————————————-
ceil <?xdofx:ceil(n)?>
—————————————————-
round <?xdofx:round ( number [, integer ])?>
—————————————————-
lower <?xdofx:lower (char)?>
LOWER returns char, with all letters lowercase
—————————————————-
upper <?xdofx:upper(char)?>
UPPER returns char, with all letters uppercase.char can be any of the datatypes CHAR,VARCHAR2, NCHAR, NVARCHAR2, CLOB,or NCLOB
—————————————————-
length <?xdofx:length(char)?>
The “length” function returns the length of char
—————————————————-
greatest <?xdofx:greatest ( expr [, expr]… )?>
GREATEST returns the greatest of the list of exprs
—————————————————-
least <?xdofx:least ( expr [, expr]… )?>
LEAST returns the least of the list of exprs.
—————————————————-
–###########################################################
–LDT files For Oracle BI Publisher Stuff ( FNDLOAD Scripts )
–###########################################################
1.DATA_TEMPLATE (Data Source .xml file)
— ———————————————————-
–============================================================
— ———————————————————-
java oracle.apps.xdo.oa.util.XDOLoader DOWNLOAD -DB_USERNAME apps -DB_PASSWORD apps -JDBC_CONNECTION ‘(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=XX_HOST_NAME)(PORT=XX_PORT_NUMBER))(CONNECT_DATA=(SERVICE_NAME=XX_SERVICE_NAME)))’ -LOB_TYPE DATA_TEMPLATE -LOB_CODE XX_TEMPLATE -APPS_SHORT_NAME XXCUST -LANGUAGE en -lct_FILE $XDO_TOP/patch/115/import/xdotmpl.lct -LOG_FILE $LOG_FILE_NAME
java oracle.apps.xdo.oa.util.XDOLoader UPLOAD -DB_USERNAME apps -DB_PASSWORD apps -JDBC_CONNECTION ‘(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=XX_HOST_NAME)(PORT=XX_PORT_NUMBER))(CONNECT_DATA=(SERVICE_NAME=XX_SERVICE_NAME)))’ -LOB_TYPE DATA_TEMPLATE -LOB_CODE XX_TEMPLATE -XDO_FILE_TYPE XML -FILE_NAME $DATA_FILE_PATH/$DATA_FILE_NAME.xml -APPS_SHORT_NAME XXCUST -NLS_LANG en -TERRITORY US -LOG_FILE $LOG_FILE_NAME
2. RTF TEMPLATE (Report Layout .rtf file)
— ———————————————————-
–============================================================
— ———————————————————-
java oracle.apps.xdo.oa.util.XDOLoader DOWNLOAD -DB_USERNAME apps -DB_PASSWORD apps -JDBC_CONNECTION ‘(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=XX_HOST_NAME)(PORT=XX_PORT_NUMBER))(CONNECT_DATA=(SERVICE_NAME=XX_SERVICE_NAME)))’ -LOB_TYPE TEMPLATE -LOB_CODE XX_TEMPLATE -APPS_SHORT_NAME XXCUST -LANGUAGE en -TERRITORY US -lct_FILE $XDO_TOP/patch/115/import/xdotmpl.lct -LOG_FILE $LOG_FILE_NAME
java oracle.apps.xdo.oa.util.XDOLoader UPLOAD -DB_USERNAME apps -DB_PASSWORD apps -JDBC_CONNECTION ‘(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=XX_HOST_NAME)(PORT=XX_PORT_NUMBER))(CONNECT_DATA=(SERVICE_NAME=SERVICE_NAME)))’ -LOB_TYPE TEMPLATE -LOB_CODE XX_TEMPLATE -XDO_FILE_TYPE RTF -FILE_NAME $RTF_FILE_PATH/$RTF_FILE_NAME.rtf -APPS_SHORT_NAME XXCUST -NLS_LANG en -TERRITORY US -LOG_FILE $LOG_FILE_NAME
— ————————————————————- ———————————————————-
–============================================================
— ————————————————————- ———————————————————-
Query to find xml template and data definitions:
select b.concurrent_program_name,
c.user_concurrent_program_name,
b.output_file_type,
e.executable_name,
e.execution_file_name,
e.execution_method_code,
a.application_short_name ,
a.data_source_name “DATA DEFINITION NAME”,
a.data_source_code “DATA DEFINITION CODE”,
d.template_name “TEMPLATE NAME”,
d.template_code “TEMPLATE CODE”,
d.template_type_code,
d.default_language,
d.default_territory,
f.file_name
from xdo_ds_definitions_vl a,
fnd_concurrent_programs b,
fnd_concurrent_programs_tl c,
xdo_templates_vl d,
fnd_executables e,
xdo_lobs f
where a.data_source_code = b.concurrent_program_name
and b.concurrent_program_id = c.concurrent_program_id
and a.data_source_code = d.data_source_code
and e.executable_id = b.executable_id
and f.lob_code = d.template_code
and a.application_short_name = ‘FND’
and b.concurrent_program_name like ‘FNDSCURS’
and e.EXECUTION_METHOD_CODE like ‘P’
and f.file_name like ‘%.rtf’
ORDER BY EXECUTION_FILE_NAME
No comments:
Post a Comment