Showing posts with label XML publisher. Show all posts
Showing posts with label XML publisher. Show all posts

Monday, 2 December 2013

Useful XML Publisher Report Syntax



Useful XML Publisher Report Syntax
Sub Templates:
<?template:header?>
This is Last Page
<?end template?>

After that you can type in header or footer section,
<?call:header?>

Last Page:
Take the any one of the insert field type in the following syntax,
Suppose,
Field name : Last page body
Status bar: <?start@last-page-first:body?><?end body?>
This is last page

Page Break:
<?split-by-page-break:?>

Section Break:
<?for-each@section:G_CUSTOMER(This is group name)?>

Properties:
<?PASSWORD?>
In XML we have to write in,
<PASSWORD>welcome</PASSWORD>

Bar Code:
<?register-barcode-vendor:'oracle.apps.xdo.template.rtf.util.barcoder.BarcodeUtil';'XMLPBarVendor'?>

<?format-barcode:JOB;'code128a';'XMLPBarVendor'?>

Conditional Formating:
<?if:ACCTD_AMT(This is column name)<1000?><xsl:attribute xdofo:ctx="block" or “incontext” name="font-weight">bold</xsl:attribute><?end if?>
Incontext means: column level
Block means: row level


Multi Layout:
<?choose:?>
<?when:CF_CHOICE=’VENDOR’?>
VENDOR NUMBER
VENDOR NAME
LOOKUP CODE
oplv VENDNUM
VENDNAME
FLAG  eloop

<?end when?>


<?when:CF_CHOICE=’INVOICE’?>

INVOICE NUMBER
DESCRIPTION
VENDOR ID
opli invoicenum
desc
FLAG  eloop

<?end when?>

<?when:CF_CHOICE=’PO’?>

PO NUMBER
POVENDOR
STATUS
oplpo PONUM
POVENDOR
STATUS  eloop

<?end when?>

<?end choose?>

Running Total:
<?xdoxslt:set_variable($_XDOCTX, 'RTotVar', xdoxslt:get_variable($_XDOCTX, 'RTotVar') + ACCTD_AMT(This is column name) )?><?xdoxslt:get_variable($_XDOCTX, 'RTotVar')?>

RTotVar means declare variable=0

Brought forward and carried Forward:

<xdofo: inline-total display-condition="exceptfirst" name="EntAmt"(This is column name)>Brought Forward: <xdofo:show-brought-forward name="EntAmt" (This is column name)format="99G999G999D00"/></xdofo:inline-total>

<xdofo:inline-total display-condition="exceptfirst" name="EntAmt"(This is column name)><xdofo:show-brought-forward name="AcctAmt" (This is column name)format="99G999G999D00"/></xdofo:inline-total>
<xdofo:inline-total display-condition="exceptlast" name="EntAmt"(This is column name)
>Carried Forward:   <xdofo:show-carry-forward name="EntAmt" (This is column name)
format="99G999G999D00"/></xdofo:inline-total>
<xdofo:inline-total display-condition="exceptlast" name="AcctAmt"(This is column name)
><xdofo:show-carry-forward name="AcctAmt" (This is column name)
format="99G999G999D00"/></xdofo:inline-total>

<?show-page-total:EntAmt(This is column name)
;"99G999G999D00"?>

<?show-page-total:AcctAmt(This is column name)
;"99G999G999D00"?>


Page Total:
<?show-page-total:pt(This is parameter);'#,##0.00'?>

Repeating Headre:

for-each@section G_CUSTOMER
CUSTOMER_NAME


for-each G_CURRENCY


Trx Number
Trx Date
Trx Amount
Trx Amount Remaining
for-each G_INVOICES TRX_NUMBER
TRANSACTION_DATE
TRANS_AMOUNT
TRANS_AMOUNT_REMAINING end for-each

end for-each
end for-each

Friday, 15 November 2013

XML publisher Tips

1)  IF ELSE’ condition in XML publisher
2)  How to get SYSDATE in the header section dynamically when we run the report
3)  What are the XML publisher tables?
4)  How to write a loop in rtf template design?
5)  How to design sub templates in rtf layout?
6)  How to call a header or footer?
7)  How to break the page in specific condition?
8)  How to use section break?
9)  How to create multi layouts in XMLP?
10) How to submit a layout in the backend?
11) How to display the images in XMLP?
12) How to pass the page numbers in rtf layout?
13) How to display last page is differently in XML Publisher Reports.
14) Useful XML Publisher Report Syntax 


1) ‘IF ELSE’ condition in XML publisher 
XML Publisher supports the common programming construct “if-then-else”. This is extremely useful when you need to test a condition and conditionally show a result. For example:
IF X=0 THEN
Y=2

ELSE
Y=3

END IF
You can also nest these statements as follows:
IF X=0 THEN
Y=2

ELSE
IF X=1 THEN

Y=10
ELSE Y=100

END IF
Use the following syntax to construct an if-then-else statement in your RTF template:
<?xdofx:if element_condition then result1 else result2 end if?>
For example, 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'
if AMOUNT < 1000 then 'Lower'
Else

'Equal'
end if?>








  2) How to get SYSDATE in the header section dynamically when we run the report
You cannot insert form fields in the Header section, but you can just insert the code to achieve this. For example: insert this in the header section to view the sysdate: You could format the date as you would like..

<?xdofx: sysdate(‘YYYY-MM-DD’)?>


 3)  What are the XML publisher tables?

 PER_GB_XDO_TEMPLATES
XDO_DS_DEFINITIONS_B
XDO_DS_DEFINITIONS_TL
XDO_DS_DEFINITIONS_VL
XDO_LOBS
XDO_TEMPLATES_B
XDO_TEMPLATES_TL

XDO_TEMPLATES_VL
XDO_TEMPLATE_FIELDS
XDO_TRANS_UNITS
XDO_TRANS_UNIT_PROPS
XDO_TRANS_UNIT_VALUES

4) How to write a loop in rtf template design?
<? For-each:G_invoice_no?>
     ……………………..<? End for each?>

5)  How to design sub templates in rtf layout?
Using following tags..
  <? Template: template_name?>
          This is Last Page
                            <? End template?>

6)  How to call a header or footer?
Using this tag
 <?call:header?> and <?call:footer?>
    We have to use header section and footer section of the page.
7)  How to break the page in specific condition?
<?split-by-page-break:?>
8)  How to use section break?
<?for-each@section:G_CUSTOMER(This is group name)?>
9)  How to create multi layouts in XMLP?
<?choose:?>
          <?when:CF_CHOICE=’VENDOR’?>
            Your template….
          <?end when?>
                   <?when:CF_CHOICE=’INVOICE’?>
                   Your template….
                   <?end when?>
                        <?when:CF_CHOICE=’RECEIPT’?>
                         Your template….
                        <?end when?>
<?end choose?>

10) How to submit a layout in the backend?
we have to write a procedure for this using the below code
FND_REQUEST.ADD_LAYOUT                         (     TEMPLATE_APPL_NAME      => 'application name',
TEMPLATE_CODE           => 'your template code',
TEMPLATE_LANGUAGE       => 'En',
TEMPLATE_TERRITORY      => 'US',
OUTPUT_FORMAT           => 'PDF'
);

11) How to display the images in XMLP?
url:{'http://image location'}
                 For example, enter:
                   url:{'http://www.oracle.com/images/ora_log.gif'}
                      url:{'${OA_MEDIA}/image name'}

12) How to pass the page numbers in rtf layout?
<REPORT>
<PAGESTART>200<\PAGESTART>
....
</REPORT>

13) How to display last page is differently in XML Publisher Reports.
<?start@last-page-first:body?>    <?end body?>