XML Publisher Tutorial

XML Publisher Tutorial

HOW TO DELETE XML PUBLISHER DEFINITION AND TEMPLATE

How to Delete XML Publisher Definition and Template

 How often do you create a XML publisher definition with a wrong Codes (Template or Data Definition)? Or you want to change the Code so that it is more meaningful?

 

In the XML Publisher’s OA Framework pages, both Template and Data Definition pages do not provide an option to delete anything. Moreover, the Template Code or Definition Code is not allowed to be updated.

 

The reason is that: concurrent program with XML output matches the Short Name with the template Code to find out which XML Publisher template to use for post processing. If you delete this template, the Post Processor cannot find the template, and then give errors.

 

You cannot change the Concurrent Program Short Name in the Form, and you cannot change the XML Template Code, and you cannot change the Data definition Code. If you make a typo in any one, disable it and create another one with the correct name. That’s what Oracle suggests.

 

Come on…I WANT TO DELETE THEM, rather than recreating everything, and leave the wrong stuff in the system.

 

In another blog I show the way to delete concurrent program, and in here I will show you how to delete XML publisher template and the definition associated with this template. Change the parameters to fit your needs.

 PL/SQL CODE:

 

SET SERVEROUTPUT ON

DECLARE
   — Change the following two parameters
   var_templateCode    VARCHAR2 (100) := ‘SYMPLIK-TEST2’;     — Template Code
   boo_deleteDataDef   BOOLEAN := TRUE;     — delete the associated Data Def.
BEGIN
   FOR RS
      IN (SELECT T1.APPLICATION_SHORT_NAME TEMPLATE_APP_NAME,
                 T1.DATA_SOURCE_CODE,
                 T2.APPLICATION_SHORT_NAME DEF_APP_NAME
            FROM XDO_TEMPLATES_B T1, XDO_DS_DEFINITIONS_B T2
           WHERE T1.TEMPLATE_CODE = var_templateCode
                 AND T1.DATA_SOURCE_CODE = T2.DATA_SOURCE_CODE)
   LOOP
      XDO_TEMPLATES_PKG.DELETE_ROW (RS.TEMPLATE_APP_NAME, var_templateCode);

      DELETE FROM XDO_LOBS
            WHERE     LOB_CODE = var_templateCode
                  AND APPLICATION_SHORT_NAME = RS.TEMPLATE_APP_NAME
                  AND LOB_TYPE IN (‘TEMPLATE_SOURCE’, ‘TEMPLATE’);

      DELETE FROM XDO_CONFIG_VALUES
            WHERE     APPLICATION_SHORT_NAME = RS.TEMPLATE_APP_NAME
                  AND TEMPLATE_CODE = var_templateCode
                  AND DATA_SOURCE_CODE = RS.DATA_SOURCE_CODE
                  AND CONFIG_LEVEL = 50;

      DBMS_OUTPUT.PUT_LINE (‘Template ‘ || var_templateCode || ‘ deleted.’);

      IF boo_deleteDataDef
      THEN
         XDO_DS_DEFINITIONS_PKG.DELETE_ROW (RS.DEF_APP_NAME,
                                            RS.DATA_SOURCE_CODE);

         DELETE FROM XDO_LOBS
               WHERE LOB_CODE = RS.DATA_SOURCE_CODE
                     AND APPLICATION_SHORT_NAME = RS.DEF_APP_NAME
                     AND LOB_TYPE IN
                            (‘XML_SCHEMA’,
                             ‘DATA_TEMPLATE’,
                             ‘XML_SAMPLE’,
                             ‘BURSTING_FILE’);

         DELETE FROM XDO_CONFIG_VALUES
               WHERE     APPLICATION_SHORT_NAME = RS.DEF_APP_NAME
                     AND DATA_SOURCE_CODE = RS.DATA_SOURCE_CODE
                     AND CONFIG_LEVEL = 30;

         DBMS_OUTPUT.PUT_LINE (
            ‘Data Defintion ‘ || RS.DATA_SOURCE_CODE || ‘ deleted.’);
      END IF;
   END LOOP;

   DBMS_OUTPUT.PUT_LINE (
      ‘Issue a COMMIT to make the changes or ROLLBACK to revert.’);
EXCEPTION
   WHEN OTHERS
   THEN
      ROLLBACK;
      DBMS_OUTPUT.PUT_LINE (
         ‘Unable to delete XML Publisher Template ‘ || var_templateCode);
      DBMS_OUTPUT.PUT_LINE (SUBSTR (SQLERRM, 1, 200));
END;
/

USING MULTIPLE QUERIES DATA TEMPLATE CODE

Using Multiple QuErIes Data Template CodE

<dataTemplate name=”WOBB” description=”Work Order Header and Body ” version=”1.0″ defaultPackage=”WO_PKG”>
<parameters>
<parameter name =”p_Workorder_From”          dataType=”character”/>
</parameters>
<property name=”fo-keep-empty-inline”>false</property>
<dataQuery>
<sqlStatement name=”Q_ReportHeader”>
SELECT hp.party_name                                                                                 Company_Name,
         Mp.organization_code                                                                          Comp_Num,
        DECODE (INSTR(mtl.segment1, wsg.schedule_group_name), 0,
                        pjm_project.all_task_idtonum (wdj.task_id)
                        || ‘ ‘|| mtl.segment1
                        || wsg.schedule_group_name,pjm_project.all_task_idtonum (wdj.task_id)
                        || mtl.segment1)                                                               Item_Number,
       wsg.schedule_group_name                                                                         Running_Number,
       mtl.description                                                                                 Item_Description,
       we.wip_entity_name                                                                              Work_Order_No,
       mtl.segment1                                                                                    Drawing_No,
       to_char(wdj.scheduled_start_date,’DD-MM-YY HH24:MI’)                                            Planned_start_date,
      NVL (pjm_project.all_task_idtoname(wdj.task_id),
           SUBSTR (mtl.segment1, 0, INSTR (mtl.segment1, ‘TP’) – 1)
           )                                                                                           Internal_Order_name,
       to_char(wdj.scheduled_completion_date ,’DD-MM-YY HH24:MI’)                                       Planned_end_date,
       mtl. wip_supply_locator_id || ‘ ‘|| mtl.wip_supply_subinventory                                  Raw_material_warehouse,
       wdj.completion_locator_id                                                                       finish_goods_subinv,     
       wdj.start_quantity                                                                               Quantity_ordered,
       mtl.unit_weight || ‘ ‘|| mtl.weight_uom_code                                                     Weight,
       wdj.QUANTITY_COMPLETED                                                                           Quantity_completed,
       DECODE(XSRS.PRINT_FLAG_WO_STATUS, ‘Duplicate’, ‘Duplicate’, ‘Original’) wo_status
   FROM wip_discrete_jobs wdj,
        Mtl_parameters mp,
       mtl_system_items_b mtl,
       xle_entity_profiles xep,
       hz_parties hp,
       wip_schedule_groups wsg,
       wip_entities we,
       hr_organization_information hoi,
       XXDIS_SCO_REPORT_STATUS XSRS
WHERE  hp.party_id = xep.party_id
   AND wdj.organization_id = mtl.organization_id
   AND wdj.primary_item_id = mtl.inventory_item_id
   AND wdj.schedule_group_id = wsg.schedule_group_id
   AND wdj.organization_id = wsg.organization_id
  NVL(:p_Workorder_From,we.wip_entity_name)
</sqlStatement>
<sqlStatement name=”Q_DATE”>
SELECT to_char(sysdate,’DD-MM-YY HH24:MI’) sys_date FROM DUAL 
</sqlStatement>

<sqlStatement name=”Q_DEPT_WC”>
SELECT XXDPS_GBL_GENERIC_PKG.XXDPS_GBL_DEPT_FUNC(we.wip_entity_name)  sled_pracovist_workcentre
FROM wip_entities we WHERE we.wip_entity_name=:p_Workorder_From 
</sqlStatement>

<sqlStatement name=”Q_RoutingHeader”>

SELECT    pjm_project.all_task_idtonum (x.parent_task_id)||mtl.segment1
       || wsg.schedule_group_name                                     xx,
       wdjo.start_quantity                                               xxx,                                               
       mtl.description                                                    xxxx,
       weo.wip_entity_name                                                vo_parent_wo_number,
       mfl.meaning                                                        stav_vo_parent_wo_status
       ,SUBSTR (xdis.bom_text, 1, 20)                                     Quality_Plan_Identification
       ,SUBSTR (xdis.bom_text, 22, 24)                                    Design_Contact
       ,SUBSTR (xdis.bom_text, 48, 14)                                    Technilogy_Concatact
       ,NULL                                                              position
  FROM wip_discrete_jobs wdjo,
       wip_entities weo,
       mtl_system_items_b mtl,
       wip_schedule_groups wsg,
       mfg_lookups mfl,     
       (SELECT pa.parent_task_id, wdj.task_id, wdj.project_id
          FROM wip_discrete_jobs wdj, wip_entities we, pa_tasks pa
         WHERE wdj.wip_entity_id = we.wip_entity_id
           AND wdj.organization_id = we.organization_id
          AND we.wip_entity_name = NVL(:p_Workorder_From, we.wip_entity_name)
           AND wdj.task_id = pa.task_id
           AND wdj.project_id = pa.project_id) x,         
       (SELECT xxdis_sco_generic_pkg.xxdis_sco_bom_text(:p_Workorder_From) bom_text FROM DUAL) xdis         
 WHERE wdjo.wip_entity_id = weo.wip_entity_id
   AND wdjo.organization_id = weo.organization_id
   AND x.parent_task_id(+) = wdjo.task_id
   AND wdjo.project_id = x.project_id(+)
</sqlStatement>
<sqlStatement name=”Q_RoutingEntryHeader”> 
SELECT DISTINCT wo.operation_seq_num operation_num,
                bso.operation_code activity,
                bso.operation_description activity_description,
                bd.description workcenter, br.resource_code machine_num,
                TO_CHAR (wo.first_unit_start_date,
                         ‘DD-MM-YY HH24:MI’
                        ) planned_start_date,
                TO_CHAR (wo.last_unit_completion_date,
                         ‘DD-MM-YY HH24:MI’
                        ) planned_end_date,
                DECODE (ca.activity,
                        ‘Run’, bor.usage_rate_or_amount,
                        0
                       ) preparation_time,
                we.wip_entity_name work_order_no,
                   DECODE
                        (ca.activity,
                         ‘Prerun’, bor.usage_rate_or_amount,
                         0
                        )
                || ‘/’
                || bor.assigned_units run_time_or_num_of_workers,
                (  (  DECODE (ca.activity,
                              ‘Run’, bor.usage_rate_or_amount,
                              0
                             )
                    + DECODE (ca.activity,
                              ‘Prerun’, bor.usage_rate_or_amount,
                              0
                             )
                   )
                 * bor.assigned_units
                 / 60
                ) total_time_in_hours,
                xxdps_sco_total.grand_total grand_total             
           FROM wip_discrete_jobs wdj,
                wip_entities we,
                mtl_system_items msi,
                bom_departments bd,
                wip_operations wo,
                bom_operation_sequences bos,
                bom_standard_operations bso,
                bom_operation_resources bor,
                bom_resources br,
                cst_activities ca,
                (SELECT   we.wip_entity_name entity_name,
                          SUM
                             ((  (  DECODE (ca.activity,
                                            ‘Run’, bor.usage_rate_or_amount,
                                            0
                                           )
                                  + DECODE (ca.activity,
                                            ‘Prerun’, bor.usage_rate_or_amount,
                                            0
                                           )
                                 )
                               * bor.assigned_units
                               / 60
                              )
                             ) grand_total
                     FROM wip_discrete_jobs wdj,
                          wip_entities we,
                          wip_operations wo,
                          bom_operation_sequences bos,
                          bom_standard_operations bso,
                          bom_operation_resources bor,
                          bom_resources br,
                          cst_activities ca
                    WHERE wdj.wip_entity_id = we.wip_entity_id
                      AND wdj.wip_entity_id = wo.wip_entity_id
                      AND wo.operation_sequence_id = bos.operation_sequence_id
                      AND bos.standard_operation_id =
                                                     bso.standard_operation_id
                      AND bor.operation_sequence_id = wo.operation_sequence_id
                      AND bor.resource_id = br.resource_id
                      AND ca.activity_id(+) = bor.activity_id
                      AND we.wip_entity_name BETWEEN :p_workorder_from
                                                 AND :p_workorder_from
                 GROUP BY we.wip_entity_name) xxdps_sco_total
          WHERE wdj.wip_entity_id = we.wip_entity_id
            AND wdj.primary_item_id = msi.inventory_item_id
            AND wdj.organization_id = msi.organization_id
        NVL(:p_Workorder_From,we.wip_entity_name)
</sqlStatement>
</dataQuery>
<dataStructure>
<group name  =”G_ReportHeader” source=”Q_ReportHeader”>
<element name=”C_Company_Name” value=”Company_Name”/>
<element name=”C_CNum” value=”Comp_Num”/>
<element name=”C_Item_Number” value=”Item_Number”/>
<element name=”C_Running_Number” value=”Running_Number”/>
<element name=”C_Item_Description” value=”Item_Description”/>
<element name=”C_Work_Order_No” value=”Work_Order_No”/>
<element name=”C_Drawing_No” value=”Drawing_No”/>
<element name=”C_Internal_Order_name” value=”Internal_Order_name”/>
<element name=”C_Planned_start_date” value=”Planned_start_date”/>
<element name=”C_Planned_end_date” value=”Planned_end_date”/> 
<element name=”C_Raw_material_warehouse” value=”Raw_material_warehouse”/>
<element name=”C_finish_goods_subinv” value=”finish_goods_subinv”/>
<element name=”C_Quantity_ordered” value=”Quantity_ordered”/>
<element name=”C_Weight” value=”Weight”/>
<element name=”C_Quantity_completed” value=”Quantity_completed”/>
<element name=”C_WO_STATUS” value=”wo_status” />
</group>

<group name  =”G_DATE” source=”Q_DATE”>
<element name=”C_sys_date” value=”sys_date”/>
</group>

<group name  =”G_DEPT_XX” source=”Q_DEPT_WC”>
<element name=”C_sled_pracovist_workcentre” value=”sled_pracovist_workcentre”/>
</group>
<group name  =”G_RoutingHeader” source=”Q_RoutingHeader”>
<element name=”C_Item_Number” value=”Item_Number”/>
<element name=”C_Qty_ordered” value=”Qty_ordered”/>
<element name=”C_Parent_item_description” value=”Parent_item_description”/>
<element name=”C_vo_parent_wo_number” value=”vo_parent_wo_number”/>
<element name=”C_stav_vo_parent_wo_status” value=”stav_vo_parent_wo_status”/>
<element name=”C_Quality_Plan_Identification” value=”Quality_Plan_Identification”/>
<element name=”C_Design_Contact” value=”Design_Contact”/>
<element name=”C_Technilogy_Concatact” value=”Technilogy_Concatact”/>
<element name=”C_position” value=”position”/>
</group>
<group name  =”G_RoutingEntryHeader” source=”Q_RoutingEntryHeader”>
<element name=”C_Operation_Num” value=”Operation_Num”/>
<element name=”C_Activity” value=”Activity”/>
<element name=”C_Activity_description” value=”Activity_description”/>
<element name=”C_Workcenter” value=”Workcenter”/>
<element name=”C_Machine_Num” value=”Machine_Num”/>
<element name=”C_Preparation_Time” value=”Preparation_Time”/>
<element name=”C_Run_time_or_Num_of_workers” value=”Run_time_or_Num_of_workers”/>
<element name=”C_Total_time_in_hours” value=”Total_time_in_hours”/>
<element name=”C_Work_Order_No” value=”Work_Order_No”/>
<element name=”C_Planned_Start_Date” value=”Planned_Start_Date”/>
<element name=”C_Planned_End_Date” value=”Planned_End_Date”/>
<element name=”C_grand_total” value=”grand_total”/>
</group>
</dataStructure>
<dataTrigger name=”afterReport” source=”XX_PKG.xx_Print_lxx_func(:p_Workorder_From)”/>
</dataTemplate>

XML Publisher Bursting Control

XML Publisher R5.6.2 Bursting Engine

 
 
XML Publisher R5.6.2 Bursting Engine Implementation with E-Business Suite 11.5.10

Introduction

XML Publisher Integration with E-Business Suite

 
As default with E-Business Suite 11.5.10 CU1 or later, XML Publisher is fully integrated with the E-Business Suite. Once you register your RTF/PDF templates through XML Publisher Template Manager for the report requests you want to run you can generate PDF file output report based on the original Oracle Reports report query definition and you can save the PDF output files on local file system or send them to printer to print through PASTA driver. See PASTA User’s Guide for the detail of PASTA.
 
However, all the XML Publisher’s functionalities are not available with the out of box of the E-Business Suite installation. Especially the Delivery Manager functionality that delivers the output documents with the different delivery options such as Email, IPP Printer, Fax, FTP, HTTP, WebDAV.
 
You might have the situations where you want to generate documents based on your existing Oracle Reports Concurrent Request and deliver the documents to multiple users by Email or directly send them to IPP Printers to print them out. You even might want to generate different contents of the documents among different recipients or based on the values in the data, and send such documents to multiple delivery destinations like Email and Printers, and different Email recipients.

What and Why Bursting Engine?

 
XML Publisher has introduced a Bursting Engine feature since R5.6.1 and it accepts a data stream and splits it based on multiple criteria, generates multiple outputs based on RTF or PDF templates, then delivers the individual documents through the delivery channel of choice. The engine provides a flexible range of possibilities for document generation and delivery.
 
The following is a sample list of popular usage.
 
  • Invoice generation and delivery based on customer-specific layouts and delivery preference
  • Financial reporting to generate a master report of all cost centers, bursting out individual cost center reports to the appropriate manager
  • Generation of payslips to all employees based on one extract and delivered via e-mail
 
You can implement the Bursting Engine feature as a customized delivery solution into E-Business Suite instance to achieve the above requirements. This document describes the required process of the Bursting Engine implementation for E-Business Suite R11.5.10 CU1 or later environment.
 

Implementation of Bursting Engine with E-Business Suite

 
The following is a brief process of the Bursting Engine implementation with E-Business Suite. You need to go through all this process step by step for the implementation.

PROCESS OVERVIEW

 
  1. Apply all the required XML Publisher related patches.
  2. Create a Bursting Engine control file.
  3. Develop RTF templates for a Report request
  4. Develop a Bursting Engine program for a local testing (Optional)
  5. Develop a Java Concurrent Program to implement Bursting Engine
  6. Create a new Java Concurrent Program Request in EBS
  7. Modify Oracle Reports Definition File to call the Java Concurrent Program in After Trigger
  8. Create a new Oracle Reports Concurrent Program in EBS (Optional)
  9. Assign the Oracle Reports Concurrent Program to a Request Group. (Optional)
  10. Change an output option to XML for the Oracle Reports Concurrent Program
 
Once you have implemented the Bursting Engine you don’t need to go through all the steps again for another report requirement. The one Bursting Engine Java Concurrent Program implementation that is described in this document can serve multiple Oracle Report Concurrent Program requests, so if you need to support more reports with the Bursting Engine implementation you can skip the step 4, 5, 6 for such additional Reports requests.

APPLY ALL THE REQUIRED XML PUBLISHER PATCHES

 
The following is a list of XML Publisher related patches for E-Business Suite that need to be applied prior to starting implementing the Bursting Engine functionalities. Ask DBA or System Administrator to make sure that they have all been applied.
  • XML Publisher Integration with Concurrent Program 3435480
  • XML Publisher R5.6.1 (OA+Core) 4905678
  • XML Publisher R5.6.2 (Only Core, no plan for OA) 5097966
  • Online Help for XML Publisher Release 5.6.1 5021800 (Optional)

CREATE A BURSTING ENGINE CONTROL FILE

 
With Bursting Engine Control file set up, you can control what level of document node in a XML input file you want to process document generation on, what delivery method you want to use, such as Email, Printer, Fax, etc, and which template you want to apply to the report. This is a XML text file so you can modify whenever you need and the change will be immediately picked up by the next Bursting Engine process. The below is an example of the Bursting Engine Control file

<?xml version=”1.0″ encoding=”UTF-8″?>
<xapi:requestset xmlns:xapi=”http://xmlns.oracle.com/oxp/xapi”&gt;
   <xapi:request select=”/RAXINV/LIST_G_ORDER_BY/G_ORDER_BY/LIST_G_INVOICE/G_INVOICE”>
      <xapi:delivery>
      <xapi:email server=”smtp.itron.com” port=”25″ from=”narendra.poflee@itron.com” reply-to =”npoflee@itron.com”>
         <xapi:message id=”123″ to=”{$EMAIL}” cc=”npoflee@itron.com” attachment=”true” subject=”Itron – Invoice for {$CURRENT_PERIOD}”>Hi, Please find an attachment that includes a list of invoices and a check attached
 
Sincerely,
Narendra Poflee
   </xapi:message>
      </xapi:email>
      </xapi:delivery>
      <xapi:document output-type=”pdf” delivery=”123″>
        
<xapi:template type=”rtf” location=”/oragold/app/traincomn/itron/XML-invoice-USA.rtf”>
</xapi:template>
      </xapi:document>
   </xapi:request>
</xapi:requestset>

You can find more detail in XML Publisher’s User’s Guide. But there are a couple of things you need be aware and set correctly to make your Bursting Engine work correctly, and those are described below.
 
Request
 
You can specify a XML node that you want to burst on, which means that Bursting engine will do a for-loop at the node(level) you specified here. The above example shows that the Bursting Engine will do a for-loop at the level of /RAXINV/LIST_G_ORDER_BY/G_ORDER_BY/LIST_G_INVOICE/G_INVOICE , which mean that it will generate a document output at every G_INVOICE occurrence. If there are 5 G_INVOICE elements appear in the input XML data file, then Bursting Engine will generate 5 different document outputs and deliver to SMTP server (in this case) per each document.
 
Deliver
 
You can define which delivery method you want to use here. The following is a list of the delivery methods that can be used. Some of them are supported by XML Publisher R5.6.2 Bursting Engine, but some are not supported though they are supported by XML Publisher Delivery Manager. If you need to support such delivery methods that are not supported by the Bursting Engine today you need to implement that by yourself by calling Delivery Manager directly as a part of Bursting Engine process. You can find a sample code of the customized implementation of FTP at Appendix A.
 
Supported Delivery Methods
 
·       Email
·       Fax
·       Printer
·       File System
 
Unsupported Delivery Methods
 
·       FTP
·       HTTP
·       WebDAV
 
You can set multiple Delivery methods as much as you want in a same request. For example you might want to generate document to be sent by Email and also to be sent to a printer, then you can have both entries here and set a unique id for each delivery option.
 
Document
 
You can specify the document output format you want to generate the document with and the template you want to apply to the document processing. RTF and PDF templates are both supported. You can specify all the output formats that are supported by XML Publisher R5.6.2.
 
Also, you can specify multiple templates as much as you want. You might want to apply different templates based on the value in the input XML file, in such case you can use a Filter function of Bursting Engine and have XPATH expression to do such condition, and have Bursting Engine to pick an appropriate template based on the condition result.
 
Example
<xapi:template type=”rtf” location=”=”/oragold/app/traincomn/itron/XML-invoice-USA.rtf “>
<xapi:template type=”rtf” location=”=”/oragold/app/traincomn/itron/XML-invoice-CAD.rtf ” filter=”.//G_INVOICE[COUNTRY=’CANADA’]”/>

This will apply the XML-invoice-CAD.rtf template only to G_INVOICE which has a COUNTRY element value that is “CANADA”. All other Invoices will have the XML-invoice-USA template applied. This filter can use any XPATH expression to determine the rules for the template application.
 
(Recommendation)
Addition to the above, while the above example is referencing the templates that are located on file system, the Bursting Engine also supports the templates that have been stored in a XML Publisher repository through Template Manager. When you go to Template Manager and register your templates you can reference them from the Bursting Engine control file like the following example.
 
xdo://<APPSCODE>.<TEMPLATE_CODE>.<Lang_Code>.<Territory_Code>
 
Syntax
APPSCODE : Application short code, e.g. AR
TEMPLATE_CODE : Template code name, e.g. XMLINVOICEUS
Lang_Code : ISO 2 letters language code, e.g. en (for English)
Territory_Code : ISO 2 letters territory code, e.g. US (for United States)
 
Example
<xapi:document output-type=”pdf” delivery=”123″>        
<xapi:template type=”xsl-fo” location=”xdo://AR.XMLINVOICEUSA.en.US“>
</xapi:template>
      </xapi:document>
 
Note that template type is ‘xsl-fo’ not rtf, this is because the templates you uploaded through Template Manager are converted to xsl-fo format and stored in the repository, so you need to specify ‘xsl-fo’ as the template type, otherwise XML Publisher doesn’t understand.
 
See XML Publisher User’s Guide for ‘how to register the template through Template Manager.’
 

CREATE RTF TEMPLATES FOR A REPORT REQUEST

 

Download a XML input data

                            
This file is generated by a Report Concurrent Request and exported under Application Home file system. In order to have the concurrent report request to generate XML output instead of default text format you need to go to the concurrent report request definition page and set its output format to XML.
 
You can find this XML output file under $APPLCSF/out/<APPS_INSTANCE_NAME>.
e.g. /oragold/app/traincomn/admin/out/train_ocn-erp-tdb-1
 

Create a RTF template

 
You can use a Template Builder (Microsoft Office Word Plug-in) to develop a RTF template in any way you want to publish a report with.
 
  1. Install Template Builder Desktop (if has not been installed yet)
  2. Load the downloaded XML data
  3. Create a layout
  4. Save

Sample XML Bursting Control file Code

  <xapi:requestset xmlns:xapi=”http://xmlns.oracle.com/oxp/xapi&#8221; type=”bursting”>
  <xapi:request select=”/”>
  <xapi:delivery>
  <xapi:email id=”123″ server=”localhost” port=”25″ from=”donotreply@integra-ls.com” reply-to=”donotreply@integra-ls.com”>
  <xapi:message id=”123″ to=”viral.thakker@integra-ls.com” attachment=”true” subject=”ITGR PO REPORT”>DAILY SALES BOOKING REPORT Report output</xapi:message>
  </xapi:email>
  </xapi:delivery>
  <xapi:document output=”GRPOREPORT” output-type=”excel” delivery=”123″>
  <xapi:template type=”rtf” location=”xdo://XBOL.ITGROPORDREP.en.00/?getSource=true” filter=”” />
  </xapi:document>
  </xapi:request>
  <xapi:request select=”/”>
  <xapi:delivery>
  <xapi:ftp id=”123″ server=”ftp01.oracle.com” user=”infitgri” password=”0wMoz%tt” remote-directory=”/DITG1I” remote-file=”test1.xls” />
  </xapi:delivery>
  <xapi:document output-type=”excel” delivery=”123″>
  <xapi:template type=”rtf” location=”xdo://XBOL.ITGROPORDREP.en.00/?getSource=true” filter=”” />
  </xapi:document>
  </xapi:request>
  </xapi:requestset>

Calculate Running Totals in XMLP

<?xdoxslt:set_variable($_XDOCTX, ‘RTotVar’, xdoxslt:get_variable($_XDOCTX, ‘RTotVar’) + <Column name> )?>
<?xdoxslt:get_variable($_XDOCTX, ‘RTotVar’)?>

BI Publisher : LEADING AND TRAILING ZEROES TRUNCATED FOR EXCEL REPORTS

BI/XML Publisher: Leading and Trailing zeroes truncated for excel reports

 
Microsoft Excel is too smart and it identifies whether the value in the cell is a Text or number and applies formatting accordingly. This sometimes becomes an issue for us when we are trying to generate an excel report. For example item number 0003463262360 has all the numbers and starts with zero, this when printed in excel report displays it as 3463262360. Hence all the leading zeroes are truncated. Same issue happens when we have decimal and trailing zeroes.

FO formatting options can be used to get away with this problem. Below is the syntax for same.

 
<fo:bidi-override direction="ltr" unicode-bidi="bidi-override">
<?ITEM_NUMBER?>
</fo:bidi-override> 

How to Modify Existing Seeded Templates Using XML Publisher

Seeded templates cannot be updated or deleted. The Update and Delete icons for these templates are disabled. If you wish to modify a seeded template, duplicate it, then modify the template file of the duplicated entry. You can then End Date the seeded template if you do not wish it to be available to your users.

Copying a Template:
Use the Search region to find the template you wish to copy. From the search results table, select the Duplicate icon for the template to launch the Copy Template page.
Code – Assign a template Code using the product short name and a descriptive ending. (The Code assigned must have the same prefix in the name as the seeded templates’ code.)
Name – Enter a user-friendly name for your template.
Application – Select the report’s application from the LOV.
Source Template Name – (Not updateable) Displays the name of the template you are duplicating.

Use the following steps:

You must remove any incorrect duplicates of the template/report that you are trying to copy by end dating them on the same day they where created.
1. Go to XML Publisher Responsibility > Templates.
2. Use the search engine to find the template you wish to copy.
3. Click on the link for the copy previously created.
4. Click the Update button and enter an end date into the End Date field. (Use the creation date to completely remove the incorrect copy.)
5. Repeat this for every incorrect copy that may exist.
If you have previously end dated the seeded template, remove the end date.
1. Go to XML Publisher Responsibility > Templates.
2. Use the search engine to find the template and change the Active field to “No”.
3. Click on the link for the seeded report.
4. Click the Update button and remove the end date.

After making your modifications by downloading a copy of the seeded template or creating a new file, create a duplicate of the seeded template.
1. Use the search engine to find the template you wish to copy.  The seeded report should now display.
2. Click the “Duplicate” icon next to the seeded report.
3. Change the required Code field from Copy of XXXX to XXXX2. For example, if your seeded templates’ code was ‘BENSSCNF’, then for the duplicate template, one of the possible codes could be ‘BENSSCNF2′ (basically any code prefixed with ‘BENSSCNF’). Also, note that these codes are non-updateable, so make sure to rename them while duplicating the template itself.
4. Change the required Name field and click the Apply button.
5. Click the Add File button and upload the new or customized replacement file.
6. Click the Update button and change the Default file, if necessary.
7. Alter the copy start date, if necessary. This date will coincide with the date used to end date the seeded template.
8. Go back to Templates and find the seeded report you have duplicated.
9. Click the link for the seeded template and click the Update button.
10. End date the seeded template.
11. Generate the report in the application. The generated report should reflect your duplicate.

Delivery channels – How does the Oracle XML Publisher Core engine gets invoked?

Two step publishing method

    • Submit a concurrent program of which the Output Format is set to XML
    • Submit the XML Report Publisher concurrent request to produce the final output. At submission time, specify the request ID from step 1, choose the desired template and the Output Format (PDF, RTF,…).

   One step publishing method

    • Submit a Concurrent Program with the Output Format is set to XML. At submission time select the desired template and the Output Format (PDF, RTF,…). In the background the Output Post Processor (OPP) automatically applies the layout template to the generated XML data file and creates the output file. This method is the most common usage of XML Publisher.

   All other situations

    • These delivery channels do not use the concurrent managers but they are web or forms based, where the XML Publisher Core API’s are called directly in JAVA code. No concurrent request is involved and only the XML Publisher Core engine is used. Examples of such situations are the following:
      • Pick Slip
      • Dunning Letters
      • Blanket Agreement (Preview and Print)

How to Debug – XML Publisher Report – Log

The Concurrent Request ends with Phase ‘Completed’ and Status ‘Warning’ which indicates that the Output Post Processor (OPP) failed to generate an output file. In such cases the request log file shows a generic error message indicating the the post-processing action has failed:

+————- 1) PUBLISH ————-+
Beginning post-processing of request 3181529 on node PBREUGEL at 11-APR-2008 11:41:30.
Post-processing of request 3181529 failed at 11-APR-2008 11:41:31 with the error message:
One or more post-processing actions failed. Consult the OPP service log for details.
+————————————–+

The actual error returned by the XML Publisher Core engine is captured in the OPP log file. There are three possible ways to obtain the OPP log file:

  • Directly from the file system based after identifying the corresponding OPP log file name using the following SQL statement:

SELECT fcpp.concurrent_request_id req_id, fcp.node_name, fcp.logfile_name
FROM fnd_conc_pp_actions fcpp, fnd_concurrent_processes fcp
WHERE fcpp.processor_id = fcp.concurrent_process_id
AND fcpp.action_type = 6
AND fcpp.concurrent_request_id = &&request_id

  • Via the Forms application:
  1. Login to the application as SYSADMIN
  2. Responsibility: System Administrator
  3. Function: Concurrent –> Manager –> Administration
  4. Select the Output Post Processor
  5. Click on the Processes button
  6. Select the Concurrent Process which was active during the time that the request ran
  7. Click on the Manager Log button to open the Output Post Processor log file
  • Via the Oracle Application Manager (OAM)
  1. Login to the application as SYSADMIN
  2. Responsibility: System Administration
  3. Function: Oracle Applications Manager –> Concurrent Managers
  4. Select the Output Post Processor Service and click on View Details
  5. Click on View Processes
  6. Select the Concurrent Process which was active during the time that the request ran
  7. Click on the Log button to open the Output Post Processor log file

Determine the current version of Oracle XML Publisher on an Oracle E-Business Suite environment.

Based upon an output file generated by XML Publisher
  • PDF Output
    1. Open the PDF document in Adobe Reader
    2. Open the menu File
    3. Select Document Properties
    4. Click on the tab Description
          ==> The property named PDF Producer will show e.g. Oracle XML Publisher 5.6.3.
  • RTF Output
    1. Open the RTF document in Microsoft Word
    2. Open the menu File
    3. Select Properties
    4. Click on the tab Summary
         ==> The property named Comments will show .e.g. Generated by Oracle XML Publisher 5.6.3
  • HTML and Excel output
    1. Open the document in Notepad (or any other plain text editor)
          ==> line 4 or 5 will show e.g. Generated by Oracle XML Publisher 5.6.1

With R12 – version is : 5.6.3

How to obtain the OPP debug log files

Responsibility : System Administrator
Concurrent Manager Administration
Select the Output Post Processor
Click on the Processes button
Select the process that was active during the time  frame that your request ran. Select Manager Log

RTF Template – Working with Variables

Let’s see how we can use the variables to store temporary data or use for calculation.  This is achieved using  “xdoxslt:” function. These are the BI Publisher extension of standard xslt functions.  

Use xdoxslt:set_variable () function to set /initialize the variable  and xdoxslt:get_variable() function to get the variable value.  $_XDOCTX is the System variables to set the XDO Context.

/*initialize a variables*/

<?xdoxslt:set_variable($_XDOCTX, ‘counter’, 0)?>

/*update the variable’s value by adding the current value to MY_CNT, which is XML element */

<?xdoxslt:set_variable($_XDOCTX, ‘counter’, xdoxslt:get_variable($_XDOCTX, ‘counter’) + MY_CNT)?>

/* accessing the variables */

<?xdoxslt:get_variable($_XDOCTX, ‘counter’)?>

 

/*Working in a loop*/

<?xdoxslt:set_variable($_XDOCTX, ‘counter’, 0)?>

<?for-each:G1?>

/*increment the counter*/

<?xdoxslt:set_variable($_XDOCTX, ‘counter’, xdoxslt:get_variable($_XDOCTX, ‘counter’) + 1)?>

<?end for-each?>

<?xdoxslt:get_variable($_XDOCTX, ‘counter’)?>

Re Group XML Data in RTF Template

 If we need the grouping, it is always advisable to generate the XML as per the required hierarchy. This makes the RTF design simple and perform better.  But there are situation when we do not have control over XML structure and need to work on flat XML.  Lets see how we can create multiple nested grouping in RTF template.

I am using  following simple flat XML which is generated using scott.emp and scott.dept table.

Lets first design the simple table with default group

It generates simple listing report.

 

Lest add a group based on Depno. This is achieved by adding following loop

  <?for-each-group:ROW;./DEPTNO?>  — <?end for-each?> and iterate the detail record within the current group.

This introduce the Dept Group ..
Let’s add another nested group for Job within the department group.
Hope this will help to design those nasty nested groups based on flat XML date.

OAF Vs ADF

Oracle recommendations 

If you want to integrate your extensions tightly with the E-Business Suite,
you should use the OAF Release 12 technology stack, which includes the
use of JDeveloper 10g and ADF BC (or use OAF Release 11i, which uses
JDeveloper 9i).


 If you are building a separate application that does not integrate tightly
with the E-Business Suite, but needs E-Business Suite-specific capabilities
like Flexfields and personalization, you should use the OAF Release 12
technology stack. If your application does not need to integrate with the
E-Business Suite, or doesn’t require any of the E-Business Suite-specific
capabilities enumerated above, you should use ADF 10g with SOA based
integration with E-Business Suite.


 If you are building a separate application that does not need to integrate at
all with the E-Business Suite, and you need an AJAX-style rich client user
interface, you should use ADF 11g.



ADF :

  1. J2EE enabled Frame work
  2. ADF Uses JSF
  3. Design time page Editor
  4. Minimal Java Coding
  5. Declarative controller
  6. Rapid Development
  7. Support MVC Architecture
  8. Deployed in Web logic server
  9. ADF is open source
  10. Support web service and SOA Service

OAF:

  1. Oracle application Frame Work
  2. OAF uses UIX
  3. No UI page Editor
  4. Complex Java coding
  5. Support MVC Architecture
  6. Deployed in Oracle  Application Server
  7. Development is more complex