Thursday, 6 November 2014

XML Bursting through RDF Report



XML BURSTING THROUGH RDF REPORT


For Bursting we need to have 
1. RDF report. In rdf report we have to write the trigger in after report trigger

Why we write the trigger in After Report Trigger?

 The output which is coming from the concurrent program request, we want to send the output to the different persons using the Bursting program.

Check what we have to write in the Before Report trigger and After Report trigger

Before Report Trigger:-

function BeforeReport return boolean is
begin
  SRW.USER_EXIT('FND SRWINIT');
  return (TRUE);
end;

After Report Trigger:-

FUNCTION AfterReport RETURN BOOLEAN
IS
     v_sub_req                      NUMBER;
     v_cp_description               VARCHAR2(100);
     c_cp_request_id            CONSTANT  NUMBER         := :P_CONC_REQUEST_ID; 
BEGIN
         BEGIN 
               SELECT fcp.user_concurrent_program_name
                 INTO v_cp_description
                 FROM FND_CONCURRENT_REQUESTS    fcr, 
                      FND_CONCURRENT_PROGRAMS_VL fcp
             WHERE  fcr.concurrent_program_id = fcp.concurrent_program_id
               AND fcr.request_id             = c_cp_request_id;
         EXCEPTION WHEN OTHERS THEN 
              v_cp_description := NULL;
         END;

         BEGIN
              v_sub_req :=  fnd_request.submit_request(
                                                        application => 'XDO',             -- application
                                                        program => 'XDOBURSTREP',     -- Program
                                                       description=>  v_cp_description,  -- description
                                                      argument1=>'N' , 
                                                        argument2=> c_cp_request_id,   -- argument1
                                                       argument3=> 'Yes'                -- argument2
                                                      );
              COMMIT;
              IF v_sub_req <= 0
              THEN
                   SRW.MESSAGE('206','Failed to submit Bursting XML Publisher Request for Request ID = '|| c_cp_request_id);
              ELSE
                   SRW.MESSAGE('207','Submitted Bursting XML Publisher Request Request ID = ' || v_sub_req);
              END IF;
         EXCEPTION
            WHEN OTHERS THEN
                 RAISE SRW.PROGRAM_ABORT;
         END;

  SRW.USER_EXIT('FND SRWEXIT');
  RETURN (TRUE);

EXCEPTION
      WHEN SRW.USER_EXIT_FAILURE
      THEN
         SRW.MESSAGE (1, 'Failed in AFTER REPORT TRIGGER');
         RETURN (FALSE);
      WHEN OTHERS
      THEN
         SRW.MESSAGE (1000, 'Failed in When Others' || SQLERRM);
END;


Data Model:-

select * from emp where empno =:p_empno;


User Parameters:-

P_CONC_REQUEST_ID
P_EMPNO

Save the rdf file and move the rdf file in the respective top in the server through winscp.


Concurrent Program Registration:-

Register the rdf report which already you are having using the executable name and prepare the valueset for the empno parameter, output type should be xml and attach it to the concurrent program definition.


Now attach the concurrent program to any of the Request Group and run from that responsibility,  you will be getting the xml output of the query.

Copy the xml file and open 1 word document and upload the xml file and prepare the RTF as per your design.

After completing the rtf  , you need to move the rtf to the server in the below path as 
/u01/d02/apps/apps_st/appl/xdo/12.0.0/patch/115/publisher/templates/US/templatename.rtf

Path may vary based on the AU_TOP defined in your server.

Now you are having the xml file which was generated after running the concurrent program and rtf.

Now it is the time for creating the data definition and attach the RTF file in the template.

Go to the XML Publisher Responsibility and create the data definition, after that attach the rtf file in the template.

After doing this we need to create 1 Bursting file and attach it to the Data Definition.

Bursting control file will be as shown below:

<?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="/TEST/LIST_G_EMPNO/G_EMPNO">
<xapi:delivery>
<xapi:email id="123" server="your-server-address" port="25" from="chalam101251@gmail.com" >
<xapi:message id="123" to="chaloo.jayoo@gmail.com" attachment="true"
subject="Emp_details ${ENAME}">
--------------------------------------------------------------------------------------------------------Hi,

  Please find the attached employee details.

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material.
Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than
the intended recipient is prohibited.  If you received this in error, please contact the sender and delete the material from any computer.

Regards
HR
All Oracle Apps
</xapi:message>
</xapi:email>
</xapi:delivery>
<xapi:document output="${ENAME}.pdf" output-type="pdf" delivery="123">
<xapi:template type="rtf" location="/u01/d02/apps/apps_st/appl/xdo/12.0.0/patch/115/publisher/templates/US/TEST_PRACTISE.rtf">
      </xapi:template>
    </xapi:document>
</xapi:request>
</xapi:requestset>


After Attaching the Bursting control file and go to the particular responsibility and run the report and your output will be delivered to the person.

This is the concept of XML bursting in XML Publisher and you can do it using the PL/SQL Report and using Java Concurrent Program also.



No comments:

Post a Comment

Uploading PO Attachments from EBS to FTP Server

 create or replace PROCEDURE xx_upload_po_attachment(errbuff out varchar2, retcode out number)  IS CURSOR cur_new_attmt IS    select ponumbe...