7 Replies Latest reply on Aug 17, 2019 2:48 PM by OraDev

    Load Report HTML

    OraDev

      Dear All,

       

       

      We are using Apex 19.1 with database 18c and Oracle BI Publisher 12c, we have a report query that run as HTML report, now I want to run the report internally and get the HTML as a script in a text area.

       

       

      I tried to run a Dynamic Action: RETURN UTL_HTTP.request('f?p=333:0:15084665194133:PRINT_REPORT=TEST_HTML_REP') but failed, also tried

       

       

      RETURN UTL_HTTP.request('http://localhost:9502/ords/f?p=333:0:15084665194133:PRINT_REPORT=TEST_HTML_REP') got the HTML for the login page which means that it is not connected to the same session and needs security.

       

       

      Is there any soultion for that.

       

       

      Thank you.

        • 1. Re: Customer Tracker Gallery Setup
          fac586

          OraDev wrote:

           

          We are using Apex 19.1 with database 18c and Oracle BI Publisher 12c, we have a report query that run as HTML report, now I want to run the report internally and get the HTML as a script in a text area.

           

          I tried to run a Dynamic Action: RETURN UTL_HTTP.request('f?p=333:0:15084665194133:PRINT_REPORT=TEST_HTML_REP') but failed, also tried

           

          RETURN UTL_HTTP.request('http://localhost:9502/ords/f?p=333:0:15084665194133:PRINT_REPORT=TEST_HTML_REP') got the HTML for the login page which means that it is not connected to the same session and needs security.

           

          Is there any soultion for that.

          See the apex_util.get_print_document API method.

          • 2. Re: Load Report HTML
            OraDev

            Thank you very much fac586 for your reply,

             

                 The utility is helpful but it is returning an html blob file, do you have any way to get the html code itself like the one coming from utl_http.request.

             

            Best Regards,

            • 3. Re: Load Report HTML
              fac586

              OraDev wrote:

               

              Thank you very much fac586 for your reply,

               

              The utility is helpful but it is returning an html blob file, do you have any way to get the html code itself like the one coming from utl_http.request.

              Convert the BLOB to CLOB.

              • 4. Re: Load Report HTML
                OraDev

                Did not work for file conversion.

                • 5. Re: Load Report HTML
                  OraDev

                  DECLARE

                      l_id         NUMBER;

                      l_document   BLOB;

                  BEGIN

                      l_document := apex_util.get_print_document(

                          p_application_id       => 300,

                          p_report_query_name    => 'TEST_HTML_REPORT',

                          p_report_layout_name   => 'TEST_HTML_REPORT',

                          p_report_layout_type   => 'rtf',

                          p_document_format      => 'htm'

                      );

                     return trim(blob_to_clob(l_document));

                  END;

                   

                   

                  Working but it is giving Ajax call returned server error ORA-06502: PL/SQL: numeric or value error for Set Value.

                  Is there a way to increase the limit of the dynamic action / process / items

                  • 6. Re: Load Report HTML
                    fac586

                    OraDev wrote:

                     

                    DECLARE

                    l_id NUMBER;

                    l_document BLOB;

                    BEGIN

                    l_document := apex_util.get_print_document(

                    p_application_id => 300,

                    p_report_query_name => 'TEST_HTML_REPORT',

                    p_report_layout_name => 'TEST_HTML_REPORT',

                    p_report_layout_type => 'rtf',

                    p_document_format => 'htm'

                    );

                    return trim(blob_to_clob(l_document));

                    END;

                     

                     

                    Working but it is giving Ajax call returned server error ORA-06502: PL/SQL: numeric or value error for Set Value.

                    Is there a way to increase the limit of the dynamic action / process / items

                    What problem are you actually trying to solve?

                     

                    • Why the change from downloading the report directly to putting it in a text area?
                    • What "dynamic action" are you referring to?
                    • What's the size of the report?
                    • 7. Re: Load Report HTML
                      OraDev

                      I am loading the HTML in a text area and trying to send it in an email body using mailto, but the text area can not handle clob data, sending normal email from apex required SSL which is not available right now.