xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens-Christian.P...@t-systems.com
Subject AW: build dynamic tables with FOP
Date Tue, 26 Jul 2005 17:13:05 GMT
Hi, 

Bryant, thanks so much, but something still seems to be wrong, when i do so, the PDF gets
generated, but no table is build, and i found this exception in the logs: 

java.lang.ArrayIndexOutOfBoundsException: -2
        at org.apache.fop.fo.flow.TableRow$CellArray.getNextFreeCell(TableRow.java:130)
        at org.apache.fop.fo.flow.TableRow.initCellArray(TableRow.java:505)
        at org.apache.fop.fo.flow.TableRow.layout(TableRow.java:271)
        at org.apache.fop.fo.flow.AbstractTableBody.layout(AbstractTableBody.java:236)
        at org.apache.fop.fo.flow.Table.layout(Table.java:302)
        at org.apache.fop.fo.flow.Block.layout(Block.java:257)
        at org.apache.fop.fo.flow.AbstractFlow.layout(AbstractFlow.java:154)
        at org.apache.fop.fo.flow.AbstractFlow.layout(AbstractFlow.java:110)
        at org.apache.fop.fo.pagination.PageSequence.makePage(PageSequence.java:400)
        at org.apache.fop.fo.pagination.PageSequence.format(PageSequence.java:338)
        at org.apache.fop.apps.StreamRenderer.render(StreamRenderer.java:262)
        at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:223)
        at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1712)
        at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
        at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691)
        at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:667)
        at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
        at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
        at org.apache.fop.apps.Driver.render(Driver.java:498)
        at org.apache.fop.apps.Driver.run(Driver.java:565)
 

Where is this exception thrown and why ?! The XSL:FO code is: 

<xsl:template match="table">
  <fo:table border="0.5pt solid black" table-layout="auto" width="100%" space-before.optimum="1pt"
space-after.optimum="2pt">
   
   <xsl:param name="columnsCounter" select="/child::tr/attribute::maxCols"/>
 
   	<fo:table-column width="30" number-columns-repeated="{$columnsCounter}"/>
   	
    	        	<fo:table-body>
				<xsl:apply-templates select="tr"/> 			
			</fo:table-body>
		</fo:table>  
 </xsl:template>

Thanks, Kind regards
Jens

-----Urspr√ľngliche Nachricht-----
Von: JBryant@s-s-t.com [mailto:JBryant@s-s-t.com] 
Gesendet: Dienstag, 26. Juli 2005 18:59
An: fop-users@xmlgraphics.apache.org
Betreff: Re: build dynamic tables with FOP

Hi, Jens,

That's one way to handle it. If you don't want to pass a parameter to your transformation
process, though, you can also have the XSLT count the number of columns in the source document
and generate the correct number of columns. I don't like having to examine a file and set
a parameter (whether I do it myself or with some other process), so I tend to make my XSLT
figure out such things.

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)




Jens-Christian.Pohl@t-systems.com
07/26/2005 11:40 AM
Please respond to
fop-users@xmlgraphics.apache.org


To
fop-users@xmlgraphics.apache.org
cc

Subject
build dynamic tables with FOP






Hi, 
i am trying to build dynamic tables using FOP 0.20.50 within a CMS. 
It seems to be a bit awkward building dynamic tables, cause i dont really 
know, how many columns this table is going to have. 
As i found out at the apache website, FOP does not support the 
table-layout='auto' attribute within the fo:table tag. 
Does this mean, that you would have to count the possible table-columns ? 
And how is this supposed to work ? 
Considering this XML, where the maxCols attribute shows you the number of 
columns, this table is supposed to have: 
<table> 
  <tr maxCols="3"> ... 
and you are inside the fo:table element, could one do something like this: 

 <xsl:param name="columnsCounter" select="/child::tr/attribute::maxCols"/> 

  
  <fo:table-column width="30" 
number-columns-repeated="{$columnsCounter}"/> 

or is there a better way to cope with this ?!? 
Anyhow, if i got quite a complex table, my Tomcat is tremendously busy .. 
;o) 
Many thanks 4 your help + kind regards from Hamburg 
Jens 



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message