PDF Printing with FOP/Apache Tomcat/J4LFOPServer in windows

Hi everyone,
I have been learning to create pdf report with Apex 4.2 and BI Publisher 10 which I have been successful with. Now I like to learn how to create pdf reports using FOP thinking of the customers who will not spend money on BI Publisher. I have gone through the documents and procedures described in Java 4 Less. http://www.java4less.com/apache/fop.php and http://www.java4less.com/fopdesigner/fodesigner.php?info=apex. Configured Apex instance setting accordingly.
For default layout a tabular pdf report is created.
I have created an xsl-fo file named Formatted_report.fo on same query and xml file from report query with BI Desktop. But when I try to print a formatted output with Formatted_report.fo report layout it does not work(J4LFOPServer ). but same layout with .rtf template works fine (BI Publisher Print Server).
Please help
Hasan Al Mamun
Programmer/Assistant Systems Analyst
Bangladesh Bank
Dhaka, Bangladesh
Edited by: 913230 on Dec 15, 2012 9:37 AM

hi,
if you use the J4lFOPServer as you write, you can set it in debug mode as described here:
http://www.java4less.com/apache/fop.php?info=faq#debug
you will then see the XML data and the FO data in the server window. Maybe you can see there if there is an error and that can help you fixing it.
Jon

Similar Messages

  • PDF printing with oc4j apache fop not working

    I am configuring PDF printing in Apex 3.1.1. I have set up a shared component report query with a simple query. I have implemented the oc4j standalone and implemented the fop.war as specified in the "pdf printing in Apex" documentation. When I use the test button to verify the output of the report, I am redirected to a 404-page not found and the oc4j instance logs the following:
    08/09/09 12:02:36 [ERROR] Logger not set
    08/09/09 12:02:36 [INFO] Using oracle.xml.parser.v2.SAXParser as SAX2 Parser
    08/09/09 12:02:36 [INFO] building formatting object tree
    08/09/09 12:02:36 [INFO] setting up fonts
    08/09/09 12:02:36 [INFO] [1]
    08/09/09 12:02:36 [WARNING] table-layout=auto is not supported, using fixed!
    08/09/09 12:02:36 [WARNING] Sum of fixed column widths 662000 greater than maximum specified IPD 658800
    08/09/09 12:02:36 [INFO] Parsing of document complete, stopping renderer
    Any ideas why this is happening?
    Database is oracle 9.2.0.7
    OC4J standalone 10.1.3

    Hello,
    Just did some more search on this, and apparently it's a more common problem:
    Re: PDF problem FOP mod_plsql: /pls/apex/wwv_flow.accept ORA-22293
    Regards,
    Dimitri
    http://dgielis.blogspot.com/
    http://www.apex-evangelists.com/
    http://www.apexblogs.info/

  • PDF Printing with FOP 0.94

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

    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

  • Apex with XE10g/Tomcat 6.0.13 PDF Print with Apex  FOP.WAR

    Apex with XE10g/Tomcat 6.0.13 PDF Print with Apex fop.war/apex_fop.jsp
    Hello,
    Excuse me bad english.
    I have a problem with Oracle XE and Printing from Reports over Tomcat 6.0.13.
    I have update Oracle XE with Apex 3.1 and it works fine.
    Now i have tried to Print a report to PDF. So i have deployed the FOP.WAR from Apex Utilities under Tomcat.
    I see in Tomcat Manager http://localhost:8888/manager/html/list that the FOO
    has been deployed and is running.
    If i try to print then i get this Message down to this page.
    Can anybody give me a hint to solve this problem???
    Hint
    To resolve the problem i have installed Oracle OC4J with same Port and deployed
    the same foo.war file.
    Then works and all printing from Oracle Apex work fine and okay.
    So i thing the Apex and Oracle work correct.
    But we have a small Application so i would prefer to work with Tomcat a application Server.
    Becaus of previous Errors have copied some *.jar files to C:\tomcat6.0.13\lib
    but i thing this is not the Problem.
    18.03.2007 18:12 546.765 xml.jar
    18.03.2007 18:07 634.772 xmlmesg.jar
    18.03.2007 18:14 1.238.899 xmlparserv2.jar
    10.06.2007 22:59 674.005 xquery.jar
    18.03.2007 18:11 3.059 xsqlserializers.jar
    18.03.2007 18:14 194.691 xsu12.jar
    10.11.2005 13:13 7.043.169 tools.jar
    .... and preinstalled files
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: java.lang.IllegalStateException: getOutputStream() has already been called for this response
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:541)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:429)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    java.lang.IllegalStateException: getOutputStream() has already been called for this response
    org.apache.catalina.connector.Response.getWriter(Response.java:604)
    org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:198)
    org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:125)
    org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:118)
    org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:186)
    org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:118)
    org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:77)
    org.apache.jsp.apex_005ffop_jsp._jspService(apex_005ffop_jsp.java:120)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    ------------------------------------------------------------------------

    at the end of the apex_fop.jsp put the follow code just before the driver.run(); line:
    out.clear();
    out = pageContext.pushBody();
    and explanation of why this works is here:
    http://forums.sun.com/thread.jspa?threadID=5307942

  • Apex 4.2.2 PDF Printing with Apex 2.0 Listener

    We recently installed Apex 4.2 with the Apex 2.0 Listener and can successfully print interactive reports and classic reports to PDF.  I viewed Mark Sewtz PDF Printing with Apex 4.2.2 and saw how he is using third party tools to format reports.  We have also looked into the Jasper Report Integration Toolkit, but have only got it working on the Tomcat environment, not WebLogic.
    I'm trying to download a classic report in PDF format with our logo displayed at the header.  In the print attributes section, there is a section for header.  I've tried adding the following in the header section:
    <img src = "http://hr.unm.edu/common/images/unm_dept_logo.gif">
    No Logo Prints
    #APP_IMAGES#unm_dept_logo.gif
    Prints in header:
    wwv_flow_file_mgr.get_file?
    p_security_group_id=3930016164431413%26p_flow_id=106%26p_fname=unm_dept_logo.gif
    #WORKSPACE_IMAGES#unm_dept_logo.gif
    Prints in header: /i/unm_dept_logo.gif
    I've also added the logo in the report region, prior to the columns printing, but no logo downloads to PDF.
    Does the Apex Listener only render text?  Is there any way to get the logo to print in the header without using a third party tool?  Any suggestions are greatly appreciated.  Thanks!

    Hi,
    There are different options to include images in your PDF exports. What's important to understand though is that with the PDF export functionality we separate the formatting from the actual data. So the formatting is defined in your RTF or XSL-FO templates and the data is stored in the XML that APEX generates based on your report data. We have several formatting options exposed on the print attributes pages, i.e. you can define page formatting, dimensions, fonts, colors, etc - all of these are applied to what we call generic XSL-FO templates. Those templates are generic in that they can be used with different reports, having variable numbers of columns and variable column names. Those formatting attributes can not be used however with named column templates, such as those that you generate with BI Publisher or those third-party tools I talked about in my Blog.
    So if you want to use these formatting options, you need a generic report layout - which you get out of the box using the built-in layout. But you also have the option to create your own generic report layout (see Shared Components -> Report Layouts). When creating a custom generic report layout, you'll get a copy of the built-in layout as a starting point. Once created, you can manually modify this layout to meet your needs. As you edit this template, you'll find a number of #....# substitution strings. This is what APEX uses at runtime to fill in your formatting values as well as to assemble your generic layout based on your result set.
    Now one way to include your own image would be to add an image reference to this generic report layout. You can't use the page header or footer attributes on the print attributes page for that because the FOP rendering engine does not understand or translate HTML. It renders XSL-FO. So to add your own image reference, you need to use XSL-FO mark-up. If you want to add an image to your page header, look for the #PAGE_HEADER# substitution string in the "Page Template" attribute of your generic report layout. You should be able to find the following:
    <fo:inline xsl:use-attribute-sets="page-header">
        #PAGE_HEADER#
    </fo:inline>
    Now assuming you have a file stored in your local images directory on localhost, you could add the following external graphic reference:
    <fo:inline xsl:use-attribute-sets="page-header">
        <fo:external-graphic src="http://localhost:8080/i/cloud.gif" content-height="scale-to-fit" height="30px"  content-width="150px" scaling="non-uniform"/>
        #PAGE_HEADER#
    </fo:inline>
    Once you're done with your chanages, save the report layout and edit your report. Go to the print attributes and select your generic report layout and then run your report page and export the PDF. Provided the APEX Listener is able to find this external image reference, it will now be included above your report in your PDF document.
    Regards,
    Marc

  • Printing with fop.war (ora-06502)

    Dear forum users,
    i need help with printing with fop comes within apex.
    I get error ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    select length(dbms_xmlgen.getxml('select print_kopf.key,
    print_kopf.print_kopfid,
    print_kopf.parameter2,
    print_kopf.indexnr,
    print_kopf.logo_mimetype,
    print_kopf.formularid,
    print_kopf.formular_text,
    print_kopf.Firma_Anschrift,
    print_kopf.KL_001,
    print_kopf.KV_001,
    print_kopf.KL_002,
    print_kopf.KV_002,
    print_kopf.KL_003,
    print_kopf.KV_003,
    print_kopf.KL_004,
    print_kopf.KV_004,
    print_kopf.KL_005,
    print_kopf.KV_005,
    print_kopf.KL_006,
    print_kopf.KV_006,
    print_kopf.KL_007,
    print_kopf.KV_007,
    print_kopf.KL_008,
    print_kopf.KV_008,
    print_kopf.KL_009,
    print_kopf.KV_009,
    print_kopf.KL_010,
    print_kopf.KV_010,
    print_kopf.KL_011,
    print_kopf.KV_011,
    print_kopf.KL_012,
    print_kopf.KV_012,
    print_fuss.FL_001,
    print_fuss.FV_001,
    print_fuss.FL_002,
    print_fuss.FV_002,
    print_fuss.FL_003,
    print_fuss.FV_003,
    print_fuss.FL_004,
    print_fuss.FV_004,
    print_fuss.FL_005,
    print_fuss.FV_005,
    print_fuss.FL_006,
    print_fuss.FV_006,
    print_fuss.FL_007,
    print_fuss.FV_007,
    print_fuss.FL_008,
    print_fuss.FV_008,
    print_fuss.FL_009,
    print_fuss.FV_009,
    print_fuss.FL_010,
    print_fuss.FV_010,
    print_fuss.FL_011,
    print_fuss.FV_011,
    print_fuss.FL_012,
    print_fuss.FV_012,
    print_fuss.FL_013,
    print_fuss.FV_013,
    print_fuss.FL_014,
    print_fuss.FV_014,
    print_fuss.FL_015,
    print_fuss.FV_015,
    print_fuss.FL_016,
    print_fuss.FV_016,
    print_fuss.FL_017,
    print_fuss.FV_017,
    print_fuss.FL_018,
    print_fuss.FV_018,
    print_fuss.FL_019,
    print_fuss.FV_019,
    print_fuss.FL_020,
    print_fuss.FV_020
    from dhw.print_kopf,dhw.print_fuss
    where print_kopf.print_kopfid=print_fuss.print_kopfid
    order by print_kopf.print_kopfid,print_kopf.indexnr')) XML from dual;
    result: 7154
    I have deployed fop.war with apache tomcat. When i reduce the select, it will work.
    After searching against this error i found that the length should be lower than 32k.
    So i have tested my select with this above and the regular length is 7154.
    So, what reason throws this error ?
    Any ideas ?
    Thanks for help.
    Frank

    no not yet with Application Server.
    I have tried to compare the settings to another installation with a separeted oc4j as described in the howto. But at the moment i found no mistakes.
    If i call the url adresse like:
    http://localhost:18101/fop/apex_fop.jsp
    i get:
    500 Internal Server Error
    Servlet error: java.lang.ClassNotFoundException: fop.apex__fop
    I installed it another time with these settings:
    Web Anwendung= .../fop.war (selected war file from apex install directory)
    Anwendungsname= fop
    URL zuordnen= /fop
    I would like to know if its possible to use the fop.war out of apex install directory with the Application server? In the standalone version (as described in howto) it works. But if you install it there you don't need to define an URL.
    Is the URL /fop correct or what do i have to insert there?

  • Pdf printing with linux client

    hi,
    i'm working with a SuSE 9.3 Client and I want to use PDF-Printing with the Acrobat Reader. With Windows Xp it works fine, but if i choose the PDF-Printer with the Linux-Client nothing happens. The PDF-Job exist in the cue. What do i have to do that it works?
    P.S. I`am from germany ;-)

    Thanks! But on which machine do i have to put the lp command?
    Application-Server?
    Tarantella Server?
    Client?
    I have put it on my Client! But nothinng happens.
    My PATH --> /home/me/bin:/usr/local/sgdee:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/jvm/jre/bin:/usr/lib/qt3/bin
    my script -->
    me@my-notebook:~> cat /usr/local/sgdee/lp
    #!/bin/bash
    LPINFILE=/tmp/.nclp.$$
    PATH="/bin:/usr/bin:/usr/local/bin:/usr/bin/X11:/usr/X11R6/bin"
    export PATH
    [ -f $1 ] && mv $1 $LPINFILE
    [ -f $2 ] && mv $2 $LPINFILE
    echo "Print: $* -> $LPINFILE" >> /tmp/nclog.`logname`
    echo "/usr/bin/xpdf -display $DISPLAY $LPINFILE; rm -f $LPINFILE" | at now
    exit 0
    me@my-notebook:~>

  • PDFs print with magenta when printing in greyscale

    PDFs print with magenta when printing in greyscale

    BTW... Asking the SAME thing THREE TIMES WON'T change the answer.

  • PDF Printing with XSL-FO and Apache FOP

    Can anyone show me in the right direction for this? I've been hitting a wall for the past 2 weeks or so and it's really starting to infuriate me. How am I supposed to work this out? Where do I start? Let's say I create a layout file with a WYSIWYG XSL editor, in what format do I export it? XSL, XSLT or XSL-FO? I figured it was XSL-FO, but who knows. I tried them all anyways, but nothing seems to work. I seem to be missing a step or something, 'cause something's definitely not right.
    I created a report query (which actually contains two queries):
    select distinct
    V_Usager.NUMEROPERSONNE NoPersonne,
    V_Usager.NOMUSUEL || ', ' || V_Usager.PRENOM Usager,
    V_Usager.DATENAISSANCE DateNaissance,
    V_Usager.DESCRIPTION Sexe,
    ID_Demande,
    NomNature || nvl2(PrecisionNature,', Précision: ' || PrecisionNature,'') Nature,
    NomCadre,
    decode(IND_Securitaire, 1, 'Oui', '0', 'Non') Securitaire,
    NomRessource,
    DT_Demande,
    Note,
    ltrim(decode(IND_DEMANDEIVAC,1,'Dossier IVAC','') || decode(IND_DEMANDEFLORES,1,', Dossier Florès','') || decode(IND_RISQUECRISE,1,', Risque de crise','') || decode(IND_MENOTTES,1,', Menottes nécessaires','') || decode(IND_ADRESSECONFIDENTIELLE,1,', Adresse confidentielle','') || decode(IND_TELEPHONECONFIDENTIEL,1,', Téléphone confidentiel','') || decode(IND_RISQUEFUGUE,1,', Risque de fugue','') || decode(IND_RISQUEVIOLENCE,1,', Risque de violence','') || decode(IND_MALDESTRANSPORTS,1,', Mal des transports','') || decode(IND_MEDICAMENT,1,', Médicament à remettre','') || decode(IND_SIEGE,1,'',2,', Siège fourni',3,', Siège d''enfant requis',4,', Siège de nouveau-né requis',5,', Siège d''appoint requis') || decode(IND_HANDICAP,1,'',2,', Handicap mental',3,', Handicap physique') || decode(IND_MEDICAMENT,1,', Médicament à remettre','') || decode(IND_JUMELER,1,'',2,', Ne pas jumeler',3,', Ne pas jumeler avec une fille',4,', Ne pas jumeler avec un garçon') || decode(IND_TRANSPORTEUR,1,'',2,', Transporteur féminin',3,', Transporteur masculin') || nvl2(REMARQUEPRECISIONS,', ' || REMARQUEPRECISIONS,''),',') Precisions,
    Disp1.PRENOM || ' ' || Disp1.NOM SaisiePar,
    Disp2.PRENOM || ' ' || Disp2.NOM || nvl2(Elem2.Description, ', ' || Elem2.Description,'') Requerant,
    ltrim(nvl(NOMPERSONNEAVISER,'') || nvl2(TELEPHONEPERSONNEAVISER_1,' ' || substr(TELEPHONEPERSONNEAVISER_1,1,3) || '-' || substr(TELEPHONEPERSONNEAVISER_1,4,3) || '-' || substr(TELEPHONEPERSONNEAVISER_1,7,4),'') || nvl2(TELEPHONEPERSONNEAVISER_2,' ' || substr(TELEPHONEPERSONNEAVISER_2,1,3) || '-' || substr(TELEPHONEPERSONNEAVISER_2,4,3) || '-' || substr(TELEPHONEPERSONNEAVISER_2,7,4),''),',') PersonneAAviser
    from
    TBL_Demande_1,
    TBL_Demande_TRSP_1,
    V_Dispensateur Disp1,
    V_Dispensateur Disp2,
    V_ElemStruct Elem2,
    V_Usager,
    TBL_CadresLegaux,
    TBL_Natures,
    TBL_Ressources
    where
    DemandeID = :P7_IDDEMANDE
    and ID_Demande = DemandeID
    and ID_Usager = UsagerID
    and ID_CLegal = IDCadre
    and ID_Nature = IDNature
    and IND_Ressource = IDRessource
    and ID_Intervenant LIKE Disp1.NumeroDispensateur
    and ID_SaisiePar LIKE Disp2.NumeroDispensateur
    and Elem2.ElemStructID = ID_ElemStructSaisiePar
    select
    to_char(DT_TRANSPORT, 'dd/mm/yyyy') || ' à ' || HR_TRANSPORT || nvl2(DUREE,' durée: ' || DUREE,'') DateTRSP,
    decode(IND_TYPETRANSPORT,1,'Aller',2,'Retour',3,'Aller/Retour') TypeTransport,
    case IND_TYPETRANSPORT
    when 1 then
    DEP_NOM || ', ' || DEP_ADRESSE || ', ' || DEP_CPOSTAL
    when 2 then
    DEST_NOM || ', ' || DEST_ADRESSE || ', ' || DEST_CPOSTAL
    when 3 then
    DEP_NOM || ', ' || DEP_ADRESSE || ', ' || DEP_CPOSTAL
    end AdresseDEP,
    case IND_TYPETRANSPORT
    when 1 then
    DEP_PRECISION
    when 2 then
    DEST_PRECISION
    when 3 then
    DEP_PRECISION
    end ContactDEP,
    case IND_TYPETRANSPORT
    when 1 then
    substr(DEP_TELEPHONE,1,3) || '-' || substr(DEP_TELEPHONE,4,3) || '-' || substr(DEP_TELEPHONE,7,4) || nvl2(DEP_POSTE,' poste ' || DEP_POSTE,'')
    when 2 then
    substr(DEST_TELEPHONE,1,3) || '-' || substr(DEST_TELEPHONE,4,3) || '-' || substr(DEST_TELEPHONE,7,4) || nvl2(DEST_POSTE,' poste ' || DEST_POSTE,'')
    when 3 then
    substr(DEP_TELEPHONE,1,3) || '-' || substr(DEP_TELEPHONE,4,3) || '-' || substr(DEP_TELEPHONE,7,4) || nvl2(DEP_POSTE,' poste ' || DEP_POSTE,'')
    end TelDEP,
    case IND_TYPETRANSPORT
    when 1 then
    DEST_NOM || ', ' || DEST_ADRESSE || ', ' || DEST_CPOSTAL
    when 2 then
    DEP_NOM || ', ' || DEP_ADRESSE || ', ' || DEP_CPOSTAL
    when 3 then
    DEST_NOM || ', ' || DEST_ADRESSE || ', ' || DEST_CPOSTAL
    end AdresseDEST,
    case IND_TYPETRANSPORT
    when 1 then
    DEST_PRECISION
    when 2 then
    DEP_PRECISION
    when 3 then
    DEST_PRECISION
    end ContactDEST,
    case IND_TYPETRANSPORT
    when 1 then
    substr(DEST_TELEPHONE,1,3) || '-' || substr(DEST_TELEPHONE,4,3) || '-' || substr(DEST_TELEPHONE,7,4) || nvl2(DEST_POSTE,' poste ' || DEST_POSTE,'')
    when 2 then
    substr(DEP_TELEPHONE,1,3) || '-' || substr(DEP_TELEPHONE,4,3) || '-' || substr(DEP_TELEPHONE,7,4) || nvl2(DEP_POSTE,' poste ' || DEP_POSTE,'')
    when 3 then
    substr(DEST_TELEPHONE,1,3) || '-' || substr(DEST_TELEPHONE,4,3) || '-' || substr(DEST_TELEPHONE,7,4) || nvl2(DEST_POSTE,' poste ' || DEST_POSTE,'')
    end TelDEST,
    decode(RET_NOM || ', ' || RET_ADRESSE || ', ' || RET_CPOSTAL, ', , ', '', RET_NOM || ', ' || RET_ADRESSE || ', ' || RET_CPOSTAL) AdresseRET,
    RET_PRECISION ContactRET,
    substr(RET_TELEPHONE,1,3) || '-' || substr(RET_TELEPHONE,4,3) || '-' || substr(RET_TELEPHONE,7,4) || nvl2(RET_POSTE,' poste ' || RET_POSTE,'') TelRET
    from
    TBL_Demande_1,
    TBL_Demande_TRSP_1
    where
    DemandeID = :P7_IDDEMANDE
    and ID_Demande = DemandeIDI then created a report layout in XSL-FO with XSLfast, but it won't work at all. I always get the dreaded "corrupted file" when I test my PDF Report... any ideas why it doesn't work? Have I missed something obvious?
    Best regards,
    Mathieu

    Hello Mathieu
    i assume that the default PDF printing is working, but that you want to create some better looking reports and therefore use a different non-generic XSL-FO.
    You can do several things in Apex but you can use the Apache-Fop conversion also indepent from Apex.
    What you need is:
    1) An XML (Data) File. You can get it from your report query when you say export it to XML.
    2) The XSL-FO (Layout) file. THis is the processing instruction that says how convert the XML Data into an XML-FO. You can create it manually or with some tool.
    3) The next step is to render the XML-FO into any output format (pdf, rtf, html)
    The creation of the XML-FO and of the PDF are done by the apache fop converter (cocoon or Batik framework if I remember correctly) in a single process but you can influence it so that both steps are done separately. See also: http://xmlgraphics.apache.org/fop/0.95/running.html
    The advantage is that you usually get much better error messages from the single steps.
    My recommendation would be to do all the steps with a very basic report first.
    Then gradually improve the complexity of the report, the data and the layout.

  • Problems with FOP/Apache - Apex PDF printing

    Hello,
    I have configured
    Apex 3.0.1
    iAS 10.1.3.x (http + modplsql)
    OC4J 10.1.3.3 (stand alone)
    FOP for PDF printing
    RDBMS 9.2.0.8 64bits (Solaris)
    following the OTN recipee and this setup does not seem to work for all cases.
    For instance, using the Apex admin interface, I go to the monitoring page :
    Home -> Monitor Page -> Login Attempts
    And click on the Print link (left bottom corner of the page) , it works o.k, the PDF is generated correctly.
    However, if I go to
    Home -> utilities -> Object Reports -> Table Storage Sizes
    and click on the Print link, it does not work. A pdf file is generated with the following text
    <HTML><HEAD><TITLE>500 Internal Server Error</TITLE></HEAD>
    <BODY><H1>500 Internal Server Error</H1>
    <PRE>Servlet error: An exception occurred. The current application deployment descriptors do not allow for including it in this response. Please consult the application log for details.</PRE>
    </BODY>
    </HTML>
    If I check in the application log I see the following error
    07/08/08 11:52:21.584 fop: Servlet error
    oracle.xml.xpath.XPathException: Error in expression: './/BYTES/1024/1024'.
    at oracle.xml.xslt.XSLBuilder.startElement(XSLBuilder.java:468)
    at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1288)
    at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:336)
    at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:303)
    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:320)
    at oracle.xml.xslt.XSLProcessor.newXSLStylesheet(XSLProcessor.java:712)
    at oracle.xml.xslt.XSLStylesheet.<init>(XSLStylesheet.java:321)
    at oracle.xml.parser.v2.XSLStylesheet.<init>(XSLStylesheet.java:114)
    at apex_fop._jspService(_apex__fop.java:71)
    at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.3.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
    at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
    at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
    at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
    at java.lang.Thread.run(Thread.java:595)
    I do not think it is related to a config/installation issue. It seems a parsing issue with the SQL stmt being executed, but it works for some SQL code and not for other.
    Some users did notice this problem this morning when testing the new PDF printing.
    Any ideas ?
    Nilo Segura
    CERN.

    ups.. sorry for the ugly formatting exercise...

  • Help with error (apache tomcat + java )

    hi all ! Im having an issue with my program.
    Im using jasper report to generate some reports from the program... everything seems to work except for this (making the program unstable at some point). When the report is generated and loaded as a pdf I get this error in the log.
    java.lang.IllegalStateException
    at org.apache.coyote.Response.reset(Response.java:296)
    at org.apache.catalina.connector.Response.reset(Response.java:642)
    at org.apache.catalina.connector.Response.reset(Response.java:908)
    at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:355)
    at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:211)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:134)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:736)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:619)
    The code Im using to generate the pdf is this one.
    File file = new File("C:\\Reportes\\", reporte +""+ datNac +".pdf");
    String contentType = getServletContext().getMimeType(reporte+ "" +datNac+ ".pdf");
    System.out.println("antes BufferedOutputStream");
    BufferedOutputStream output = null;
    output = new BufferedOutputStream(response.getOutputStream());
    BufferedInputStream inputFile = null;
    inputFile = new BufferedInputStream(new FileInputStream(file));
    response.reset();
    response.setContentType(contentType);
    response.setContentLength((int) file.length());
    response.setHeader("Content-disposition",
    "attachment; filename=\"" +file.getName()+ "\"");
    System.out.println("BufferedOutputStream");
    byte[] buffer = new byte[10240];
    for (int length; (length = inputFile.read(buffer)) != -1;) {
    output.write(buffer, 0, length);
    inputFile.close();
    output.close();Any help is appreciated.
    Thanks!
    Edited by: juanmanuelsanchez on Aug 4, 2009 11:17 AM
    Edited by: juanmanuelsanchez on Aug 4, 2009 11:18 AM
    Edited by: juanmanuelsanchez on Aug 4, 2009 11:19 AM

    juanmanuelsanchez wrote:
    java.lang.IllegalStateException
    at org.apache.coyote.Response.reset(Response.java:296)The response is already committed and thus cannot be reset anymore.
    output = new BufferedOutputStream(response.getOutputStream());
    response.reset();At least you should obtain the outputstream AFTER the reset. If that doesn't fix, then check everything in the chain before this code.

  • PDF Printing with images

    Hello all-
    I was wondering if it is possible to create a PDF document with images from a report that has images, through the FOP. I have tried this on APEX 3.2.1 and APEX 4.0.1, but with no success. I installed FOP in a standalone OC4J that I have installed on my PC and this works fine. I am using the Demonstration Application to test creating the PDF with images by trying to print page 23 - it is a report with images. I get a PDF report, but the image column is blank - no image, no errors. Has anyone been able to accomplish this?
    Thanks in advance,
    Greg

    Hi,
    yes you can, this tool allows you to create FOP templates with images (look at the examples)
    http://www.java4less.com/fopdesigner/fodesigner.php?info=guide
    You can of course create your own FOP templates without this tool, there is a XSL-FO tag to do that, you must make sure the images are available to the print server, either by referencing images on the file system or deploying the images in the print server.
    Jon

  • PDF printing with proxy server

    Hello,
    I installed Apex 3.0.1 and configured it for pdf printing using OC4J and Apache FOP. The OC4J process is running on the same server as the database. I used localhost as hostname and 8888 as port.
    Everything works fine, however, when I specify a proxy server in the Application Definition, the pdf printing stops working ... I suppose this is because the print server is now located through the proxy server and this doesn't work ... But, I need to configure the proxy server because I want to use an external web service ...
    Anyone else that has this problem and knows of a possible workaround ?
    Thanks
    Matthias

    Well, in my case this is not an option, since I used a demo host and domain name which can't be resolved through the proxy server ... If only there was an option to skip the proxy server for localhost settings (like there is in Internet Explorer).
    Matthias

  • PDF printing with APEX version 3.2.1 and OAS 10.1.2.3

    Hello,
    Is it possible to print PDF's with APEX version 3.2.1 and OAS 10.1.2.3? (Not using freeware- that'll never fly with my company).
    Thanks!

    JasperReports will do this and there is an integration toolkit out there for it and APEX.
    BI Publisher is available, and costly
    Oracle Reports can do this and is still available..
    One question, why would your company shy away from open source software like Cocoon/FOP? It comes with APEX 3.2 as an installable WAR and if you use the APEX listener, it comes with that for FREE!!
    Thank you,
    Tony Miller
    Webster, TX

  • SVG in pdf created with FOP

    Hello,
    is it possible to include SVG`s to a pdf report, which is created with FOP?
    I read something like Batik....
    Does anybody have any experiences about that?
    Thanks,
    Tim

    Thank you, CtDave, for your speedy reply and for the 'Acrobat Technical Evangelist' knowledge base article. Word 2000 is one of Microsoft's masterpieces - by disabling 'autosave', the application is totally stable, does not require 'activation' by Microsoft. Acrobat 9 enables 'saving' of interactive .pdf forms, a most valuable feature and one much appreciated by anyone completiing such forms. There must be more to this issue than 'incompatibility', because I can create a test Word 2000 document, hyperlink a valid URL, convert to .pdf with Acrobat 9, and the hyperlink works fine in Acrobat 9. When I attempt to do this using a much more complex Word 2000 document, embedded with scores of hyperlinks, these links fail to work following conversion to .pdf with Acrobat 9, but work fine following conversion to .pdf with  Acrobat 6. I can then use Acrobat 9 to open the .pdf created with Acrobat 6, and successfully edit any of these fully functional hyperlinks using the 'Link tool'. I don't know who prepared the 'Acrobat Technical Evangelist' article (AF1908DCd01) - no credits were cited, and I'm far from certain that this authentically belongs to Adobe's knowledge base. So I appreciate your sharing this information with me, but I cannot say that my question has been definitively answered. If you have any further information or tips, please reply in this thread. /rmbrown

Maybe you are looking for