Re: Populating data dynamically from the DB using Apache FOP
This isn't, strictly speaking, a FOP issue, but since I have to do something similar, I'll share my experience with you: You have (at least) two options: You can read your empty temp.xml file into a DOM, then manipulate the DOM to fill in data from the database. I don't like this option. What I do is to use Apache Velocity: I would have a Velocity template - the equivalent of the empty temp.xml - which I would merge with my data coming from the DB, to give me the completed temp.xml. This is much easier to write and maintain. HTH Martin Velocity : http://velocity.apache.org On 11 February 2010 09:05, RithanyaLaxmi wrote: > > Hi, > > I using Apache FOP for PDF generation, i have the XML with header and footer > information in the bodycontent i have a placeholder, for eg, > > Temp.xml > > > Sample Header > > > [[bodycontent to be populated dynamically from DB]] > > > Sample Footer > > > Temp.xsl, > > will have the XSL tags with the layout, styles, etc. > > Using Apache FOP API i need to fetch the data from the DB (using javax.sql), > and replace the placeholder with the data in it and then use the XSL to > apply the styles,etc to generate a PDF? > I know the latter, i am not sure how to read the XML and replace the > placeholder with the data fetched from DB using apache FOP. I know that > Apache FOP uses SAX by default. Please do provide the code to parse the > Temp.xml and replace the place holder with data using apache FOP. If there > is any sample links please do provide that as well. > > > Thanks, > Rithu > -- > View this message in context: > http://old.nabble.com/Populating-data-dynamically-from-the-DB-using-Apache-FOP-tp27542925p27542925.html > Sent from the FOP - Users mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org > For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org > > -- >From my MacBook Pro - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Populating data dynamically from the DB using Apache FOP
Thanks Martin, how to fill the data from the database for the placeholders in temp.xml? Is it the data or the ResultSet needs to be converted to a XML format. My question is ,similar to Jasper reports is there any API (eitheir DOM or FOP) which takes the ArrayList (contains the data from DB) using the API pass the arraylist with XML (temp.xml) which will eventually replace the placeholder with the data (from the arraylist). Is it possible? Martin Jacobson wrote: > > This isn't, strictly speaking, a FOP issue, but since I have to do > something similar, I'll share my experience with you: > You have (at least) two options: > You can read your empty temp.xml file into a DOM, then manipulate the > DOM to fill in data from the database. I don't like this option. What > I do is to use Apache Velocity: I would have a Velocity template - the > equivalent of the empty temp.xml - which I would merge with my data > coming from the DB, to give me the completed temp.xml. This is much > easier to write and maintain. > HTH > Martin > > Velocity : http://velocity.apache.org > > On 11 February 2010 09:05, RithanyaLaxmi > wrote: >> >> Hi, >> >> I using Apache FOP for PDF generation, i have the XML with header and >> footer >> information in the bodycontent i have a placeholder, for eg, >> >> Temp.xml >> >> >> Sample Header >> >> >> [[bodycontent to be populated dynamically from DB]] >> >> >> Sample Footer >> >> >> Temp.xsl, >> >> will have the XSL tags with the layout, styles, etc. >> >> Using Apache FOP API i need to fetch the data from the DB (using >> javax.sql), >> and replace the placeholder with the data in it and then use the XSL to >> apply the styles,etc to generate a PDF? >> I know the latter, i am not sure how to read the XML and replace the >> placeholder with the data fetched from DB using apache FOP. I know that >> Apache FOP uses SAX by default. Please do provide the code to parse the >> Temp.xml and replace the place holder with data using apache FOP. If >> there >> is any sample links please do provide that as well. >> >> >> Thanks, >> Rithu >> -- >> View this message in context: >> http://old.nabble.com/Populating-data-dynamically-from-the-DB-using-Apache-FOP-tp27542925p27542925.html >> Sent from the FOP - Users mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org >> For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org >> >> > > > > -- > From my MacBook Pro > > - > To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org > For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org > > > -- View this message in context: http://old.nabble.com/Populating-data-dynamically-from-the-DB-using-Apache-FOP-tp27542925p27543891.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Populating data dynamically from the DB using Apache FOP
You can use SAX. Your app implements SAXParser and emits SAX events: contentHandler.startElement('header'); contentHandler.text('Sample Header'); etc. Similarly for your data from the DB. For example, read the ResultSet, and emit the appropriate SAX events. The total picture is then: data (SAXParser) -> Transformer (temp.xsl) -> SAXResult (FOP) Simon On Wed, Feb 10, 2010 at 11:05:03PM -0800, RithanyaLaxmi wrote: > > Hi, > > I using Apache FOP for PDF generation, i have the XML with header and footer > information in the bodycontent i have a placeholder, for eg, > > Temp.xml > > > Sample Header > > > [[bodycontent to be populated dynamically from DB]] > > > Sample Footer > > > Temp.xsl, > > will have the XSL tags with the layout, styles, etc. > > Using Apache FOP API i need to fetch the data from the DB (using javax.sql), > and replace the placeholder with the data in it and then use the XSL to > apply the styles,etc to generate a PDF? > I know the latter, i am not sure how to read the XML and replace the > placeholder with the data fetched from DB using apache FOP. I know that > Apache FOP uses SAX by default. Please do provide the code to parse the > Temp.xml and replace the place holder with data using apache FOP. If there > is any sample links please do provide that as well. -- Simon Pepping home page: http://www.leverkruid.eu - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Populating data dynamically from the DB using Apache FOP
Thanks Simon, as per your comment i need to parse the Temp.xml (which contains the placeholder) using SAX and read the data from the resultset. But how can I merge or append the data reed from DB to the Temp.xml. Once i merge the data in place of the placeholder, the temp.xml should look like:- blah... // fetched from db I am pretty new to this, please provide the sampled code for this. If there is any links related to this those are welcome as well. Thanks, Rithu Simon Pepping @ Home wrote: > > You can use SAX. Your app implements SAXParser and emits SAX events: > > contentHandler.startElement('header'); > contentHandler.text('Sample Header'); > > etc. Similarly for your data from the DB. For example, read the > ResultSet, and emit the appropriate SAX events. The total picture is > then: > > data (SAXParser) -> Transformer (temp.xsl) -> SAXResult (FOP) > > Simon > > On Wed, Feb 10, 2010 at 11:05:03PM -0800, RithanyaLaxmi wrote: >> >> Hi, >> >> I using Apache FOP for PDF generation, i have the XML with header and >> footer >> information in the bodycontent i have a placeholder, for eg, >> >> Temp.xml >> >> >> Sample Header >> >> >> [[bodycontent to be populated dynamically from DB]] >> >> >> Sample Footer >> >> >> Temp.xsl, >> >> will have the XSL tags with the layout, styles, etc. >> >> Using Apache FOP API i need to fetch the data from the DB (using >> javax.sql), >> and replace the placeholder with the data in it and then use the XSL to >> apply the styles,etc to generate a PDF? >> I know the latter, i am not sure how to read the XML and replace the >> placeholder with the data fetched from DB using apache FOP. I know that >> Apache FOP uses SAX by default. Please do provide the code to parse the >> Temp.xml and replace the place holder with data using apache FOP. If >> there >> is any sample links please do provide that as well. > > -- > Simon Pepping > home page: http://www.leverkruid.eu > > - > To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org > For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org > > > -- View this message in context: http://old.nabble.com/Populating-data-dynamically-from-the-DB-using-Apache-FOP-tp27542925p27544263.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Populating data dynamically from the DB using Apache FOP
Well, theoretically you can drop the ResultSet into the Velocity context and iterate over it in the template, which is certainly the simplest way - personally, I prefer to create a List of some Bean class and iterate over that instead. But then, I'm old, cynical, and paranoid! M On 11 February 2010 10:41, RithanyaLaxmi wrote: > > Thanks Martin, how to fill the data from the database for the placeholders > in temp.xml? Is it the data or the ResultSet needs to be converted to a XML > format. My question is ,similar to Jasper reports is there any API (eitheir > DOM or FOP) which takes the ArrayList (contains the data from DB) using the > API pass the arraylist with XML (temp.xml) which will eventually replace the > placeholder with the data (from the arraylist). Is it possible? > > Martin Jacobson wrote: >> >> This isn't, strictly speaking, a FOP issue, but since I have to do >> something similar, I'll share my experience with you: >> You have (at least) two options: >> You can read your empty temp.xml file into a DOM, then manipulate the >> DOM to fill in data from the database. I don't like this option. What >> I do is to use Apache Velocity: I would have a Velocity template - the >> equivalent of the empty temp.xml - which I would merge with my data >> coming from the DB, to give me the completed temp.xml. This is much >> easier to write and maintain. >> HTH >> Martin >> >> Velocity : http://velocity.apache.org >> >> On 11 February 2010 09:05, RithanyaLaxmi >> wrote: >>> >>> Hi, >>> >>> I using Apache FOP for PDF generation, i have the XML with header and >>> footer >>> information in the bodycontent i have a placeholder, for eg, >>> >>> Temp.xml >>> >>> >>> Sample Header >>> >>> >>> [[bodycontent to be populated dynamically from DB]] >>> >>> >>> Sample Footer >>> >>> >>> Temp.xsl, >>> >>> will have the XSL tags with the layout, styles, etc. >>> >>> Using Apache FOP API i need to fetch the data from the DB (using >>> javax.sql), >>> and replace the placeholder with the data in it and then use the XSL to >>> apply the styles,etc to generate a PDF? >>> I know the latter, i am not sure how to read the XML and replace the >>> placeholder with the data fetched from DB using apache FOP. I know that >>> Apache FOP uses SAX by default. Please do provide the code to parse the >>> Temp.xml and replace the place holder with data using apache FOP. If >>> there >>> is any sample links please do provide that as well. >>> >>> >>> Thanks, >>> Rithu >>> -- >>> View this message in context: >>> http://old.nabble.com/Populating-data-dynamically-from-the-DB-using-Apache-FOP-tp27542925p27542925.html >>> Sent from the FOP - Users mailing list archive at Nabble.com. >>> >>> >>> - >>> To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org >>> For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org >>> >>> >> >> >> >> -- >> From my MacBook Pro >> >> - >> To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org >> For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org >> >> >> > > -- > View this message in context: > http://old.nabble.com/Populating-data-dynamically-from-the-DB-using-Apache-FOP-tp27542925p27543891.html > Sent from the FOP - Users mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org > For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org > > -- >From my MacBook Pro - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: AW: AW: AW: AW: AW: Table height issue
I will finally proceed differently… I'll take a position information from the area tree and use it to add a calculated empty block in my xsl to generate directly my pdf ! rOnnie974 wrote: > > Hello, it's me again, > > I am back on this work and after several tests, I figured out that my area > tree has only elements with absolute positioning, left and top offset > explicitely precized. > It is boring for me as I cannot work only on my specific block to adjust > it (padding, height, etc.), I have to manage its offset and also to deal > with every elements under it. > > Is there a way to do it easily ? Or to generate an area tree with relative > positioning for all elements ? > > Thanks in advance. > > Ronnie > > > Georg Datterl-2 wrote: >> >> Hi Ronnie, >> >> That's only because you have not yet asked questions that need input from >> the real experts here. :-) >> >> Regards, >> >> Georg Datterl >> >> -- Kontakt -- >> >> Georg Datterl >> >> Geneon media solutions gmbh >> Gutenstetter Straße 8a >> 90449 Nürnberg >> >> HRB Nürnberg: 17193 >> Geschäftsführer: Yong-Harry Steiert >> >> Tel.: 0911/36 78 88 - 26 >> Fax: 0911/36 78 88 - 20 >> >> www.geneon.de >> >> Weitere Mitglieder der Willmy MediaGroup: >> >> IRS Integrated Realization Services GmbH:www.irs-nbg.de >> Willmy PrintMedia GmbH:www.willmy.de >> Willmy Consult & Content GmbH: www.willmycc.de >> -Ursprüngliche Nachricht- >> Von: rOnnie974 [mailto:ronnie.ba...@gmail.com] >> Gesendet: Freitag, 5. Februar 2010 13:06 >> An: fop-users@xmlgraphics.apache.org >> Betreff: Re: AW: AW: AW: AW: Table height issue >> >> >> You are my hero. >> >> Thank you very much. >> >> >> Georg Datterl-2 wrote: >>> >>> Hi Ronnie, >>> >>> Basically: >>> areaTree is the root. >>> pageSequence is a page sequence from your fo file page is a single >>> page in your pdf regionBefore is the header regionAfter is the footer >>> regionBody is the body of the page >>> >>> then there's lots of stuff to ignore. To find the block you are >>> interested in, search for the id. id="XXX" in fo will be translated to >>> prod-id="XXX". >>> bpd is block-progression-dimension, which means block height. >>> >>> In your code you can use Xpath to read information, but I'd advise you >>> to trim the document first. If you know all information you need is in >>> one page-sequence, trim away all other sequences to make xpath way >>> faster. >>> >>> Regards, >>> >>> Georg Datterl >>> >>> -- Kontakt -- >>> >>> Georg Datterl >>> >>> Geneon media solutions gmbh >>> Gutenstetter Straße 8a >>> 90449 Nürnberg >>> >>> HRB Nürnberg: 17193 >>> Geschäftsführer: Yong-Harry Steiert >>> >>> Tel.: 0911/36 78 88 - 26 >>> Fax: 0911/36 78 88 - 20 >>> >>> www.geneon.de >>> >>> Weitere Mitglieder der Willmy MediaGroup: >>> >>> IRS Integrated Realization Services GmbH:www.irs-nbg.de >>> Willmy PrintMedia GmbH:www.willmy.de >>> Willmy Consult & Content GmbH: www.willmycc.de >>> -Ursprüngliche Nachricht- >>> Von: rOnnie974 [mailto:ronnie.ba...@gmail.com] >>> Gesendet: Freitag, 5. Februar 2010 12:48 >>> An: fop-users@xmlgraphics.apache.org >>> Betreff: Re: AW: AW: AW: Table height issue >>> >>> >>> I just found xmlindent.com and got a 2656 lines file... Gonna a big >>> headache%-| >>> >>> >>> Georg Datterl-2 wrote: Hi Ronnie, I run the Document object through public static String toString(Document document) throws TransformerException { StringWriter stringWriter = new StringWriter(); StreamResult streamResult = new StreamResult(stringWriter); TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amo u nt", "2"); transformer.setOutputProperty(OutputKeys.METHOD, "xml"); transformer.transform(new DOMSource(document.getDocumentElement()), streamResult); return stringWriter.toString(); } and copy the resulting String into XMLSpy. Regards, Georg Datterl -- Kontakt -- Georg Datterl Geneon media solutions gmbh Gutenstetter Straße 8a 90449 Nürnberg HRB Nürnberg: 17193 Geschäftsführer: Yong-Harry Steiert Tel.: 0911/36 78 88 - 26 Fax: 0911/36 78 88 - 20 www.geneon.de Weitere Mitglieder der Willmy MediaGroup: IRS Integrated Realization Services GmbH:www.irs-nbg.de Willmy PrintMedia GmbH:www.willmy.de Willmy Consult & Content GmbH: www.willmycc.de -Ursprüngliche Nachricht- Von: rOnnie974 [mai
RE: Populating data dynamically from the DB using Apache FOP
I don't know if this will help but if you are parsing with XSLT first you could use Xalan or Saxon to grab the data from the db. Xalan has an extension that you can use easy enough but Saxon's extension can only be used from the command line. Now to take it one step further you could write your own Java/XSLT function to do this but that is only if you have the skills or someone you know. Marijan (Mario) Madunic Publishing Specialist New Flyer Industries -Original Message- From: Martin Jacobson [mailto:jacobson.mar...@gmail.com] Sent: Thursday, February 11, 2010 3:35 AM To: fop-users@xmlgraphics.apache.org Subject: Re: Populating data dynamically from the DB using Apache FOP Well, theoretically you can drop the ResultSet into the Velocity context and iterate over it in the template, which is certainly the simplest way - personally, I prefer to create a List of some Bean class and iterate over that instead. But then, I'm old, cynical, and paranoid! M On 11 February 2010 10:41, RithanyaLaxmi wrote: > > Thanks Martin, how to fill the data from the database for the placeholders > in temp.xml? Is it the data or the ResultSet needs to be converted to a XML > format. My question is ,similar to Jasper reports is there any API (eitheir > DOM or FOP) which takes the ArrayList (contains the data from DB) using the > API pass the arraylist with XML (temp.xml) which will eventually replace the > placeholder with the data (from the arraylist). Is it possible? > > Martin Jacobson wrote: >> >> This isn't, strictly speaking, a FOP issue, but since I have to do >> something similar, I'll share my experience with you: >> You have (at least) two options: >> You can read your empty temp.xml file into a DOM, then manipulate the >> DOM to fill in data from the database. I don't like this option. What >> I do is to use Apache Velocity: I would have a Velocity template - the >> equivalent of the empty temp.xml - which I would merge with my data >> coming from the DB, to give me the completed temp.xml. This is much >> easier to write and maintain. >> HTH >> Martin >> >> Velocity : http://velocity.apache.org >> >> On 11 February 2010 09:05, RithanyaLaxmi >> wrote: >>> >>> Hi, >>> >>> I using Apache FOP for PDF generation, i have the XML with header and >>> footer >>> information in the bodycontent i have a placeholder, for eg, >>> >>> Temp.xml >>> >>> >>> Sample Header >>> >>> >>> [[bodycontent to be populated dynamically from DB]] >>> >>> >>> Sample Footer >>> >>> >>> Temp.xsl, >>> >>> will have the XSL tags with the layout, styles, etc. >>> >>> Using Apache FOP API i need to fetch the data from the DB (using >>> javax.sql), >>> and replace the placeholder with the data in it and then use the XSL to >>> apply the styles,etc to generate a PDF? >>> I know the latter, i am not sure how to read the XML and replace the >>> placeholder with the data fetched from DB using apache FOP. I know that >>> Apache FOP uses SAX by default. Please do provide the code to parse the >>> Temp.xml and replace the place holder with data using apache FOP. If >>> there >>> is any sample links please do provide that as well. >>> >>> >>> Thanks, >>> Rithu >>> -- >>> View this message in context: >>> http://old.nabble.com/Populating-data-dynamically-from-the-DB-using-Apache-FOP-tp27542925p27542925.html >>> Sent from the FOP - Users mailing list archive at Nabble.com. >>> >>> >>> - >>> To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org >>> For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org >>> >>> >> >> >> >> -- >> From my MacBook Pro >> >> - >> To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org >> For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org >> >> >> > > -- > View this message in context: > http://old.nabble.com/Populating-data-dynamically-from-the-DB-using-Apache-FOP-tp27542925p27543891.html > Sent from the FOP - Users mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org > For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org > > -- >From my MacBook Pro - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org Please consider the environment before printing this e-mail. CONFIDENTIALITY STATEMENT: This communication (and any and all information or material transmitted with this communication) is confidential, may be privileged and is intended only for the use of the intended recipient. If you are not the intended recipient, any review, retransmi
barcode test failing
Hi, I am trying to generate a PDF document with barcode in it. I am running this example on FOP trunk. When I run the sample barcode test xsl:fo file from the command prompt... *fop -fo barcodetest.fo -pdf barcodetest.pdf* I have got the following messages on the console... 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}barcode"; encountered (a child of fo:instream-foreign-object}. (See position 18:110) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}code128"; encountered (a child of barcode}. (See position 19:25) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}height"; encountered (a child of code128}. (See position 20:25) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}human-readable"; encountered (a child of code128}. (See position 21:33) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}placement"; encountered (a child of human-readable}. (See position 22:35) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}font-name"; encountered (a child of human-readable}. (See position 23:35) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}font-size"; encountered (a child of human-readable}. (See position 24:35) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent SEVERE: The intrinsic dimensions of an instream-foreign-object could not be determined. (See position 17:63) And the output file generated, but when I open the output file to see the barcode, 'There is some error with the file' message is showing. I am attaching the input file and output file generated with this mail. Please have a look and help me... Thanks, Venkat. http://www.w3.org/1999/XSL/Format"; xmlns:fox="http://xmlgraphics.apache.org/fop/extensions";> Can you see this? First Page http://barcode4j.krysalis.org/ns"; message="0755360001262.18NT0033140N"> 15mm bottom TimesNewRomanPS 8pt Second Page barcodetest.pdf Description: Adobe PDF document - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: How to balance table columns?
thx. yes, but i also need to know the length of each string, the length in mm of each character, the length of column to know when they break in two or more lines :) i think is is possible in automatic mode :) Mario Madunic wrote: > > Sorry for it to make more sense here is the xpath I would test > > $var/child::*[position() lt count($var//child::*)/2 + 1] > $var/child::*[position() gt count($var//child::*)/2] > > Marijan (Mario) Madunic > Publishing Specialist > New Flyer Industries > > -Original Message- > From: Mario Madunic [mailto:mario_madu...@newflyer.com] > Sent: Wednesday, February 10, 2010 6:50 AM > To: fop-users@xmlgraphics.apache.org > Subject: RE: How to balance table columns? > > You might want to post this up on the XSLT list. > > So here is how I would do it > > First is create a temp node variable containing all the left and right > strings as child of the var. Get a count of the child nodes (left and > right) divide by two (round up or down your choice) then create the table > and copy-of/apply-templates to child::*[position() lt half + 1] and for > the right side child::*[position() gt half] in the left and right table > cells accordingly. Now that is not exact without testing and is only an > outline but I hope it give you a general idea of how it might be done. > > Marijan (Mario) Madunic > Publishing Specialist > New Flyer Industries > > -Original Message- > From: lexa2009 [mailto:myworkac...@gmail.com] > Sent: Wednesday, February 10, 2010 5:59 AM > To: fop-users@xmlgraphics.apache.org > Subject: How to balance table columns? > > > Hello! > for example i have a simple table with 2 columns. like this: > > leftstring1 rightstring1 > leftstring2 rightstring2 > leftstring3 rightstring3 > leftstring4 rightstring4 > leftstring5 > leftstring6 > > i do not know how many of each string will be, but i want this table > > leftstring1 leftstring6 > leftstring2 rightstring1 > leftstring3 rightstring2 > leftstring4 rightstring3 > leftstring5 rightstring4 > > how to balance columns? how to make table of smallest height? > -- > View this message in context: > http://old.nabble.com/How-to-balance-table-columns--tp27530072p27530072.html > Sent from the FOP - Users mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org > For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org > > > > Please consider the environment before printing this e-mail. > > CONFIDENTIALITY STATEMENT: This communication (and any and all > information or material transmitted with this communication) is > confidential, may be privileged and is intended only for the use of the > intended recipient. If you are not the intended recipient, any review, > retransmission, circulation, distribution, reproduction, conversion to > hard copy, copying or other use of this communication, information or > material is strictly prohibited and may be illegal. If you received this > communication in error or if it is forwarded to you without the express > authorization of New Flyer, please notify us immediately by telephone or > by return email and permanently delete the communication, information and > material from any computer, disk drive, diskette or other storage device > or media. Thank you. > > > - > To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org > For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org > > > > Please consider the environment before printing this e-mail. > > CONFIDENTIALITY STATEMENT: This communication (and any and all > information or material transmitted with this communication) is > confidential, may be privileged and is intended only for the use of the > intended recipient. If you are not the intended recipient, any review, > retransmission, circulation, distribution, reproduction, conversion to > hard copy, copying or other use of this communication, information or > material is strictly prohibited and may be illegal. If you received this > communication in error or if it is forwarded to you without the express > authorization of New Flyer, please notify us immediately by telephone or > by return email and permanently delete the communication, information and > material from any computer, disk drive, diskette or other storage device > or media. Thank you. > > > - > To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org > For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org > > > -- View this message in context: http://old.nabble.com/How-to-balance-table-columns--tp27530072p27544
RE: barcode test failing
I'm using 0.94. It seems to generate correcty for me. I've attached the PDF. From: Venkat Reddy [mailto:vanukuri.ven...@googlemail.com] Sent: Thursday, February 11, 2010 7:59 AM To: fop-users@xmlgraphics.apache.org Subject: barcode test failing Hi, I am trying to generate a PDF document with barcode in it. I am running this example on FOP trunk. When I run the sample barcode test xsl:fo file from the command prompt... fop -fo barcodetest.fo -pdf barcodetest.pdf I have got the following messages on the console... 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}barcode"; encountered (a child of fo:instream-foreign-object}. (See position 18:110) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}code128"; encountered (a child of barcode}. (See position 19:25) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}height"; encountered (a child of code128}. (See position 20:25) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}human-readable"; encountered (a child of code128}. (See position 21:33) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}placement"; encountered (a child of human-readable}. (See position 22:35) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}font-name"; encountered (a child of human-readable}. (See position 23:35) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}font-size"; encountered (a child of human-readable}. (See position 24:35) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent SEVERE: The intrinsic dimensions of an instream-foreign-object could not be determined. (See position 17:63) And the output file generated, but when I open the output file to see the barcode, 'There is some error with the file' message is showing. I am attaching the input file and output file generated with this mail. Please have a look and help me... Thanks, Venkat. barcode.pdf Description: Adobe PDF document - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: barcode test failing
Hi Pete, Thanks for your response. I have tried with FOP 0.95 version, the same problem is coming. I have generated the barcodes previously using trunk, don't know why it is failing now. Thanks, Venkat. Pete Allison wrote: I'm using 0.94. It seems to generate correcty for me. I've attached the PDF. *From:* Venkat Reddy [mailto:vanukuri.ven...@googlemail.com] *Sent:* Thursday, February 11, 2010 7:59 AM *To:* fop-users@xmlgraphics.apache.org *Subject:* barcode test failing Hi, I am trying to generate a PDF document with barcode in it. I am running this example on FOP trunk. When I run the sample barcode test xsl:fo file from the command prompt... *fop -fo barcodetest.fo -pdf barcodetest.pdf* I have got the following messages on the console... 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}barcode"; encountered (a child of fo:instream-foreign-object}. (See position 18:110) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}code128"; encountered (a child of barcode}. (See position 19:25) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}height"; encountered (a child of code128}. (See position 20:25) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}human-readable"; encountered (a child of code128}. (See position 21:33) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}placement"; encountered (a child of human-readable}. (See position 22:35) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}font-name"; encountered (a child of human-readable}. (See position 23:35) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}font-size"; encountered (a child of human-readable}. (See position 24:35) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent SEVERE: The intrinsic dimensions of an instream-foreign-object could not be determined. (See position 17:63) And the output file generated, but when I open the output file to see the barcode, 'There is some error with the file' message is showing. I am attaching the input file and output file generated with this mail. Please have a look and help me... Thanks, Venkat. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: barcode test failing
Venkat, most probably, Barcode4J is not in the classpath. See also: http://barcode4j.sourceforge.net/2.0/fop-ext.html#Setting+up+the+barcode+extension+with+Apache+FOP+0.93+or+later Barcode4J is not (yet) bundled with FOP. On 11.02.2010 16:43:50 Venkat Reddy wrote: > Hi Pete, > > Thanks for your response. I have tried with FOP 0.95 version, the same > problem is coming. > I have generated the barcodes previously using trunk, don't know why it > is failing now. > > Thanks, > Venkat. > > Pete Allison wrote: > > > > I'm using 0.94. It seems to generate correcty for me. I've attached > > the PDF. > > > > > > > > > > > > > > > > *From:* Venkat Reddy [mailto:vanukuri.ven...@googlemail.com] > > *Sent:* Thursday, February 11, 2010 7:59 AM > > *To:* fop-users@xmlgraphics.apache.org > > *Subject:* barcode test failing > > > > > > > > Hi, > > > > I am trying to generate a PDF document with barcode in it. I am > > running this example on FOP trunk. > > When I run the sample barcode test xsl:fo file from the command prompt... > > > > *fop -fo barcodetest.fo -pdf barcodetest.pdf* > > > > I have got the following messages on the console... > > > > 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener > > processEvent > > WARNING: Unknown formatting object > > "{http://barcode4j.krysalis.org/ns}barcode"; encountered (a child of > > fo:instream-foreign-object}. (See position 18:110) > > 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener > > processEvent > > WARNING: Unknown formatting object > > "{http://barcode4j.krysalis.org/ns}code128"; encountered (a child of > > barcode}. (See position 19:25) > > 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener > > processEvent > > WARNING: Unknown formatting object > > "{http://barcode4j.krysalis.org/ns}height"; encountered (a child of > > code128}. (See position 20:25) > > 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener > > processEvent > > WARNING: Unknown formatting object > > "{http://barcode4j.krysalis.org/ns}human-readable"; encountered (a > > child of code128}. (See position 21:33) > > 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener > > processEvent > > WARNING: Unknown formatting object > > "{http://barcode4j.krysalis.org/ns}placement"; encountered (a child of > > human-readable}. (See position 22:35) > > 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener > > processEvent > > WARNING: Unknown formatting object > > "{http://barcode4j.krysalis.org/ns}font-name"; encountered (a child of > > human-readable}. (See position 23:35) > > 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener > > processEvent > > WARNING: Unknown formatting object > > "{http://barcode4j.krysalis.org/ns}font-size"; encountered (a child of > > human-readable}. (See position 24:35) > > 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener > > processEvent > > SEVERE: The intrinsic dimensions of an instream-foreign-object could > > not be determined. (See position 17:63) > > > > And the output file generated, but when I open the output file to see > > the barcode, 'There is some error with the file' message is showing. > > > > I am attaching the input file and output file generated with this > > mail. Please have a look and help me... > > > > Thanks, > > Venkat. > > > > > > > > > > - > > To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org > > For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org > Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: barcode test failing
Hi Jeremias, Jeremias Maerki wrote: Venkat, most probably, Barcode4J is not in the classpath. See also: http://barcode4j.sourceforge.net/2.0/fop-ext.html#Setting+up+the+barcode+extension+with+Apache+FOP+0.93+or+later Barcode4J is not (yet) bundled with FOP. Yes, I have missed the jar in the classpath. I thought, by default barcode4J (similar to the XMLGraphicsCommons) jar will be available with FOP project. I will copy the jar and check my output once again... On 11.02.2010 16:43:50 Venkat Reddy wrote: Hi Pete, Thanks for your response. I have tried with FOP 0.95 version, the same problem is coming. I have generated the barcodes previously using trunk, don't know why it is failing now. Thanks, Venkat. Pete Allison wrote: I'm using 0.94. It seems to generate correcty for me. I've attached the PDF. *From:* Venkat Reddy [mailto:vanukuri.ven...@googlemail.com] *Sent:* Thursday, February 11, 2010 7:59 AM *To:* fop-users@xmlgraphics.apache.org *Subject:* barcode test failing Hi, I am trying to generate a PDF document with barcode in it. I am running this example on FOP trunk. When I run the sample barcode test xsl:fo file from the command prompt... *fop -fo barcodetest.fo -pdf barcodetest.pdf* I have got the following messages on the console... 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}barcode"; encountered (a child of fo:instream-foreign-object}. (See position 18:110) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}code128"; encountered (a child of barcode}. (See position 19:25) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}height"; encountered (a child of code128}. (See position 20:25) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}human-readable"; encountered (a child of code128}. (See position 21:33) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}placement"; encountered (a child of human-readable}. (See position 22:35) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}font-name"; encountered (a child of human-readable}. (See position 23:35) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://barcode4j.krysalis.org/ns}font-size"; encountered (a child of human-readable}. (See position 24:35) 11-Feb-2010 13:47:18 org.apache.fop.events.LoggingEventListener processEvent SEVERE: The intrinsic dimensions of an instream-foreign-object could not be determined. (See position 17:63) And the output file generated, but when I open the output file to see the barcode, 'There is some error with the file' message is showing. I am attaching the input file and output file generated with this mail. Please have a look and help me... Thanks, Venkat. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org Thanks, Venkat.
Re: Populating data dynamically from the DB using Apache FOP
Read up on SAX parsers, in the JAXP documentation, which is part of the JEE documentation. In this case the XML file is only virtual. It is constructed by your code in the form of SAX parser events. This is a fairly basic manner to do things. I do not know the other suggestions such as Velocity templates, but maybe they are easier to use. Simon On Thu, Feb 11, 2010 at 01:30:29AM -0800, RithanyaLaxmi wrote: > > Thanks Simon, as per your comment i need to parse the Temp.xml (which > contains the placeholder) using SAX and read the data from the resultset. > But how can I merge or append the data reed from DB to the Temp.xml. > Once i merge the data in place of the placeholder, the temp.xml should look > like:- > > > > blah... // fetched from db > > > I am pretty new to this, please provide the sampled code for this. If there > is any links related to this those are welcome as well. > > Thanks, > Rithu > > Simon Pepping @ Home wrote: > > > > You can use SAX. Your app implements SAXParser and emits SAX events: > > > > contentHandler.startElement('header'); > > contentHandler.text('Sample Header'); > > > > etc. Similarly for your data from the DB. For example, read the > > ResultSet, and emit the appropriate SAX events. The total picture is > > then: > > > > data (SAXParser) -> Transformer (temp.xsl) -> SAXResult (FOP) > > > > Simon > > -- Simon Pepping home page: http://www.leverkruid.eu - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org