This discussion is archived
5 Replies Latest reply: Jul 11, 2013 2:02 AM by ascheffer RSS

Bug in apex_util.GET_PRINT_DOCUMENT?

ascheffer Expert
Currently Being Moderated

When call apex_util.get_print_document like this on apex.oracle.com

    t_pdf := apex_util.get_print_document( p_report_data => t_xml
                                                  , p_report_layout => t_xsl
                                                  );

 

I get  a ORA-00942: table or view does not exist

ORA-06512: at "SYS.DBMS_LOB", line 710

ORA-06512: at "APEX_040200.WWV_FLOW_UTILITIES", line 10589

ORA-06512: at "APEX_040200.WWV_FLOW_UTILITIES", line 11053

ORA-06512: at "APEX_040200.WWV_FLOW_UTILITIES", line 11138

ORA-06512: at "APEX_040200.HTMLDB_UTIL", line 3255

ORA-06512: at line 32

 

That must be a bug, or not?

  • 1. Re: Bug in apex_util.GET_PRINT_DOCUMENT?
    Jeff E Expert
    Currently Being Moderated

    I've run into this before and would say it is a bug.  To get around it pass a VARCHAR variable to the p_report_layout parameter or convert it:

     

      t_pdf := apex_util.get_print_document( p_report_data => t_xml  
                                                      , p_report_layout => TO_CHAR( t_xsl  )
                                                      );  
  • 2. Re: Bug in apex_util.GET_PRINT_DOCUMENT?
    ascheffer Expert
    Currently Being Moderated

    My report layout is a little bit to big for that, it has a length of 170168

  • 3. Re: Bug in apex_util.GET_PRINT_DOCUMENT?
    Hilary Expert
    Currently Being Moderated

    Hi,

     

    I've been unable to reproduce the error you've reported on apex.oracle.com, so would you mind placing a testcase on that instance and updating this thread with the workspace credentials so that we can take a closer look?  Based on the snippet you've provided, it's unclear whether you're attempting to use signature 1 or 4 of the GET_PRINT_DOCUMENT API (see API documentation here), so any additional information you can provide would be helpful.

     

    Regards,

    Hilary

  • 4. Re: Bug in apex_util.GET_PRINT_DOCUMENT?
    Jeff E Expert
    Currently Being Moderated

    It turns out I was getting the error when using APEX_UTIL.DOWNLOAD_PRINT_DOCUMENT instead of the original question use of APEX_UTIL.GET_PRINT_DOCUMENT.

     

    I've put together an example: http://apex.oracle.com/pls/apex/f?p=37159:1

  • 5. Re: Bug in apex_util.GET_PRINT_DOCUMENT?
    ascheffer Expert
    Currently Being Moderated

    The bug is caused by the fact that my template was selected from a table. Copying it to a temporary clob solves the problem.

    declare
      t_xml blob;
      t_pdf blob;
      t_xsl clob;
      t_xsl_ok clob;
      t_name varchar2(32767);
    begin
        select xml_data, name
        into t_xml, t_name
        from demo_xml
        where rowid = substr( apex_application.g_request, 8 );
        select xsl
        into t_xsl
        from demo_xsl
        where id = 1;
        dbms_lob.createtemporary( t_xsl_ok, true );
        dbms_lob.copy( t_xsl_ok, t_xsl, length( t_xsl ) );
        t_pdf := apex_util.get_print_document( p_report_data => t_xml
                                             , p_report_layout => t_xsl_ok
                                             );
        dbms_lob.freetemporary( t_xsl_ok );
    end;
    

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points