3 Replies Latest reply: Nov 28, 2013 6:53 AM by William Wallace RSS

    Calling Jasper report from APEX

    Sachu

      Hi,

       

      Sorry to create a new thread for this. I saw lot of discussion regarding the topic in most of them its saying to install the integration application and use tomcat and all.

       

      Please let me know any other method is there to call a jasper report from APEX using dynamically created URL.

       

      it's an urgent requirement and i'm struggling for a week bcos I'm new to jasper  and APEX. Please help\

       

      Thanks in advance..

        • 1. Re: Calling Jasper report from APEX
          Sachu

          Please help me to call a jasper report using utl_http

          Please reply

          • 2. Re: Calling Jasper report from APEX
            AndyH

            Why don't you want to use the integration method?

            • 3. Re: Calling Jasper report from APEX
              William Wallace

              Dietmars integration kit has a stored procedure for making calls which today for some weird reason wasn't working today. I was getting a corrupted PDF back, it was working fine for other reports.

               

              xlib_jasperreports.show_report

               

              So created a new stored procedure as below and it works. So its an alternate way of doing the same thing.

               

              create or replace procedure download_pdf_report(p_url IN VARCHAR2,
                                                              p_output_file in varchar2)
              is
                  l_blob blob;
              BEGIN
                  DBMS_LOB.createtemporary(l_blob, false);
                  l_blob := httpuritype.createuri(p_url).getblob();
              
                  owa_util.mime_header('application/pdf',false);
              
                  htp.p('Content-Disposition: attachment; filename='||p_output_file);
                  htp.p('Content-length'||dbms_lob.getlength(l_blob));
              
                  owa_util.http_header_close;
                  wpg_docload.download_file(l_blob);
              
              END;