1 2 Previous Next 16 Replies Latest reply: Sep 10, 2011 8:35 PM by fac586 RSS

    PDF Printing with FOP 0.94

    JoL
      Hi,
      are there any examples about printing apex report with FOP 0.94?

      Thanks,
      Sergio
        • 1. Re: PDF Printing with FOP 0.94
          Marc Sewtz-Oracle
          Sergio,

          Instructions on how to set this up, can be found here:

          http://www.oracle.com/technology/products/database/application_express/html/configure_printing.html#05

          And once that's up and running, all you have to do is edit any report region in your application, click on the "print attributes" tab and enable PDF printing.

          Regards,
          Marc
          • 2. Re: PDF Printing with FOP 0.94
            JoL
            Hi Marc,
            thank for your reply.
            I already configured PDF Printing with Apex 3.1 using FOP 0.25 and it works fine.
            Also i need to use FOP 0.94 features, but the apex_fop.jsp doesn't work with FOP 0.94 libraries, there are several difference, so i need a new JSP that works with the actual FOP release.

            Can you help me, please?

            Thanks,
            Sergio
            • 3. Re: PDF Printing with FOP 0.94
              Marc Sewtz-Oracle
              Sergio,

              Unfortunately we don't have a newer JSP available than the one provided. Not sure when we can make an update available. Perhaps there some APEX customers out there, who will work on updating the JSP and share this with the community?

              I'll reply back to this posting if I can find out more about the plans on our end.

              Regards,
              Marc
              • 4. Re: PDF Printing with FOP 0.94
                JoL
                Marc,
                i still working to a new jsp, but i have a problem with the XSL produced by
                ApEx for the Predefined Report Layout.
                Is there a way to modifiy this XSL code for all PDF generated by Predefined Report Layout?

                Thanks,
                Sergio
                • 5. Re: PDF Printing with FOP 0.94
                  Marc Sewtz-Oracle
                  Sergio,

                  Sure, you can either create your own XSL named column report layout, or create a generic XSL report column layout. Both can be created under shared components / report layouts, and then associated with report queries as well as report regions. And when creating a generic XSL layout, you start out with what's burned into the engine, so rather than re-doing the whole thing, you can just modify the burned in XSL code as needed and create a custom version.

                  Regards,
                  Marc
                  • 6. Re: PDF Printing with FOP 0.94
                    JoL
                    Marc,
                    i resolved, now i use FOP 0.94 with ApEx 3.1.

                    Thank you very much.
                    Sergio
                    • 7. Re: PDF Printing with FOP 0.94
                      4610
                      Sergio,

                      Would you mind uploading the new jsp somewhere so that others can use it as well? (Or at least post the changes to the original one provided by Oracle)

                      Chad
                      • 8. Re: PDF Printing with FOP 0.94
                        JoL
                        Sure Chad.
                        You can download the files at http://apex.oracle.com/pls/otn/f?p=21853:1

                        The steps to configure FOP 0.94 for ApEx 3.1 with OC4J 10.1.3.3 are :
                        1. Download FOP 0.94 binary (fop-0.94-bin-jdk1.4.zip) at http://www.apache.org/dyn/closer.cgi/xmlgraphics/fop and extract it.
                        2. From the original FOP.WAR (APEX_INSTALL_DIR\apex\utilities\fop) change the fop.war\WEB-INF\lib\* with FOP_EXTRACT_DIR\build\FOP.JAR and all libraries FOP_EXTRACT_DIR\lib\*.
                        Also change fop.war\WEB-INF\apex_fop.jsp and fop.war\apex_fop.jsp with the new apex_jsp.
                        3. Redeploy the FOP.WAR application following the doc http://www.oracle.com/technology/products/database/application_express/html/configure_printing.html#05
                        4. Create a new Custom Report Layout to print all generic report. The Layout is the same of the Generic Report Layout, but you have to change the position of the following lines :
                        <fo:region-before region-name="region-header" extent="54.0pt"/>
                        <fo:region-body region-name="region-body" margin-top="54.0pt" margin-bottom="54.0pt"/>
                        • 9. Re: PDF Printing with FOP 0.94
                          296107
                          Hi,

                          i used your tips on getting fop-0.94 to work with Apex 3.1 and the standard report works, because i could change the Layout from Default to the one you are distributed.

                          But i cannot get the interactive printing to work, i didn't find the point to change the layout !?!

                          Can you point me out ?

                          Thanks,
                          Wolfgang
                          • 10. Re: PDF Printing with FOP 0.94
                            Marc Sewtz-Oracle
                            Wolfgang,

                            Interactive Report Region currently do not supporting changing the report layout, they use basically the same default template that's used for "classic" report regions, but there's no option available to change this to a custom version.

                            Regards,
                            Marc
                            • 11. Re: PDF Printing with FOP 0.94
                              JoL
                              Sorry Wolfgang,
                              but i didn't try FOP 0.94 with Interactive Report Region but with Classic Report Region.

                              Sergio
                              • 12. FOP 0.94/95 with TOMCAT 6?
                                411198
                                Hi!

                                I am trying to get this solution working on a LINUX system using TOMCAT 6.0.18 rather than OC4J which we don't have a license for. I have tried both FOP 0.94 and 0.95 and seem to get similar problems. Here is the error message:

                                org.apache.jasper.JasperException: An exception occurred processing JSP page /apex_fop.jsp at line 28

                                25: // Setup XSLT
                                26: System.setProperty("javax.xml.transform.TransformerFactory","org.apache.xalan.processor.TransformerFactoryImpl");
                                27: TransformerFactory factory = TransformerFactory.newInstance();
                                28: Transformer transformer = factory.newTransformer(new StreamSource(new java.io.StringReader(request.getParameter("template"))));
                                29:
                                30: // Set the value of a <param> in the stylesheet
                                31: transformer.setParameter("versionParam", "2.0");


                                Stacktrace:
                                     org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
                                     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
                                     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
                                     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
                                     javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                                root cause
                                java.lang.NullPointerException
                                     java.io.StringReader.<init>(StringReader.java:33)
                                     org.apache.jsp.apex_005ffop_jsp._jspService(apex_005ffop_jsp.java:92)
                                     org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
                                     javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                                     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
                                     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
                                     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
                                     javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

                                Any hints, tips, suggestions, etc. gratefully welcomed!

                                Dave Venus
                                • 13. Re: PDF Printing with FOP 0.94
                                  737688
                                  Hi, I compiled Cocoon 2.2 with FOP 0.95, JFOR, POI, BATIK-1.7, using JDK 1.6, to download: http://codigolivre.org.br/frs/download.php/6407/cocoon-webapp-1.0.war

                                  Just put that cocoon-webapp-1.0.war into you webapps folder.
                                  In the apex administration go to, Manage Service, Manage Environment Settings, Instance Settings, Report Printing

                                  Then in the report print settings leave like that:
                                  Print Server: Standard
                                  Print Server Protocol: HTTP
                                  Print Server Host Address: (Put the address of tomcat, ex: 127.0.0.1)
                                  Print Server Port: (put the port that tomcat is listening to, ex: 8088)
                                  Print Server Script: /cocoon-webapp-1.0/fop_post/
                                  • 14. Re: PDF Printing with FOP 0.94
                                    BowHunter
                                    I realize it has been a while, but your script help me update my apex_fop.jsp to fop-1.0. Do you happen to have a way I can add TTF fonts? I have tired many things without success including the following line after FopFactory fopFactory = FopFactory.newInstance();.

                                    fopFactory.getFontManager().setFontBaseURL("file:///usr/lpp/X11/lib/X11/fonts/TrueType");

                                    Thanks
                                    1 2 Previous Next