0 Replies Latest reply: Aug 22, 2014 12:08 PM by datagrunt RSS

    apex_util.download_print_document Not working

    datagrunt

      Environment:

       

      Linux 5

      Oracle DB:   11.2.0.3

      APEX:          4.2.5

      FOP:  APEX listener

      Webserver:  Apache Tom Cat on Linux

      Webservice: Oracle Rest Data Services 2.0.5

       

      I am attempting to generate a PDF using the apex_util.download_print_document procedure.

       

      I have created a generic column report layout and a report query in the shared components section.

       

      If I create a button that does a page submit with a print URL the PDF generates as expected.

       

      If I try to use the apex_util.download_print _document package I get the standard:

       

      "Adobe Reader could not open "KEITH_PDF_TEST" because it is either not a supported file type or because the file has been damaged."

       

      My call is in an after submit process defined as PL/SQL anonymous Block - the code is below.

       

      apex_util.download_print_document ( p_file_name           => 'KEITH_PDF_TEST.pdf',       

                                                                   p_content_disposition => 'attachment',   

                                                                   p_application_id      => :APP_ID,    

                                                                   p_report_query_name   => 'keith_pdf_test' ,       

                                                                   p_report_layout       => 'keith_pdf_test',   

                                                                   p_report_layout_type  => 'xsl-fo',      

                                                                   p_document_format     => 'pdf');

       

      When I look at the actual document generated as HTML I see:

       

      oracle.xml.parser.v2.XMLParseException:  Start of root element expected.

            at oracle.xml.parser.v2.XMLError.flushErrors1 (XMLError.java:337)....

           .......

       

      I have tried  swapping a number of values around with no luck.  Smells like a bug, but I am not so proud that I won't acknowledge operator error on my part.  Any help will be truly appreciated.

       

       

      additional info - always help to read the book....

       

      Is the APEX_UTIL.download_print_document considered an API?  If it is then the Application Express Builder User's guide states the following:

       

      page 404 - Oracle Application Express Listener -

       

      ".....The Oracle Application Express LIstener option does not require an external printer server, instead the report data and stylesheet are downloaded to the listener, rendered into PDF format by the listener and then sent to the client.  The PDF documents

      are not returned back into the database, thus the print API's are not supported when using the Oracle Application Express Listener-based configuration."

       

      Can anyone confirm that the APEX_UTIL.download_print-docment is considered an API?

       

      Message was edited by: datagrunt