Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Error While running the report from APEX #44

#1

I have a problem calling the report from APEX 22.1 on button click(Screen shot attached),
I have install the demo App in the same workspace and I can run the same report from the demo application available with jri, but can not run the same report using my application.
Screenshot 2022-09-28 001859.png

  • solved #3
  • replies 3
  • views 740
  • likes 0
kashifsbr · Author
#2

used this pl/sql code to call the report, and shows the above error

DECLARE
   l_blob        BLOB;
   l_mime_type   VARCHAR2 (100);
   
   l_proc varchar2(100) := 'get report as blob, then show';
   p_report_url varchar2(1000) := 'http://localhost:8080/jri/report';
BEGIN
   xlog (l_proc, 'url (orig):' || p_report_url);

   xlib_jasperreports.set_report_url (p_report_url);
   xlib_jasperreports.get_report(p_rep_name => apex_util.url_encode('coffee'),
          p_rep_format          => apex_util.url_encode('pdf'),
          p_data_source         => apex_util.url_encode('hr'),
          p_rep_locale          => apex_util.url_encode('en_US'),
          p_rep_encoding        => 'UTF-8',
          p_additional_params   => '',
          p_out_blob            => l_blob,
          p_out_mime_type       => l_mime_type,
          p_print_job_name      => '');
   
   htp.flush;
   htp.init;
   OWA_UTIL.mime_header (ccontent_type      => l_mime_type,
                         bclose_header      => FALSE);
   HTP.p ('Content-length: ' || DBMS_LOB.getlength (l_blob));
   OWA_UTIL.http_header_close;
   WPG_DOCLOAD.download_file (l_blob);
   DBMS_LOB.freetemporary (l_blob);

  apex_application.stop_apex_engine;
EXCEPTION
   WHEN OTHERS
   THEN
      xlog (l_proc, SQLERRM, 'ERROR');
      RAISE;
END;
#3
kashifsbr accepted post #3 as the answer
#4