Saturday, 1 August 2020

before report trigger in xml data template

before report trigger in xml data template

Hi friends , We are going to discuss about the before report trigger in xml data template. We will discuss how we can use the report triggers itself in the xml reports data template. We know that in report builder tool we have the report triggers features which helps to execute or perform different operating in the report itself. In the same way we can have feature of before report trigger in xml data template. In Data Template , We can use the before report triggers which helps to perform the specific operations and to set the lexical parameters as per our requirement. We will try to create the xml reports and will use the before trigger also for lexical parameter in the sql query. Please find below the complete detail about before report trigger in xml data template.


Steps to use the before report trigger in xml data template

Step 1:- 

For example: As below we have the package created in Oracle apps database. We need to use this package in the before report trigger in xml data template. We are using this package to set the lexical parameter in the report sql query.

Package employee AS 
where_clause varchar2(1000);

 ..... Package body employee AS .

.... where_clause := 'and org_id=10';

--------------



Step 2:- 
Here below is the sample data template xml file. In which we are using this package and the before report trigger in xml data template.

before report trigger in xml data template
before report trigger in xml data template

Step 2:-


Sample Data Template file using the before report trigger in xml data template

<?xml version="1.0" encoding="UTF-8" ?> 
 <dataTemplate name="SupInvData" description="Supplier Invoice Details" 
   Version="1.0" defaultPackage="employee">
 <properties>
  <property name="debug_mode" value="on"/>
 </properties> 
 <parameters>
  <parameter name="P_VENDOR_ID" dataType="character" /> 
 </parameters>
 <dataTrigger name="beforeReport" SOURCE="employee()"/>
 <dataQuery>
  <sqlStatement name="Q1">
  <![CDATA[ 
   select a1.invoice_id,A2.VENDOR_NAME,A1.INVOICE_NUM,A1.INVOICE_DATE,A1.INVOICE_AMOUNT from ap_invoices_all a1,po_vendors a2
where a1.vendor_id=a2.vendor_id
and a2.vendor_id=:P_VENDOR_ID
&where_clause
   ]]> 
   </sqlStatement>
  </dataQuery>
  <dataStructure>
  <group name="G_SUPP" source="Q1">
   <element name="VENDOR_NAME" value="VENDOR_NAME" /> 
   <element name="VENDOR_INV_AMT" value="G_INV.INVOICE_AMOUNT" 
    function="SUM()" /> 
   <group name="G_INV" source="Q1">
    <element name="INVOICE_NUM" value="INVOICE_NUM" /> 
    <element name="INVOICE_DATE" value="INVOICE_DATE" /> 
    <element name="INVOICE_AMOUNT" value="INVOICE_AMOUNT" /> 
   </group>
  </group>
  </dataStructure>
 </dataTemplate>

before report trigger in xml data template

0 comments:

Post a Comment

Contact us for any Collaboration, Project Support & On Job Support Work

Name

Email *

Message *