8 Replies Latest reply on Nov 16, 2015 7:15 PM by Erick Diaz

    Help Configuring ORDS 2 as a PDF Print Server for Apex

    Erick Diaz

      Hi,

       

      I have the following scenario and something is not working correctly and need some ideas of what may be the issue:

       

      Currently, I have Apex 4.2 running on a database 11g and using HTTP server with mod_plsql. I installed and configured ORDS 2.0.10.289.08.09 and deployed on a WebLogic Server 10.3 to use it as my PDF Print Server.

       

      On Apex, if I specify “Oracle Apex Listener” as the Print Server and access my applications using ORDS as the listener, I am able to generate a valid PDF. However, if I configure my Print Server as follow based on this thread (https://community.oracle.com/message/13212045#13212045) and try to access my applications using the HTTP server, it’s not generating a valid PDF (Failed to load PDF document):

       

      Print Server: External (Apache FOP)
      Print Server Protocol: HTTP
      Print Server Host Address: SERVER_NAME
      Print Server Port: 7001
      Print Server Script: /_/fop2pdf

       

      I also added the entry key "misc.enableOldFOP" in "defaults.xml" of ORDS configuration as specified on the Oracle White Paper: Creating Custom PDF Reports with Oracle Application Express and the APEX Listener (http://www.oracle.com/technetwork/developer-tools/apex/learnmore/custom-pdf-reports-1953918.pdf)

       

      Please let me know if additional information is need.

       

      Thank you,

       

      Erick

        • 1. Re: Help Configuring ORDS 2 as a PDF Print Server for Apex
          Kiran Pawar

          Hi Erick Diaz,

          Erick Diaz wrote:

           

          I have the following scenario and something is not working correctly and need some ideas of what may be the issue:

          Currently, I have Apex 4.2 running on a database 11g and using HTTP server with mod_plsql. I installed and configured ORDS 2.0.10.289.08.09 and deployed on a WebLogic Server 10.3 to use it as my PDF Print Server.

          On Apex, if I specify “Oracle Apex Listener” as the Print Server and access my applications using ORDS as the listener, I am able to generate a valid PDF. However, if I configure my Print Server as follow based on this thread (https://community.oracle.com/message/13212045#13212045) and try to access my applications using the HTTP server, it’s not generating a valid PDF (Failed to load PDF document):

          Print Server: External (Apache FOP)
          Print Server Protocol: HTTP
          Print Server Host Address: SERVER_NAME
          Print Server Port: 7001
          Print Server Script: /_/fop2pdf

          I also added the entry key "misc.enableOldFOP" in "defaults.xml" of ORDS configuration as specified on the Oracle White Paper: Creating Custom PDF Reports with Oracle Application Express and the APEX Listener (http://www.oracle.com/technetwork/developer-tools/apex/learnmore/custom-pdf-reports-1953918.pdf)

          Please let me know if additional information is need.

              If you see the thread closely, the above mentioned "Print Server Script" viz. "/_/fop2pdf" is for ORDS as "Print Server" for Oracle APEX.

              If you use ORDS as "Print Server" with Oracle APEX, it does not ask details about the "Print Server" and internally it uses "/_/fop2pdf" as "Print Server Script". The reason is with ORDS 2.0 and above the Apache FOP is bundled with ORDS. Hence, no need to install Apache FOP separately when you are using ORDS as "Print Server". With APEX 5.0 and above installable, the APEX Team has ceased providing "External Apache FOP" as it is already provided with ORDS.

              For configuring Oracle REST Data Services (ORDS) as Print Server refer the following :

           

              If you still want to use "External Apache FOP" (as you are using APEX 4.2), then go to folder where APEX 4.2 is extracted. There is "fop.war" at "/path/to/apex/utilities/fop/fop.war". Deploy the fop.war to a Java EE Web Server (in your case you can deploy it to WebLogic Server). Then configure the "Print Server" settings in APEX Instance settings as:

          Print Server: External (Apache FOP)

          Print Server Protocol: HTTP

          Print Server Host Address: SERVER_NAME

          Print Server Port: 7001

          Print Server Script: /fop/apex_fop.jsp

               Refer : PDF Printing in Application Express 3.1 and above

           

          Regards,

          Kiran

          1 person found this helpful
          • 2. Re: Re: Help Configuring ORDS 2 as a PDF Print Server for Apex
            Erick Diaz

            Hi Kiran Pawar,

             

            Thank you for your reply.

             

            Maybe I did not explain myself clearly. I am currently using HTTP with mod_plsql, and deployed ORDS on a WebLogic Server only to be used as the Print Server, that’s the reason why I’m using the option “External (Apache FOP)” as the Print Server and specifying all the details as you suggested on this thread https://community.oracle.com/message/13212741#13212741

             

            In any case, ORDS as a Print Server is not working either by selecting “External (Apache FOP)” or “Oracle APEX Listener”, and I’m not sure where to start looking for any issues.

             

            In my original post, I mentioned that using ORDS (instead of HTTP with mod_plsql) to run my Apex application, I was able to generate a valid PDF; I did this just to make sure my ords.war was configured and deployed correctly, but right now my plan is to use it only as a Print Server.

             

            Best regards,

             

            Erick

            • 3. Re: Help Configuring ORDS 2 as a PDF Print Server for Apex
              Kiran Pawar

              Hi Erick Diaz,

              Erick Diaz wrote:

               

              Maybe I did not explain myself clearly. I am currently using HTTP with mod_plsql, and deployed ORDS on a WebLogic Server only to be used as the Print Server, that’s the reason why I’m using the option “External (Apache FOP)” as the Print Server and specifying all the details as you suggested on this thread https://community.oracle.com/message/13212741#13212741

              In any case, ORDS as a Print Server is not working either by selecting “External (Apache FOP)” or “Oracle APEX Listener”, and I’m not sure where to start looking for any issues.

              In my original post, I mentioned that using ORDS (instead of HTTP with mod_plsql) to run my Apex application, I was able to generate a valid PDF; I did this just to make sure my ords.war was configured and deployed correctly, but right now my plan is to use it only as a Print Server.

                   Yeah, you should have mentioned which web server you are using for Oracle APEX in your question itself. It is good to mention all the environment details with detail versions of software upfront as forum members are unaware what your environment is and how to answer a question related to a chunk of information.

                   As with OHS as your web server for Oracle APEX, you cannot use ORDS as your "Print Server". You have to configure ORDS + Oracle Weblogic as your web server for Oracle APEX, then only you can use ORDS as your "Print Server".

                   Refer : Re: saving output in pdf

                   Secondly, "External (Apache FOP)" and "Oracle APEX Listener" is not the same. Given that with ORDS 2.0 and above, the Apache FOP is bundled with ORDS, but with Oracle APEX to use ORDS as Print Server, you have configure ORDS + Supported Java EE Application Server as your web server for Oracle APEX.

                   Refer : http://www.oracle.com/technetwork/developer-tools/apex/learnmore/custom-pdf-reports-1953918.pdf

                   NOTE : See the prerequisites section of the white-paper which clearly states to use ORDS(APEX Listener) as Web Server for Oracle APEX.

                   Lastly, If you want to use "External (Apache FOP)" as your Print Server, then you have to use "fop.war" bundled with APEX 4.2 deploy it to OC4J (mostly used) as mentioned above in my reply.

                   Refer:

               

              Regards,

              Kiran

              • 4. Re: Re: Help Configuring ORDS 2 as a PDF Print Server for Apex
                Erick Diaz

                Hi Kiran,

                 

                Yeah, you should have mentioned which web server you are using for Oracle APEX in your question itself.

                 

                I did mention it right at the beginning of my thread: "Currently, I have Apex 4.2 running on a database 11g and using HTTP server with mod_plsql."

                 

                As with OHS as your web server for Oracle APEX, you cannot use ORDS as your "Print Server".

                 

                I must disagree with you on this one. As Marc Sewtz mention on your thread which I've been using as a reference (https://community.oracle.com/message/13214420#13214420):

                 

                The "external (Apache FOP)" option is still needed though, if for whatever reason you have to use mod_plsql or EPG for APEX and then only use ORDS as the print server - in which case you will have to configure all the attributes (host, port, script), since those would then be different from your APEX host and port.

                 

                That’s the reason I’m using External (Apache FOP) as my Print Server and providing all the details about ORDS.

                 

                Thank you,

                 

                Erick

                • 5. Re: Help Configuring ORDS 2 as a PDF Print Server for Apex
                  Kiran Pawar

                  Hi Erick,

                  Erick Diaz wrote:

                   

                  I must disagree with you on this one. As Marc Sewtz mention on your thread which I've been using as a reference (https://community.oracle.com/message/13214420#13214420):

                  The "external (Apache FOP)" option is still needed though, if for whatever reason you have to use mod_plsql or EPG for APEX and then only use ORDS as the print server - in which case you will have to configure all the attributes (host, port, script), since those would then be different from your APEX host and port.

                  That’s the reason I’m using External (Apache FOP) as my Print Server and providing all the details about ORDS.

                       Okay got your point. So, try this for using ORDS + Oracle WebLogic Server as Print Server :

                  Print Server: External (Apache FOP)

                  Print Server Protocol: HTTP

                  Print Server Host Address: SERVER_NAME (on which ORDS + Oracle Weblogic Server is installed)

                  Print Server Port: 7001 (Oracle Weblogic Server Port)

                  Print Server Script: /ords/_/fop2pdf

                       Refer : Re: What value for p_print_server when using Rest Data Services as print server?

                   

                  Regards,

                  Kiran

                  1 person found this helpful
                  • 6. Re: Re: Help Configuring ORDS 2 as a PDF Print Server for Apex
                    Erick Diaz

                    Hi Kiran,

                     

                    Thanks for getting back to me.

                     

                    Unfortunately, the change you suggested didn’t work; but, here are a few additional info related to my issue:

                     

                    If I open the invalid PDF file with a text editor, I can see the following message:

                     

                    <pre>report error:
                    ORA-20001: The printing engine could not be reached because either the URL specified is incorrect or a proxy URL needs to be specified.</pre>
                    

                     

                    This error matches with the section 7 of the document you provided (http://www.oracle.com/technetwork/developer-tools/apex/application-express/configure-printing-093060.html#07) on which I need to enable network services; however, the DBA assured me she already did this step as specified on the Apex 4.2 Installation Guide in order to be able to send outbound emails ( https://docs.oracle.com/cd/E37097_01/install.42/e35123/otn_install.htm#HTMIG429).

                     

                    Do you have any other suggestions?

                     

                    Also, am I supposed to see a fop2pdf file on my ORDS directory? Because I cannot and I’m assuming this fop2pdf resides inside the ords.war.

                     

                    Regards,

                     

                    Erick

                    • 7. Re: Help Configuring ORDS 2 as a PDF Print Server for Apex
                      Kiran Pawar

                      Hi Erick Diaz,

                      Erick Diaz wrote:

                       

                      Also, am I supposed to see a fop2pdf file on my ORDS directory? Because I cannot and I’m assuming this fop2pdf resides inside the ords.war.

                           As Apache FOP is bundled inside ords.war, you don't have to worry about it's location.

                      Unfortunately, the change you suggested didn’t work; but, here are a few additional info related to my issue:

                      If I open the invalid PDF file with a text editor, I can see the following message:

                       

                      report error:

                      ORA-20001: The printing engine could not be reached because either the URL specified is incorrect or a proxy URL needs to be specified.

                       

                      This error matches with the section 7 of the document you provided (http://www.oracle.com/technetwork/developer-tools/apex/application-express/configure-printing-093060.html#07) on which I need to enable network services; however, the DBA assured me she already did this step as specified on the Apex 4.2 Installation Guide in order to be able to send outbound emails ( https://docs.oracle.com/cd/E37097_01/install.42/e35123/otn_install.htm#HTMIG429).

                      Do you have any other suggestions?

                            Here are my suggestions:

                      • Considering that you have granted the required privileges still to confirm
                      SELECT *
                        FROM DBA_NETWORK_ACL_PRIVILEGES
                      WHERE PRINCIPAL = 'APEX_040200';
                      
                      • Check whether there is network connectivity between your Print Server (where ORDS is installed) and APEX Server (where Oracle APEX is installed)

                       

                      Regards,

                      Kiran

                      • 8. Re: Re: Help Configuring ORDS 2 as a PDF Print Server for Apex
                        Erick Diaz

                        Hi Kiran,

                         

                        As you suggested, the privilege was missing from DBA_NETWORK_ACL_PRIVILEGES.

                         

                        In addition, the Print Server Script worked as you suggested, i.e. /ords/_/fop2pdf, instead of /_/fop2pdf.

                         

                        Thank you for your help.

                         

                        Regards,

                         

                        Erick