Sunday, January 19, 2014

Call Oracle 10g Report Form Oracle Apex Application..

Purpose : I would like to show an 10g oracle report using Oracle Application Express.

Action :
1. Create a table for contain Report URL Information.
2. Create a procedure for return Return Report URL.
3. Create an Oracle Apex Form With 3 Item (Named P12_FROM_DATE, P12_TO_DATE, P12_URL).
4. Create an process Before Header (Name url_assigne)
5. Create an Branch After Processing (Name SHOW_REPORT)
6. Create an Button (SHOW)


1. Create a table for contain Report URL Information.
=========================================================
CREATE TABLE SY_REPORT_CONFIGURATION
(REPORT_SERVER VARCHAR2(30),
 MODULE_NAME    VARCHAR2(30),
 REPORT_EXTENSTION VARCHAR2(10),
 REPORT_FORMAT      VARCHAR2(10),
 REPORT_KEY_NAME    VARCHAR2(30),
 REPORT_FILE_PATH   VARCHAR2(200),
 REPORT_URL             VARCHAR2(300)
)

SET DEFINE OFF;
Insert into IMS.SY_REPORT_CONFIGURATION
   (REPORT_SERVER, MODULE_NAME, REPORT_EXTENSTION, REPORT_FORMAT, REPORT_KEY_NAME, REPORT_FILE_PATH, REPORT_URL)
 Values
   ('IMS', 'IMS', 'RDF', 'PDF', 'IMS',
    'G:\', 'http://10.11.201.200:7778/reports/rwservlet?');
COMMIT;


2. Create a procedure for return Return Report URL.
==========================================================

CREATE OR REPLACE PROCEDURE DPR_REPORT_RUN
(P_MODULE_NAME IN VARCHAR2,
 P_REPORT_FILE_NAME VARCHAR2,
 P_OUTPUE    OUT VARCHAR2)
IS
V_DATA1 VARCHAR2(300);
V_REPORT_SERVER  VARCHAR2(300);
V_MODULE_NAME    VARCHAR2(30);
V_REPORT_EXTENSTION  VARCHAR2(300);
V_REPORT_FORMAT  VARCHAR2(300);
V_REPORT_KEY_NAME  VARCHAR2(300);
V_REPORT_FILE_PATH  VARCHAR2(300);
V_REPORT_URL  VARCHAR2(300);
BEGIN

SELECT LOWER(REPORT_SERVER), LOWER(MODULE_NAME), LOWER(REPORT_EXTENSTION), LOWER(REPORT_FORMAT), LOWER(REPORT_KEY_NAME), LOWER(REPORT_FILE_PATH), LOWER(REPORT_URL)
INTO V_REPORT_SERVER,V_MODULE_NAME , V_REPORT_EXTENSTION, V_REPORT_FORMAT, V_REPORT_KEY_NAME, V_REPORT_FILE_PATH, V_REPORT_URL
FROM SY_REPORT_CONFIGURATION
WHERE LOWER(MODULE_NAME)=LOWER(P_MODULE_NAME);

V_DATA1 := V_REPORT_URL||V_REPORT_KEY_NAME||'&desformat=pdf&destype=cache&paramform=NO&report='||V_REPORT_FILE_PATH||P_REPORT_FILE_NAME;


EXCEPTION
       WHEN NO_DATA_FOUND THEN
                V_DATA1:='URL NOT FOUND '||LOWER(P_MODULE_NAME);
       WHEN TOO_MANY_ROWS THEN
                V_DATA1:='TOO MANY URL FOUND '||LOWER(P_MODULE_NAME);
P_OUTPUE :=V_DATA1;

END;
/

4. Create an process Before Header (Name url_assigne)
==================================================
 Process Code

BEGIN
DPR_REPORT_RUN
(P_MODULE_NAME         =>'IMS',
 P_REPORT_FILE_NAME =>'COMPAY_INFO',
 P_OUTPUE                        =>:P12_URL);
END;



5. Create an Branch After Processing (Name SHOW_REPORT)
==================================================
Target Type : URL

URL Target: &P12_URL.&P_FROM_DATE=&P12_FROM_DATE.&P_TO_DATE=&P12_TO_DATE.



6. Create an Button (SHOW)

Change Button Action : Submit Page
Now Click Show button and see your report ........


18 comments:

  1. video tutorial করে youtube a দিলে ভালো হতো। কোন rdf report run হবে এটা set করবো কিভাবে?

    ReplyDelete
  2. Ok. I will prepare an video tutorial for this article.

    ReplyDelete
  3. nice post, thanx for sharring.

    ReplyDelete
  4. How to run 10g Form in apex 5.0.3 without convert XML. Please give me a suggestion. also give us a video tutorial

    ReplyDelete
  5. Replies
    1. In this steps you have to Create an Oracle Apex Form With 3 Item (Named P12_FROM_DATE, P12_TO_DATE, P12_URL).

      Delete
  6. for opening report in new tab.
    javascript:var x=window.open('&P201_URL.&P_FROM_DATE=&P201_FROM_DATE.&P_TO_DATE=&P201_TO_DATE.','_blank');

    ReplyDelete
    Replies
    1. javascript:var x=window.open('http://10.10.10.25:9002/reports/rwservlet?keemp+report=Company-wise_11G.jsp+desformat=pdf+destype=cache+paramform=no'&eid=&p2_emr_ref.','_blank') please help me.. parameter not passed

      Delete
  7. Thanks for the post Rajib, it is really helpful.

    ReplyDelete
  8. P_OUTPUE :=V_DATA1;
    This line should be written before Exception, if i am not wrong.

    ReplyDelete
  9. No. If any exception occur out parameter P_OUTPUE of procedure return the URL by using this message you can find the cause of exception. So it is right.

    Thank you for your opinion.

    ReplyDelete
  10. how can we call oracle forms from apex?

    ReplyDelete
  11. HELO SIR
    I AM USING ORALCE APEX 5.1

    WHAT IS THE DEFAULT VALUE I SHOULD GIVE FOR
    P12_FROM_DATE, P12_TO_DATE, P12_URL

    ReplyDelete
  12. Thanks for sharing this great information I am impressed by the information that you have on this blog. Same as your blog i found another one Oracle APEX . Actually, I was looking for the same information on internet for
    Oracle Apex Interview Questions and Answers and came across your blog. I am impressed by the information that you have on this blog. It shows how well you understand this subject.



    ReplyDelete
  13. how to hide URL when we call rdf file. because whole passed parameter shows in url.
    please any one have ans help me

    ReplyDelete