Saturday, April 19, 2014

XML publisher Tips

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?>

No comments:

Post a Comment

Types of animations

Animation is a diverse and creative field with a variety of styles that artists and filmmakers use to bring their visions to life. Here are ...