Wednesday, 30 December 2015

Xml Publisher ( How to Delete Data Definition & Template from Back end )

Script for deleting the datadefinition
------------------------------------------------>
BEGIN
XDO_DS_DEFINITIONS_PKG.DELETE_ROW('INV','<DataDefinationCode>');  
END;
--------------------------------------------------------
--------------------------------------------------------
script for deleting the template 
------------------------------------------------------>
BEGIN
XDO_TEMPLATES_PKG.DELETE_ROW('INV','<DataDefinationCode>');
END

Tuesday, 29 December 2015

UNION Tips

SELECT BATCH_NUMBER,FULL_NAME,LEAVE_TYPE
,DECODE(LEAVE_TYPE,'Casual',12,'Special',15,'Medical',10,'Unpaid Leave',SUM(NO_OF_DAYS)) TOTAL_DAYS
,SUM(NO_OF_DAYS) LEAVE_DAYS,
(DECODE(LEAVE_TYPE,'Casual',12,'Special',15,'Medical',10))-(SUM(NO_OF_DAYS)) available
FROM XXMPCD_AT_LEAVE_TYPE_DTLS WHERE FULL_NAME='RajaShekar'
GROUP BY BATCH_NUMBER,FULL_NAME,LEAVE_TYPE
UNION
SELECT NULL,NULL,
LOOKUP_CODE,(SELECT DECODE(LOOKUP_CODE,'Casual',12,'Special',15,'Medical',10) FROM
DUAL ) TOTAL_DAYS, 0 LEAVE_DAYS,(SELECT DECODE(LOOKUP_CODE,'Casual',12,'Special',15,'Medical',10) FROM
DUAL ) available FROM FND_LOOKUP_VALUES WHERE LOOKUP_TYPE='XXMPCD_LEAVE_TYPE' AND ENABLED_FLAG='Y' AND END_DATE_ACTIVE IS NULL
AND LOOKUP_CODE NOT IN  (
SELECT LEAVE_TYPE
FROM XXMPCD_AT_LEAVE_TYPE_DTLS WHERE FULL_NAME='RajaShekar'
GROUP BY BATCH_NUMBER,FULL_NAME,LEAVE_TYPE);

Saturday, 26 December 2015

Oracle dbms_scheduler examples with procedure


Create Schedule:
BEGIN
  DBMS_SCHEDULER.create_job (
    job_name        => 'XXJAI_UPDATE_TAX_VERSION',
    job_type        => 'PLSQL_BLOCK',
    job_action      => 'BEGIN XXJAI_PO_PKG; END;',
    start_date      => SYSTIMESTAMP,
    repeat_interval => 'freq=Secondly;',
    enabled         => TRUE);
END;

Drop Schedule:

BEGIN
  DBMS_SCHEDULER.drop_job (job_name => 'XXJAI_UPDATE_TAX_VERSION');
end;

Run Schedule Immediately:


begin
dbms_scheduler.run_job (job_name => 'run_load_sales');
end;

Repeat_Interval  with freq:

Yearly
Monthly
Weekly
Daily
Hourly
Minutely
Secondly

Example:

repeat_interval => 'freq=daily;byhour=22;byminute=30;bysecond=0'
repeat_interval => 'FREQ=MINUTELY;INTERVAL=1'
 repeat_interval => 'FREQ=DAILY;BYHOUR=1;BYMINUTE=0'
 repeat_interval => 'FREQ=MINUTELY;INTERVAL=3'

we can find schedule custom jobs by below query:
SELECT owner, job_name, enabled FROM dba_scheduler_jobs Where JOB_NAME like 'XX%

Friday, 25 December 2015

Authid definer and current_user Tips

AUTHID DEFINER V/S AUTHID CURRENT_USER

There are lot of times we get error in Oracle Apps while trying to execute the API's at development time, due to the AUTHID DEFINER and AUTHID CURRENT_USER. This article gives you good understanding about the AUTHID DEFINER and AUTHID CURRENT_USER.

A stored procedure runs either with the rights of the caller (AUTHID CURRENT_USER) or with the rights of the procedure's owner (AUTHID DEFINER). This behaviour is specified with the AUTHID clause. This authid clause immediatly follows thecreate procedurecreate functioncreate package or create type statement. It can be ommited, in which case the default authid definer is taken.


AUTHID DEFINER and AUTHID CURRENT_USER
-----------------------------------------------------------
AUTHID DEFINER:-
--------------------

Example:-
---------
The following are done in APPS scheme.

create table a (a_a number);

CREATE OR REPLACE PACKAGE XYZ AUTHID DEFINER
AS
PROCEDURE XYZ_1;
END XYZ;

CREATE OR REPLACE PACKAGE body XYZ
AS
PROCEDURE XYZ_1
IS
BEGIN
INSERT INTO A VALUES (1);
END XYZ_1;
END XYZ;

begin
xyz.XYZ_1;
end;

select * from a;

Provide grants for this package to other schema (scott) and create the synonym for the xyz package in scott.

grant all on to 

Example:-
---------

grant all on xyz to scott

Above command is run from the apps schema.

Now for the other schema SCOTT try to run the same query.

begin
xyz.XYZ_1;
end;

It have inserted new record in the 'A' table. Note there is no synonym for the table A in SCOTT schema.

Running this program from anywhere, it is as good as running from APPS schema in case of AUTHID DEFINER.

10.2) CURRENT_USER:-
----------------------

Example:-
-----------

The following are done in the APPS schema.

create table a (a_a number);

CREATE OR REPLACE PACKAGE XYZ AUTHID CURRENT_USER
AS
PROCEDURE XYZ_1;
END XYZ;

CREATE OR REPLACE PACKAGE body XYZ
AS
PROCEDURE XYZ_1
IS
BEGIN
INSERT INTO A VALUES (1);
END XYZ_1;
END XYZ;

begin
xyz.XYZ_1;
end;

select * from a;

Provide grants for this package to other schema (scott) and create the synonym for the xyz package in scott.

grant all on to 

Example:-
-----------

grant all on xyz to scott

Above command is run from the apps schema.

Now for the other schema (scott) try to run the same query.

begin
xyz.XYZ_1;
end;

Got the error message table or view doesn't exist for the A table.

Create view for the a table and run the same program again.

create synonym 'A' for table 'A'

begin
xyz.XYZ_1;
end;

select * from a;

Now there is no error. It is inserting the record with no issue.

WITH NO AUTHID DEFINER and AUTHID CURRENT_USER :-
-----------------------------------------------------------------------


Example:-
---------

The following are done in the APPS schema.

create table a (a_a number);

CREATE OR REPLACE PACKAGE XYZ
AS
PROCEDURE XYZ_1;
END XYZ;

CREATE OR REPLACE PACKAGE body XYZ
AS
PROCEDURE XYZ_1
IS
BEGIN
INSERT INTO A VALUES (1);
END XYZ_1;
END XYZ;

begin
xyz.XYZ_1;
end;

select * from a;

Provide grants for this package to other schema (scott) and create the synonym for the xyz package in scott.

grant all on to 

Example:-
---------

grant all on xyz to scott

Above command is run from the apps schema.

Now for the other schema SCOTT try to run the same query.


begin
xyz.XYZ_1;
end;

It is working in same way as it have done for the AUTHID DEFINER.

Q) Is it possible to know from the select statement if it is INVOKER(CURRENT_USER) or DEFINER

A) Yes, It is possible to get this information from the select statement. Use

SELECT dbo.object_name,
(DECODE(SIGN(bitand(options,16)),1,'INVOKER','DEFINER')) "authid"
FROM dba_objects dbo,
sys.PROCEDURE$ p
WHERE p.obj# = dbo.object_id
AND dbo.object_name = "Your Package Name"
AND dbo.object_type = 'PACKAGE'
AND dbo.owner = 'APPS'

Example:-
-----------

SELECT dbo.object_name,
(DECODE(SIGN(bitand(options,16)),1,'INVOKER','DEFINER')) "authid"
FROM dba_objects dbo,
sys.PROCEDURE$ p
WHERE p.obj# = dbo.object_id
AND dbo.object_name = 'ASO_APR_WF_INT'
AND dbo.object_type = 'PACKAGE'
AND dbo.owner = 'APPS'

Friday, 18 December 2015

SQL Querry to Find The On Hand Quantity with cost wise

SELECT B.SEGMENT1 ITEM,
B.DESCRIPTION,
E.ORGANIZATION_CODE ,
A.SUBINVENTORY_CODE,
C.SEGMENT1 LOCATOR,
D.ITEM_COST,
SUM(A.PRIMARY_TRANSACTION_QUANTITY) QUANTITY,
SUM(A.PRIMARY_TRANSACTION_QUANTITY)*D.ITEM_COST TOTAL_VALUE
FROM MTL_ONHAND_QUANTITIES_DETAIL A
,MTL_SYSTEM_ITEMS_B B,
MTL_ITEM_LOCATIONS C,
CST_ITEM_COSTS D,
ORG_ORGANIZATION_DEFINITIONS E
WHERE A.INVENTORY_ITEM_ID =  B.INVENTORY_ITEM_ID
AND A.ORGANIZATION_ID=B.ORGANIZATION_ID
AND C.ORGANIZATION_ID=B.ORGANIZATION_ID
AND C.INVENTORY_LOCATION_ID=A.LOCATOR_ID
AND  A.INVENTORY_ITEM_ID =  D.INVENTORY_ITEM_ID
AND A.ORGANIZATION_ID=D.ORGANIZATION_ID
AND E.ORGANIZATION_ID=A.ORGANIZATION_ID
AND A.ORGANIZATION_ID IN (84,86,90,91,92,93)
--AND B.SEGMENT1='M-0106011'
GROUP BY B.SEGMENT1,B.DESCRIPTION,E.ORGANIZATION_CODE,
A.SUBINVENTORY_CODE,C.SEGMENT1,D.ITEM_COST;

Wednesday, 16 December 2015

How to Launch Workflow from PL/SQL?

declare
   v_itemtype   VARCHAR2(50);
   v_itemkey    VARCHAR2(50);
   v_process    VARCHAR2(50);
   v_userkey    VARCHAR2(50);
begin

v_itemtype := 'DEMOIT';
v_itemkey := '1233';
v_userkey := '1233';
v_process := 'DEMOPROCESS';
WF_ENGINE.Threshold := -1;
WF_ENGINE.CREATEPROCESS(v_itemtype, v_itemkey, v_process);

wf_engine.setitemuserkey(v_itemtype, v_itemkey, v_userkey );
wf_engine.setitemowner (v_itemtype, v_itemkey,'SYSADMIN');

WF_ENGINE.STARTPROCESS(v_itemtype, v_itemkey);
commit;
exception when others
then
  dbms_output.put_line(SQLERRM);
end;

workflow execution From Pl/SQL:

declare
 resultout varchar2(10);
 begin
  -- Call the procedure
  xxpo_di_approval_wf_pkg_new.next_approver(itemtype => 'XXPODI_1',
                                                                               itemkey => 9760,
                                                                                actid => 2,
                                                                                funcmode => 'RUN',
                                                                                resultout => resultout);
dbms_output.put_line(resultout);

end;

How to get attribute value after execution workflow?

select WF_ENGINE.GETITEMATTRTEXT(ITEMTYPE => 'XXPODI_1',
                                               ITEMKEY  => 9760,
                                               ANAME    => 'ATR_LEVEL1') from dual

R12 Table Level Changes

Suppliers:

New R12 tables  -> Old 11i Tables
AP_SUPPLIERS - replaces PO_VENDORS
AP_SUPPLIER_SITES_ALL- replaces PO_VENDOR_SITES_ALL

Additional supplier related tables in IBY (Payments) and HZ (TCA):
IBY_EXTERNAL_PAYEES_ALL - stores Payee(supplier) information.
HZ_PARTIES - Party data for the suppliers.
HZ_PARTY_SITES - Party site data for the supplier sites.

Invoices:

Additional table in R12: AP_INVOICE_LINES_ALL

we were capturing the invoice break up details directly in the distribution, whereas in release 12, one is allowed to capture the invoice information at the line level, and then make distributions for every line captured. The information that can be captured at the line level could be any of the following:
Item purchased, the price, the quantity, and other item related information.

AP_INVOICE_DISTRIBUTIONS_ALL:

It holds the distribution information that is manually entered or system-generated.
There is one row for each invoice distribution and a distribution must be associated with an invoice.
An invoice can have multiple distributions.

Allocations - AP_CHRG_ALLOCATIONS_ALL is obsolete in R12

R12’s New Payment Process Request:
The 11i Accounts Payable Payment Batch functionality has been replaced by the Payment Process Request (PPR) in R12. PPR can be accessed via Payment Manager, a fund disbursement HTML page (as opposed to the prior 11i Oracle forms).

Taxes:

Functionality provided by E-Business Tax
New tables in R12
ZX_LINES - Detailed Tax lines for the invoice (trx_id = invoice_id)
ZX_LINES_SUMMARY - Summary tax lines for the invoice (trx_id = invoice_id)
ZX_REC_NREC_DIST  - Tax distributions for the invoice (trx_id = invoice_id)
ZX_LINES_DET_FACTORS - Tax determination factors for the invoice (trx_id = invoice_id)

Payments:

Functionality moved to central Payments (IBY)
New IBY tables in R12:
IBY_PAY_SERVICE_REQUESTS  - Payment Process Request information

Accounting:

Functionality moved to SubLedger Accounting (SLA)
New R12 tables:
XLA_EVENTS -> replaces AP_ACOCUNTING_EVENTS_ALL 
XLA_AE_HEADERS -> replaces AP_AE_HEADERS_ALL
XLA_AE_LINES-> replaces AP_AE_LINES_ALL
XLA_DISTRIBUTION_LINKS

Trial Balance:

New R12 Table
XLA_TRIAL_BALANCES
AP_LIABILITY_BALANCE-> not used in new R12 transactions
AP_TRIAL_BALANCE -> not used in new R12 transactions

Bank Accounts:

Functionality moved to Cash Management.
CE_BANK_ACCOUNTS -> replaces AP_BANK_ACCOUNTS_ALL
CE_BANK_ACCT_USES_ALL  -> replaces AP_BANK_ACCOUNT_USES_ALL

CE_PAYMENT_DOCUMENTS -> AP_CHECK_STOCKS_ALL

Inventory r12 new concefts:

OPM Inventory Conversion
11i:
1) OPM Inventory 2) Discrete Inventory
r12)
Oracle Inventory
Dual UOM Functionality:
Material Status Control:
Specify which transaction types can be resticted by status
1)Subinventory 2)Locator 3)LOT 4)serial

Difference Between 12.1 and 12.2
Online Patchin
R12 features:
cloning is simplified
64 bit java is supported which can handle large amounts of data compared to 32bit java

display user name insted of user id for the last updated by field.

Tuesday, 15 December 2015

Ref Cursor Example.


CREATE OR REPLACE PACKAGE CURSPKG AS 
    TYPE T_CURSOR IS REF CURSOR; 
    PROCEDURE OPEN_ONE_CURSOR (N_EMPNO IN NUMBER, 
                               IO_CURSOR IN OUT T_CURSOR); 
    PROCEDURE OPEN_TWO_CURSORS (EMPCURSOR OUT T_CURSOR, 
                                DEPTCURSOR OUT T_CURSOR);
END CURSPKG;
-------------------------------------------------------------------
CREATE OR REPLACE PACKAGE BODY CURSPKG AS
    PROCEDURE OPEN_ONE_CURSOR (N_EMPNO IN NUMBER,
                               IO_CURSOR IN OUT T_CURSOR)
    IS 
        V_CURSOR T_CURSOR; 
    BEGIN 
        IF N_EMPNO <> 0 
        THEN
             OPEN V_CURSOR FOR 
             SELECT EMP.EMPNO, EMP.ENAME, DEPT.DEPTNO, DEPT.DNAME 
                  FROM EMP, DEPT 
                  WHERE EMP.DEPTNO = DEPT.DEPTNO 
                  AND EMP.EMPNO = N_EMPNO;

        ELSE 
             OPEN V_CURSOR FOR 
             SELECT EMP.EMPNO, EMP.ENAME, DEPT.DEPTNO, DEPT.DNAME 
                  FROM EMP, DEPT 
                  WHERE EMP.DEPTNO = DEPT.DEPTNO;

        END IF;
        IO_CURSOR := V_CURSOR; 
    END OPEN_ONE_CURSOR; 

    PROCEDURE OPEN_TWO_CURSORS (EMPCURSOR OUT T_CURSOR,
                                DEPTCURSOR OUT T_CURSOR)
    IS 
        V_CURSOR1 T_CURSOR; 
        V_CURSOR2 T_CURSOR; 
    BEGIN 
        OPEN V_CURSOR1 FOR SELECT * FROM EMP;
        OPEN V_CURSOR2 FOR SELECT * FROM DEPT;
        EMPCURSOR  := V_CURSOR1; 
        DEPTCURSOR := V_CURSOR2; 
    END OPEN_TWO_CURSORS; 
END CURSPKG;

Sunday, 6 December 2015

APP_FND_01564: Oracle error 24347 in FDFGVD

APP_FND_01564: Oracle error 24347 in FDFGVD

Cause: FDFGVD faild due to ORA-24347: Warning of a NULL column in an aggregate function.

I am getting by below query:

SELECT   NVL (SUM (pll.quantity), 0) di_qty,      ----error line
                              pll.attribute1 di_num, pha.segment1,
                              pha.po_header_id, pha.comments po_desc,
                              pll.ship_to_organization_id
                         FROM po_lines_all pla,
                              po_line_locations_all pll,
                              po_headers_all pha
                        WHERE UPPER (pll.attribute15) IN ('APPROVED')
                          AND pha.po_header_id = pla.po_header_id
                          AND pla.po_line_id = pll.po_line_id
                          AND pla.line_type_id IN (1,1021)
                          AND                      --on 9 july by Priya sharma
                              pha.po_header_id = pll.po_header_id
                     GROUP BY pll.attribute1,
                              pha.segment1,
                              pha.po_header_id,
                              pha.comments,
                              pll.ship_to_organization_id

Resolved issue by below query:

SELECT   SUM (NVL(pll.quantity, 0)) di_qty,    --Resalvoe line
                              pll.attribute1 di_num, pha.segment1,
                              pha.po_header_id,
                              NVL (pha.comments, 'NULL') po_desc,
                              pll.ship_to_organization_id
                         FROM po_lines_all pla,
                              po_line_locations_all pll,
                              po_headers_all pha
                        WHERE UPPER (pll.attribute15) IN ('APPROVED')
                          AND pha.po_header_id = pla.po_header_id
                          AND pla.po_line_id = pll.po_line_id
                          AND pla.line_type_id IN (1)
                          AND                      --on 9 july by Priya sharma
                              pha.po_header_id = pll.po_header_id
                     --AND PLL.ATTRIBUTE9 IS NOT NULL
                      /*AND PLL.SHIP_TO_ORGANIZATION_ID = &P_ORG_ID AND
                       AND PHA.PO_HEADER_ID = &P_PO_NUM*/
                     GROUP BY pll.attribute1,
                              pha.segment1,
                              pha.po_header_id,
                              pha.comments,
                              pll.ship_to_organization_id

Monday, 30 November 2015

Error Message 3205 : USER_NAME is not a valid role or user name



Error Message 3205 : USER_NAME is not a valid role or user name.

Email address should be define in FND_USER and PER_PEOPLE_F tables for the User who is not getting workflow.
 
1) Check for Table : FND_USER
    End_date should be null for the user who is not getting Workflow.

2) Check For Table:  WF_LOCAL_ROLES
   Expiration_date should be null for the user who is not getting Workflow.

3) Run Request : Workflow Directory Services User/Role Validation.

   Schedule request periodically as per below parameter.



Tuesday, 24 November 2015

BI publisher interview questions

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

14)Hide a Field in Oracle XML Publisher

If You Want to Hide a Field:


 <?if@column:FIELD!=' '?><?FIELD?><?end if?> 

15) Displaying Page Totals in XML Publisher
Add the below tag in the loop (with in for-each)
<?add-page-total:’INV_AMT’;’INVOICE_AMT_PT’?>

Here INV_AMT is a field name and INVOICE_AMT_PT is a varable which stores the page total.

To show the page total , add the below tag in the footer or Header
<?show-page-total: INVOICE_AMT_PT;’999G999D99’?>


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


<?end when?>



<?when:CF_CHOICE=’INVOICE’?>


<?end when?>

<?when:CF_CHOICE=’PO’?>

<?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="exceptlast" name="InvAmt"><xdofo:show-carry-forward name="InvAmt" format="99G999G999D00" number-separators=",."/></xdofo:inline-total>

Carried Forward:  
<xdofo:inline-total display-condition="exceptfirst" name="InvAmt"><xdofo:show-brought-forward name="InvAmt" format="99G999G999D00" number-separators=",."/></xdofo:inline-total>

Page Total:
<?add-page-total:’INV_AMT’;’INVOICE_AMT_PT’?>
<?show-page-total: INVOICE_AMT_PT;’999G999D99’?>

Repeating Headre:

  For loop
<?for-each:G_CUSTOMER?>
<?end for-each?>


WATERMARK
PAGE LAYOUTàWATERMARK (Word 2007)
Format à Backgroundà Printed Watermark (Word 2003)

TEXT FIELD
Developeràcontrolsàlegacy toolsàtext field

CONDITIONAL FORMATTING
The XSL code you need is:
<?if:TRANS_AMOUNT_REMAINING >1000?>
<xsl:attribute xdofo:ctx="block" name="background-color">red</xsl:attribute>
<?end if?>

BARCODE
Select File à Properties à Custom Tab
In the Name field enter: xdo-font.Free 3 of 9.normal.normal – notice the name of the font must match the name of the font in the MSWord font drop down
In the Value field enter: truetype.c:\windows\fonts     \FREE3OF9.ttf
SORTING:
<?sort:TRANS_AMOUNT;'ascending';data-type='text'?>

 DIFFERENT LAST PAGE:To utilize this feature, you must create a section break in your template to ensure the content of the final page is separated from the rest of the report and Insert the following syntax on the final page:
<?start@last-page:body?>
<?end body?>
What is Bursting in XML Publisher?
Lets say we have information of 100 different Customer Invoices in a single report. In case of bursting, XMLP engine upon a predefined criteria (Bursting criteria), helps generates single output file for each customer invoice  i.e. 100 report files for 100 Customer Invoices and emails each report output file individually. We can even fax the output.
Bursting Criteria is nothing but a grouping criteria upon which report output gets splitted.
How to use Variables in XMLP
Declaring the Variable R and Assigning the Values 4 to R
<?xdoxslt:set_variable($_XDOCTX, ‘R’, 4)?>

Get the Variable value
<?xdoxslt:get_variable($_XDOCTX, ‘R’)?>

This adds 5 to variable R and displays it
<?xdoxslt:set_variable($_XDOCTX, ‘R’, xdoxslt:get_variable($_XDOCTX, ‘R’)+5)?>

This subtracting 2 to varaible R and displays it

<?xdoxslt:set_variable($_XDOCTX, ‘R’, xdoxslt:get_variable($_XDOCTX, ‘R’)-2)?>


Setting the Password for PDF File sent through XML Publisher


Open the rtf for which you want to set password and do the following things
1) Open the .rtf
2) Go to File – > Properties
Create a new custom property
a) Name :xdo-pdf-security
Type : text
Value :true
b) Name : xdo-pdf-open-password
Type : text
Value : password
<PASSWORD>welcome</PASSWORD>