Hi All,
This Ravi, I am newbie to FO XSL. I am trying to generate PDF by using FOP Engine, in my scenario I have to print table in a PDF file where some table rows need to be repeated on page break, so I kept these rows(which need to be repeated) inside <fo:table-header> tag as below
<fo:table-header>
// Table rows
</fo:table-header>
above scenario is working fine for me, but as another requirement I need to get these <fo:table-header> rows dynamically. For this I have decided to use <fo:marker> which will accepts dynamic content and I am retieving the same as below
<fo:flow flow-name="body">
<fo:block>
<fo:table text-align="center" font="10pt Arial">
<fo:table-header font-weight="bold">
<fo:table-row keep-together.within-page="always">
<fo:table-cell number-columns-spanned="6">
<fo:block>
<fo:retrieve-marker retrieve-position="first-starting-within-page" retrieve-class-name="table_header" />
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<fo:marker marker-class-name="table_header">
<fo:table table-layout="inherit" text-align="center" font="10pt Arial">
<fo:table-body>
<fo:table-row font-weight="bold">
<fo:table-cell border="solid 1px black">
<fo:block>Table 7</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:marker>
// Table body rows
</fo:table-header>
</fo:table>
</fo:block>
</fo:flow>
When I am trying to run the above FO XSL content with FOP engine using java, getting below exception
SEVERE: javax.xml.transform.TransformerException: java.lang.ClassCastException: org.apache.fop.layoutmgr.table.TableLayoutManager cannot be cast to org.apache.fop.layoutmgr.inline.InlineLevelLayoutManager
file:/D:/POC/POC/src/main/java/POCXSLT.xsl; Line #13; Column #46; java.lang.ClassCastException: org.apache.fop.layoutmgr.table.TableLayoutManager cannot be cast to org.apache.fop.layoutmgr.inline.InlineLevelLayoutManager
But if I gave text content inside <fo:marker> in above code it's working fine. Can anyone help me to resolve this issue and my configurations are as below
OS : Windows 7
JDK : 1.6.0_23
FOP : 2.0