Thursday, May 12, 2016

USING DATA DEFINITION TEMPLATE IN XML PUBLISHER

Create Concurrent Program to generate the Data XML output.
Navigation: System Administrator-> Concurrent-> Program->Define

AND THEIR EXECUTABLE NAME AS "XDODTEXE"


Assignment of concurrent program to request Group (RESPONSIBILITY)

Navigation: System Administrator-> Security-> Responsibility->Request
-------------------------------------------------------------------------------------------------------------------------------------------------
Create the data definition template

<?xml version="1.0" encoding="WINDOWS-1252" ?><dataTemplate name="Bookeddata" description="Booked Data" defaultPackage="AB_BURSTING_CP_SUB_PKG"  Version="1.0">
<dataQuery>
        
 <sqlStatement name="BOOKED_DATA">
  <![CDATA[
  
 select h.price_list_id,r.customer_number,r.customer_name,h.sold_to_org_id,h.cust_po_number, 'PO# '||h.cust_po_number purchase_order,'SO# '||h.order_number sales_order,h.attribute1,h.attribute10
,h.booked_flag,''''||h.header_id||''''||',' header_id,to_char(h.creation_date,'MM-DD-YYYY HH:MI:SS') creation_date
from oe_order_headers_all h, ra_customers r
where h.sold_to_org_id = r.customer_id
--and to_char(h.creation_date,'MMDDYYYY')=''-- > 
--and h.orig_sys_document_ref like ''
--and r.customer_name like'';
--and h.open_flag='Y'
--and h.booked_flag='N'
and r.customer_number in()
--and h.attribute10 is null
and rownum<10
order by h.creation_date desc  
]]>
</sqlStatement>
</dataQuery>
<dataStructure>
  
<group name="G_BOOKED_DATA" source="BOOKED_DATA">
<element name="price_list_id"   value="price_list_id" />
<element name="customer_number"   value="customer_number" />
<element name="customer_name"   value="customer_name" />
<element name="sold_to_org_id"   value="sold_to_org_id" />
<element name="cust_po_number"   value="cust_po_number" />
<element name="purchase_order"   value="purchase_order" />
<element name="sales_order"   value="sales_order" />
<element name="attribute1"   value="attribute1" />
<element name="attribute10"   value="attribute10" />
<element name="booked_flag"   value="booked_flag" />
<element name="header_id"   value="header_id" />
<element name="creation_date"   value="creation_date" />
    </group>
</dataStructure>
<dataTrigger name="afterReport" source="JM_BURSTING_CP_SUB_PKG.AfterReport()"/>

</dataTemplate>


Save the file with name with .xml extension

------------------------------------------------------------------------------------------------------------------------------------------
 Create data definition in xml publisher and attach the data definition template to the data definition

Navigation: XML Publisher Administrator -> Data Definitions -> Create Data Definition
-------------------------------------------------------------------------------------------------------------------------------------------

Creation of RTF from MSWORD.
attach the RTF to the program from "data template"

Creation of Control file for bursting.
<?xml version="1.0" encoding="UTF-8"?>
<xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi" type="bursting">
<xapi:globalData location="stream" />
<xapi:request select="/BOOKEDDATA/LIST_G_BOOKED_DATA">
<xapi:delivery>
<xapi:email id="123" server="localhost" port="25" from="xxx@mail.com" reply-to="xxx@mail.com">
<xapi:message id="123" to="xxx@mail.com" cc="xxx@mail.com"
attachment="true" content-type="html/text" subject="control file of booked data">

Hello,

Please find the attached latest top ten "booked orders" spread sheet.


Thanks,
xxx.

</xapi:message>
</xapi:email>
</xapi:delivery>
<xapi:document output="Booked_data.pdf" output-type="pdf" delivery="123">
<xapi:template type="rtf" location="/usr/tmp/Design.rtf" />
</xapi:document>
</xapi:request>

</xapi:requestset>

save the file with .xml extension

Attach the control file to Data Defination "Bursting Control File"







No comments:

Post a Comment