Apache FOP Examples

Hi,
I am interested in using Apache FOP & Apex for PDF creation as are multiple others, can anyone post some finished example PDF's for those of us considering this method to look at?
Thanks!

I believe that this <xsl:value-of select="$ITEMS/LIST_ITEMS/ITEMS/def"/> will not work. You need to derive the value stored in ITEMS using $ITEMS and then concatentate the rest of the text to construct the path...
Try this: 
<xsl:value-of select="concat($ITEMS, '/LIST_ITEMS/ITEMS/def')"/>
Thanks,
Bipuser

Similar Messages

  • Help generate dynamic table in xslt for apache FOP

    down vote favorite
    For the following xml file, i need to generate an xsl-fo file to be converted into pdf.
    I am new to style sheets and struggling to create dynamic table. Please help.
    Also, the width for each column varies,based on the column.How would i include this into the code?
    The Column Headers and Column Values are dynamically populated in the xml file. Below is a sample.
    Can anybody please help in generating xsl-fo or xslt code?
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <ReportData>
    <ColumnHeaders>
    <ColumnHeader>
    <Name>Col-Header1</Name>
    <Width>5</Length>
    </ColumnHeader>
    <ColumnHeader>
    <Name>Col-Header2</Name>
    <Width>10</Length>
    </ColumnHeader>
    <ColumnHeader>
    <Name>Col-Header3</Name>
    <Width>8</Length>
    </ColumnHeader>
    </ColumnHeaders>
    <Rows>
    <Row>
    <Column>Row1-Col1</Column>
    <Column>Row1-Col2</Column>
    <Column>Row1-Col3</Column>
    </Row>
    <Row>
    <Column>Row2-Col1</Column>
    <Column>Row2-Col2</Column>
    <Column>Row2-Col3</Column>
    </Row>
    </Rows>
    </ReportData>

    I did some xsl-fo a few years ago for a project.
    It was an invoice generator spawning multiple PDFs out of single XML document generated from the database. Pretty cool stuff but very resource-consuming.
    I'm a bit rusty but here's a basic example for a single table, based on your sample data :
    XSLT stylesheet :
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
      <xsl:output indent="yes"/>
      <xsl:template match="/ReportData">
        <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
          <fo:layout-master-set>
            <fo:simple-page-master master-name="Main" margin="8mm"
              page-width="250mm"
              page-height="100mm">
              <fo:region-body />
            </fo:simple-page-master>
          </fo:layout-master-set>
          <fo:page-sequence master-reference="Main">
            <fo:flow flow-name="xsl-region-body">
              <fo:block>
                <fo:table table-layout="fixed" border-style="solid">
                  <xsl:apply-templates select="ColumnHeaders/ColumnHeader" mode="column"/>
                  <xsl:apply-templates select="ColumnHeaders"/>
                  <fo:table-body>
                       <xsl:apply-templates select="Rows/Row"/>
                  </fo:table-body>
                </fo:table>     
              </fo:block>
            </fo:flow>
          </fo:page-sequence>
        </fo:root>
      </xsl:template>
      <xsl:template match="ColumnHeaders">
        <fo:table-header>
             <fo:table-row background-color="rgb(200,200,200)">
                  <xsl:apply-templates select="ColumnHeader" mode="header"/>
             </fo:table-row>
        </fo:table-header>
      </xsl:template>
      <xsl:template match="ColumnHeader" mode="column">
        <fo:table-column column-width="{concat(Width*10,'mm')}"/>
      </xsl:template>
      <xsl:template match="ColumnHeader" mode="header">
        <fo:table-cell border-style="solid">
          <fo:block font-weight="bold"><xsl:value-of select="Name"/></fo:block>
        </fo:table-cell>
      </xsl:template>
      <xsl:template match="Row">
           <fo:table-row>
          <xsl:apply-templates select="Column"/>
        </fo:table-row>
      </xsl:template>
      <xsl:template match="Column">
        <fo:table-cell border-style="solid">
          <fo:block><xsl:value-of select="."/></fo:block>
        </fo:table-cell>
      </xsl:template>
    </xsl:stylesheet>
    {code}
    Calling the XSLT engine and FOP :
    {code}
    D:\XSLT>gen_pdf_otn.bat
    D:\XSLT>java -jar saxon9he.jar -s:in/reportdata.xml -xsl:testfo.xsl -o:out/testfo.xml  2>errors.log
    D:\XSLT>java -jar fop.jar org.apache.fop.cli.Main -fo out/testfo.xml -pdf out/testfo.pdf -c morefontsconfig.xml  2>errors.log
    D:\XSLT>pause
    Appuyez sur une touche pour continuer...
    {code}
    Ouput :
    - The intermediate XSL-FO document :
    {code:xml}
    <?xml version="1.0" encoding="UTF-8"?>
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
       <fo:layout-master-set>
          <fo:simple-page-master master-name="Main" margin="8mm" page-width="250mm" page-height="100mm">
             <fo:region-body/>
          </fo:simple-page-master>
       </fo:layout-master-set>
       <fo:page-sequence master-reference="Main">
          <fo:flow flow-name="xsl-region-body">
             <fo:block>
                <fo:table table-layout="fixed" border-style="solid">
                   <fo:table-column column-width="50mm"/>
                   <fo:table-column column-width="100mm"/>
                   <fo:table-column column-width="80mm"/>
                   <fo:table-header>
                      <fo:table-row background-color="rgb(200,200,200)">
                         <fo:table-cell border-style="solid">
                            <fo:block font-weight="bold">Col-Header1</fo:block>
                         </fo:table-cell>
                         <fo:table-cell border-style="solid">
                            <fo:block font-weight="bold">Col-Header2</fo:block>
                         </fo:table-cell>
                         <fo:table-cell border-style="solid">
                            <fo:block font-weight="bold">Col-Header3</fo:block>
                         </fo:table-cell>
                      </fo:table-row>
                   </fo:table-header>
                   <fo:table-body>
                      <fo:table-row>
                         <fo:table-cell border-style="solid">
                            <fo:block>Row1-Col1</fo:block>
                         </fo:table-cell>
                         <fo:table-cell border-style="solid">
                            <fo:block>Row1-Col2</fo:block>
                         </fo:table-cell>
                         <fo:table-cell border-style="solid">
                            <fo:block>Row1-Col3</fo:block>
                         </fo:table-cell>
                      </fo:table-row>
                      <fo:table-row>
                         <fo:table-cell border-style="solid">
                            <fo:block>Row2-Col1</fo:block>
                         </fo:table-cell>
                         <fo:table-cell border-style="solid">
                            <fo:block>Row2-Col2</fo:block>
                         </fo:table-cell>
                         <fo:table-cell border-style="solid">
                            <fo:block>Row2-Col3</fo:block>
                         </fo:table-cell>
                      </fo:table-row>
                   </fo:table-body>
                </fo:table>
             </fo:block>
          </fo:flow>
       </fo:page-sequence>
    </fo:root>
    {code}
    - and the PDF document :
    http://mbperso.pagesperso-orange.fr/oracle/testfo.pdf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Apache FOP format text

    I'm using Apex en Apache FOP to producce PDF reports.
    In the table i have some text for example: 'This is a <strong>short</strong> letter for me'
    When i have print the report, the text will not be parsed, because the text 'short' isn't bold. How can i do that ?

    Hi Bruinsmm,
    Thanks for reply.
    I did what you mentioned and it is working fine.
    I could generate pdf file,
    but when i am using report layout, it is giving me error
    (The adope reader could not open test.pdf because it is either not a supported file type or because the file has been damaged
    (for example, it was sent as an email attachment and wasn't correctly decoded)
    is there any thing should be running with tomcat??
    Thans and best regards.
    mohd.

  • Printing XLS, HTML, or RTF using Apache FOP

    Hi,
    Is it possible to print XLS, HTML, or RTF reports using Apache FOP? If not, is there another open source or free print server that will do this?
    Thank you.
    Martin

    Hello,
    >>
    Your going to want to study the Cocoon sitemap concept to see how to pipeline the xml and xsl to the right output.
    >>
    To get this working correctly you need to understand the Cocoon sitemap concept and how to read data out of the XML file your posting in order to pipeline it to the right rendering format. It's pretty much a hands on affair so it depends on what your trying to do, sorry there is no easier way to do it.
    In a future versions it will be easier to do this as you will be able to select specific end points per report.
    Regards,
    Carl
    blog : http://carlback.blogspot.com/
    apex examples : http://apex.oracle.com/pls/otn/f?p=11933:5

  • Error while configuring apache FOP for printing

    Dear All,
    I have a requirement to print a report using custom layout.
    I have installed apex 4.2 by configuring embedded PL/SQL gateway. I used the link:
    http://docs.oracle.com/cd/E37097_01/doc/install.42/e35123/overview.htm#CJABBFIH
    And for printing purpose I am installing apache FOP. I have installed oc4j in standalone mode. I followed the link:
    http://www.oracle.com/technetwork/developer-tools/apex/application-express/configure-printing-093060.html
    But after setting oc4jadmin password, I am getting following error
    13/01/15 12:52:07 WARNING: EJBContainer.postInit Error generating wrappers for f
    ile:/E:/app/OracleDb/j2ee/home/applications/admin_ejb.jarjava.lang.Instantiation
    Exception: javac.exe not found under C:\Program Files\Java\jre7, please use a va
    lid jdk or specify the location of your java compiler in server.xml using the <j
    ava-compiler .../> tag
    I have JAVA_HOME and ORACLE_HOME system environment variables set up as mentioned in the guide.
    I am not well versed with java.
    Can anyone please throw light on this issue and help me resolve this problem. This is an urgent requirement.
    Thanks and regards,
    Deepika.

    Deepika R wrote:
    13/01/15 12:52:07 WARNING: EJBContainer.postInit Error generating wrappers for f
    ile:/E:/app/OracleDb/j2ee/home/applications/admin_ejb.jarjava.lang.Instantiation
    Exception: javac.exe not found under C:\Program Files\Java\jre7, please use a va
    lid jdk or specify the location of your java compiler in server.xml using the <j
    ava-compiler .../> tag
    I have JAVA_HOME and ORACLE_HOME system environment variables set up as mentioned in the guide.
    Seems like the Java EE container is looking for the Java compiler. Try installing the Java Development Kit (JDK) and respecify your JAVA_HOME accordingly. HTH.

  • LOGO in PDF file (Apache FOP)

    Hi all...I'm using the Apache FOP PDF printing option with the jsp packaged in the AppEx 3.0.1 install. I would like to put a logo in the header of the generated PDF file. I made a compy of the default generic columns layout and added this to the header section in Page Template:
    <fo:block>
    Test Header Changes
    <fo:external-graphic src="file:///tmp/FastenalLogo.png"/>
    </fo:block>
    The following error is then generated in the logs:
    07/10/31 10:50:44 [INFO] Using oracle.xml.parser.v2.SAXParser as SAX2 Parser
    07/10/31 10:50:44 [INFO] building formatting object tree
    07/10/31 10:50:44 [INFO] setting up fonts
    07/10/31 10:50:51 [INFO] [1]
    07/10/31 10:50:51 [WARNING] table-layout=auto is not supported, using fixed!
    07/10/31 10:50:53 [ERROR] Error while creating area : Error creating FopImage ob ject (file:/tmp/FastenalLogo.png) : Jimi image library not available
    07/10/31 10:50:54 [INFO] [2]
    07/10/31 10:50:55 [ERROR] Error while creating area : Error creating FopImage ob ject (file:/tmp/FastenalLogo.png) : Jimi image library not available
    07/10/31 10:50:55 [INFO] [3]
    07/10/31 10:50:55 [ERROR] Error while creating area : Error creating FopImage ob ject (file:/tmp/FastenalLogo.png) : Jimi image library not available
    07/10/31 10:50:56 [INFO] Parsing of document complete, stopping renderer
    I also tried using a URL (with appropriate syntax), but that generated these errors:
    07/10/31 10:44:14 [ERROR] Error while creating area : No ImageReader for this ty pe of image (http://epsilon.fastenal.com:7784/i/FastenalLogo.jpg)
    07/10/31 10:44:14 [INFO] [3]
    07/10/31 10:44:15 [ERROR] Could not load external SVG: http://epsilon.fastenal.c om:7784/i/FastenalLogo.jpg<Line 1, Column 50>: XML-20190: (Fatal Error) Whitespa ce required.
    07/10/31 10:44:15 [ERROR] Error while creating area : No ImageReader for this ty pe of image (http://epsilon.fastenal.com:7784/i/FastenalLogo.jpg)
    07/10/31 10:44:15 [INFO] Parsing of document complete, stopping renderer
    Is it not possible to import an external image file into a PDF rendered by the Apache FOP? Any help would be greatly appreciated.
    Thanks,
    Leigh

    Hi Carl --
    I changed the image source to this:
    <xsl:variable name="_SECTION_NAME" select="string('master0')"/>
    <fo:static-content flow-name="region-header">
    <fo:block>
    Test Header Changes
    <fo:external-graphic src="http://epsilon.fastenal.com:7784/i/FastenalLogo.jpg" />
    </fo:block>
    <fo:block xsl:use-attribute-sets="text text_2 text_0 #PAGE_HEADER_ALIGNMENT#">
    <fo:inline xsl:use-attribute-sets="page-header">#PAGE_HEADER#</fo:inline>
    </fo:block>
    </fo:static-content>
    I can access the image through my web browser using the URL, but my log is throwing these errors:
    07/10/31 13:01:18 [WARNING] table-layout=auto is not supported, using fixed!
    07/10/31 13:01:20 [ERROR] Could not load external SVG: http://epsilon.fastenal.com:7784/i/FastenalLogo.jpg<Line 1, Column 50>: XML-20190: (Fatal Error) Whitespace required.
    07/10/31 13:01:20 [ERROR] Error while creating area : No ImageReader for this type of image (http://epsilon.fastenal.com:7784/i/FastenalLogo.jpg)
    07/10/31 13:01:20 [INFO] [2]
    07/10/31 13:01:21 [ERROR] Could not load external SVG: http://epsilon.fastenal.com:7784/i/FastenalLogo.jpg<Line 1, Column 50>: XML-20190: (Fatal Error) Whitespace required.
    07/10/31 13:01:21 [ERROR] Error while creating area : No ImageReader for this type of image (http://epsilon.fastenal.com:7784/i/FastenalLogo.jpg)
    07/10/31 13:01:21 [INFO] Parsing of document complete, stopping renderer
    Could the fo block be in the wrong place in the document? I'm not very familiar with XSL-FO and may have just placed it wrong.
    One other thing I just noticed. The webserver is actually using SSL, which on windows systems results in a pop-up about security. If I change the URL to https using the SSL port, I receive a message about security certificates.
    Thanks,
    Leigh
    Message was edited by:
    ljohnson74

  • Apache FOP not displaying Cyrillic properly

    Hi,
    I am using apache FOP to generate pdfs' in Russian. I have embedded the fonts into the application but the output is being displayed as html numerical codes.
    The html numerical codes are stored in the database but I am unable to render them properly. I know the fonts are embedded correctly because when I apply the fonts to English text, Russian characters are displayed in the pdf correctly.
    e.g the Russian characters are displayed like this:
    &#1087;&#1088;&#1086;&#1076;... etc
    Why are my codes not displaying properly ? I'm a bit lost at this point.
    thanks in advance

    Hi,
    thanks for the reply.
    To clarify things a bit. My web page is submitting Russian text which is being stored in an Oracle database. This text is being stored in the &#xxxx; format. This formatting is displayed properly in a web browser but I am using Apache FOP to produce a pdf and the Russian text is not being displayed as the Russian characters but as the relative &#xxxx; codes. So these codes are not being translated back into their Russian Cyrillic symbols.
    I have configured FOP and embedded the Cyrillic TTF but these codes are still not displayed. I can apply the Cyrillic font style to English text and Russian characters are displayed so it seems that that cyrillic TTF is embedded properly.
    I am not generating an serialized xml file but rather creating a javax.xml.transform.dom.DOMSource object and with my xsl file I create the pdf code snippet below:
    thanks
    Paul
              //Setup a buffer to obtain the content length
              ByteArrayOutputStream out = new ByteArrayOutputStream();
              // add fonts for Russian and Chinese certificates
              String fontConfig = path + "fonts/fontcfg.xml";
           FopFactory fopFactory = FopFactory.newInstance();
           fopFactory.setUserConfig(fontConfig);
           FOUserAgent foAgent = fopFactory.newFOUserAgent();
              //Setup FOP
              Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,foAgent , out);
              //Setup Transformer
              Source xsltSrc = new StreamSource(new File(xslFile));
              TransformerFactory tFactory = TransformerFactory.newInstance();
              Transformer transformer = tFactory.newTransformer(xsltSrc);
              //Make sure the XSL transformation's result is piped through to FOP
              Result res = new SAXResult(fop.getDefaultHandler());
              //Setup input
              Source domSrc = new DOMSource(xmlDom);         
           //Start the transformation and rendering process
              transformer.transform(domSrc, res);
              //Prepare response
              response.setContentType("application/pdf");
              response.setContentLength(out.size());
              //Send content to Browser
              response.getOutputStream().write(out.toByteArray());
              response.getOutputStream().flush();

  • APEX 4.1 - APACHE FOP PDF generation problem.

    Hi all,
    I'm having problem with PDF generation using APACH FOP on OC4J.
    When I test my print server as described here:
    http://marcsewtz.blogspot.com/2008/06/heres-another-posting-on-pdf-printing.html
    everything works without problem. But when I upload my Layout to APEX and try to generate PDF from apex I'm getting error:
    oracle.xml.parser.v2.XMLParseException: Unexpected EOF.
         at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:320)
         at oracle.xml.parser.v2.XMLReader.popXMLReader(XMLReader.java:549)
         at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1375)
         at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:362)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:308)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:337)
         at oracle.xml.xslt.XSLProcessor.newXSLStylesheet(XSLProcessor.java:714)
         at oracle.xml.xslt.XSLStylesheet.<init>(XSLStylesheet.java:322)
         at oracle.xml.parser.v2.XSLStylesheet.<init>(XSLStylesheet.java:114)
         at apex_fop._jspService(_apex__fop.java:71)
         [SRC:/apex_fop.jsp:21]
    I could see similar post here:
    Handling Special characters in call to apex_util.download_print_document
    But it doesn't explain my case as it's crashing even when I generate empty pdf(no data so no special characters, only empty XML file with no data should be sent to print server)
    Is there any way to see what xml is sent do print server for processing? That could eventually show where is a problem.
    Palo

    My mistake, there was really an "&" character in my template. now when I replaced it with %26 it works.
    However I would be still interested if there is a way to see what data is APEX engine sending to print server cause it will help me to find this kind of errors.
    Palo

  • PDF Printing  APEX 3.2.1  (APACHE FOP) which OC4J version  for Oracle 11g?

    I am using APEX 3.2.1 on Oracle 11.g (under windows XP)
    I want to test PDF printing (in advanced turorial) with standard config ( APACHE FOP no Oracle BI publisher).
    When I look oracle doc : http://www.oracle.com/technology/products/database/application_express/html/configure_printing.html)
    prerequisites for installing WAR file (Installing and Configuring Apache FOP) imply downlad for Oracle Containers for J2EE (10.1.3.2) ,
    once there : http://www.oracle.com/technology/software/products/ias/htdocs/utilsoft.html)
    the accessed page seems restricted to Oracle Application Server 10g Software Downloads.
    My question : is the last Version (10.1.3.5.0 : Oracle Containers for J2EE 10g (OC4J) (build #090727, 91 MB) - J2EE 1.4 compatible with EJB 3.0 / JPA 1.0 support ) also VALID for Oracle 11g ?

    I just installed a similar setup with the following software combination and it works.
    win32_11gR1_database.zip
    oc4j_extended_101350.zip
    jdk-1_5_0_22-windows-i586-p.exe

  • PDF Printing  APEX 3.2.1  (APACHE FOP) which OC4J version ?

    I am using APEX 3.2.1 on Oracle 11.g (under windows XP)
    I want to test PDF printing (in advanced turorial) with standard config ( APACHE FOP no Oracle BI publisher).
    When I look oracle doc : http://www.oracle.com/technology/products/database/application_express/html/configure_printing.html)
    prerequisites for installing WAR file (Installing and Configuring Apache FOP) imply downlad for Oracle Containers for J2EE (10.1.3.2) ,
    once there : http://www.oracle.com/technology/software/products/ias/htdocs/utilsoft.html)
    the accessed page seems restricted to Oracle Application Server 10g Software Downloads.
    My question : is the last Version (10.1.3.5.0 : Oracle Containers for J2EE 10g (OC4J) (build #090727, 91 MB) - J2EE 1.4 compatible with EJB 3.0 / JPA 1.0 support ) also VALID for Oracle 11g ?
    Edited by: user10370192 on 10 nov. 2009 05:29

    marked for cancel (wrong forum)

  • PDF generation with Apache FOP.

    DB: Release 10gR2 -> 10.2.0.3
    Apex : 3.1
    OS: Linux RedHat 4 Update 6.
    Apache : 1.3 from the Companion DB CD.
    Our enviroment have been done with 10gR2 and the Companion CD Apache, are running in diferent servers.
    I was trying to follow the steps for get the apache FOP working reading the document.
    http://www.oracle.com/technology/products/database/application_express/html/configure_printing.html#05
    Step 5.1
    Oracle Containers for J2EE (10.1.3.2)
    Available for download from OTN
    Installation instructions and configuration
    I don't see the 10.1.3.2 at OTN. Actual releases are 10.1.3.3 -> 10.1.3.4
    Can I use any other one newer?
    What to download ?
    The Oracle Containers for J2ee (OC4J)?
    Any other one?
    Thank you in advance for your help
    Jose

    As part of the ducomentation to install the OC4J. You have to have the JAVA_HOME , ORACLE_HOME and J2EE_HOME.
    According to document
    http://download.oracle.com/docs/cd/B32110_01/web.1013/b28950/install.htm#CEGBCJJH
    Question:
    If I have install the Apache from the Companion CD and my ORACLE_HOME is
    /u01/httpdev2/oracle/product/10.2.0
    The directory have the j2ee and others. If I try to install the OC4J I will be overwriting the rest of directory.
    How I install the OC4J?
    I have to create a new ORACLE_HOME?
    I have to install Application Server and then the OC4J?
    Thank you.
    Jose.

  • PDF printing by Apache FOP : what are the prerequisites ?

    Hello,
    I'm actually looking for a way to print reports, and I've 2 questions :
    1) If I'm not wrong there are three means : BI Publisher, Apache FOP and an other XSL-FO like Cocoon...
    -> For budgetary reasons, we can't use BI Publisher.
    -> Besides, my company owns the Oracle Standard Edition, so I'm not even sure we can use Apache FOP : in every documentation FOP is deployed in App Server or Enterprise Manager, and we don't have those. OC4J seems installed on our server but it may not work without Application Server...
    -> So is Cocoon the solution ?
    2) We're about installing Apex 4.0. We want to be able to print interactive reports, with aggregations and sums. Does it possible and are there differences between report engines ?
    Thanks a lot !
    Fanny

    Hi Fanny,
    I stand to be corrected, but my understanding regarding OC4J licensing is this.
    OC4J can be downloaded and installed in standalone configuration from OTN under the OTN license, which is fairly restrictive and means that it cannot be used for production or commercial purposes. This applies whether it is installed on the database server or on a separate server. In order to license it you need to buy an OAS or Weblogic license. This is in contrast to Oracle's HTTP server, which can be installed standalone and is included in the database server license provided it is installed on the same server as the database. If the HTTP server is installed on a separate server to the database then it too requires an OAS or Weblogic license.
    My guess for this anomally is that the HTTP server is based on Apache, an open source product and it was originally installed as part of the database up until version 9i. After that it was separated out as a companion product. Where as OC4J is based on a proprietary product called Onion, which Oracle acquired. Commercially going forward, Oracle is pushing Weblogic. If you want a free app server then you can opt for the free version of Glassfish, an Oracle product or Tomcat.
    If you do need a supported environment you can also get Standard One versions of Weblogic and OAS which are considerably cheaper than the Enterprise versions and you can get a supported version of Glasfish for around the same cost.
    You should also note that Oracle BI plus OAS or Weblogic is a complete development and deployment product for business intelligence reporting, whereas Apache FOP and an app server is purely a deployment environment. If you wish to do something more sophisticated than the standard PDF option available in Apex, which is pretty basic, you will need to acquire some sort of XSL-FO production tool. As alluded to previously, Java4less produce a minimally priced one, but there are others in the market place.
    Regards
    Andre

  • PDF PRINTING using Apache FOP and Oracle Containers for J2EE

    Hi,
    I am having major confusion about the pdf printing in Oracle XE and Apex 3.1.2.00.02
    It clearly states that this is an available option on the Oracle website.
    According to Apex there are two options for printing report regions.
    Standard - which is free
    Advanced - which uses BI and requires a licence
    Standard requires me to have Apache FOP (which is provided by Oracle in the Apex release) and Oracle Containers for J2EE (OC4J)
    Where my understanding of all this falls down is the part where I am downloading the Oracle Containers for J2EE and the license agreement states this cannot be used in a production system (only as a protptype). Can anyone clarify this? This is surely a required componenet and for the standard report printing which is supposed to be free.
    My problem is that I need to have a database system on a laptop that will go off site for a number of weeks. We need report printing options.
    Can anyone help with this. im desperate.
    Kind regards
    colin mclay

    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 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.

  • Apache FOP PDF Save in BLOB column

    Hi,
    I just want to call Apache FOP in an APEX process to create PDF reports and save these reports in a BLOB column in the same database. So I can email these reports in another process using APEX_MAIL. Does anyone know a way to achieve this?
    Thanks

    If I understand correctly, your requirements needs to be broken down into two problems:
    1) click link that pops up a window displaying a new APEX page
    2) an APEX page the displays the document, not downloads it.
    I haven't done #1 (yet).
    However, you may be able to generate a URL that points to the new page as part of the SELECT statement for the Report.
    This has a related question, but no answer yet:
    open pdf in popup browser window
    The key is target="_blank" for the anchor tag.
    To generate the URL, you should use the APEX_UTIL.prepare_URL() function.
    If that doesn't work, a Dynamic Action that does some magical JavaScript stuff may be needed.
    For #2, I lost the URL that showed how to display a PDF as part of a "form" page.
    From what I remember:
    Start with a blank page with one blank HTML region (all the Items go in the HTML region)
    Add an Item for the PK/Doc_ID
    part I forgot Create a Data Manipulation Process
    - Automated Row Fetch
    - On Load - After Header
    - (stuff for your table/view)
    part I forgot Create an (I believe) "File Browser" item type. For Settings:
    - Storage Type "BLOB column specified in Item Source" (and place the column name of the BLOB there)
    - MIME Type Column: (column name) -- since you have multiple types, this is a MUST HAVE
    - Filename Column: (column name) -- I highly recommend you have this.
    - Content Disposition == INLINE <-- this is the kicker
    Also, you will need a Browser Plugin for each of the MIME Types (otherwise, the browser may try to 'download' the file)
    Browsers can handle Image types internally. Adobe's plugin can handle PDFs. I don't know about Word/Excel.
    Again, I don't remember the exact details, but that should cover most of it.
    MK

Maybe you are looking for

  • Time From field is not getting displayed in correct format in Activities

    Hello Experts , We are facing one problem in UI , when we search for Activities in Web UI . In the field "Time From" we are not getting the time in correct format , ie is instead of  getting time as say 13::38 we are getting time as 13::3 , but when

  • Why does my ipad and appleTv work badly with youtube ?

    Why does my ipad an apple tv work so badly with youtube, its frozen all the thime

  • Central contracts on SUS

    Hi Friends, Can anyone suggest me any possible way to share the central contracts information with SUS suppliers. Regards, Prashant

  • Massive Stock Report

    Dear all, I would like to know if there is in SAP a Massive Stock Report in which you can see the stock in different units of measure at the same time. MMBE and MB52 don't satisfy my requirement, because MMBE is not for massive stock, you can only se

  • Problem Straight Away

    Thanks in advance for the input =] Ok so today i purchased an ipod 5g as my minidisc played finally packed up on me. I put the intallation CD in and i get this error message: "1608: Unable to create InstallDriver instance, Return Code: -2147024894" C