You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by "Marx, Alexander" <al...@hbsolutions.de> on 2008/06/13 11:29:04 UTC

ClassCastException when using Table Cells in FOP 0.95B

Hello,

 

I have an issue with Tables in my FOP when using FOP 0.95Beta instead of
0.94

 

None of my Tables work in my FO when using FOP 0.95, i get the following
ClassCastExecption:

                               

java.lang.ClassCastException: org.apache.fop.fo.flow.table.TableCell
cannot be cast to org.apache.fop.fo.flow.table.ColumnNumberManagerHolder

        at
org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:217)

        at
org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)

        at org.apache.fop.cli.Main.startFOP(Main.java:166)

        at org.apache.fop.cli.Main.main(Main.java:197)

                               

                

This is an example how i insert a table in the FO:

                

                                               <fo:table
border-collapse="separate" border-style="none" padding="2pt"
table-layout="fixed" width="100%">

 
<fo:table-column column-number="1" column-width="100%"/>

 
<fo:table-body>

 
<fo:table-row>

 
<fo:table-cell vertical-align="top">

 
<fo:block column-number="1" font-size="x-large" font-weight="bold"
text-align="left">Name1</fo:block>                                    

 
</fo:table-cell>

 
</fo:table-row>

 
</fo:table-body>

                                               </fo:table>

 

It is working well in 0.94 and I want to upgrade to 0.95 because of the
updated keep-together features. What could be a possible Reason?

                                               

regards,

Alexander


Re: ClassCastException when using Table Cells in FOP 0.95B

Posted by Vincent Hennebert <vi...@anyware-tech.com>.
Hi Alexander,

Marx, Alexander wrote:
> Hello,
> 
> I have an issue with Tables in my FOP when using FOP 0.95Beta instead of
> 0.94
> 
> <fo:table
> border-collapse="separate" border-style="none" padding="2pt"
> table-layout="fixed" width="100%">
> <fo:table-column column-number="1" column-width="100%"/>
> <fo:table-body>
> <fo:table-row>
> <fo:table-cell vertical-align="top">
> <fo:block column-number="1" font-size="x-large" font-weight="bold"
> text-align="left">Name1</fo:block>                                    
> </fo:table-cell>
> </fo:table-row>
> </fo:table-body>
> </fo:table>

You specified the column-number property on an element that doesn’t
support it (fo:block). I guess you wanted to set it on the parent
fo:table-cell element (although here it’s not needed). column-number
only applies to fo:table-column and fo:table-cell.

FOP lacks of robustness here since it crashes instead of just giving
a warning that column-number doesn’t apply to fo:block. Can you please
create a bug report on Bugzilla, attaching a complete FO file containing
your snippet above as an example?
https://issues.apache.org/bugzilla/enter_bug.cgi?product=Fop

This will help us to keep track of the issue. Thanks!

For now, if you just remove column-number from the fo:block your FO file
will render fine.


HTH,
Vincent


-- 
Vincent Hennebert                            Anyware Technologies
http://people.apache.org/~vhennebert         http://www.anyware-tech.com
Apache FOP Committer                         FOP Development/Consulting

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