While trying to create pdf-reports from data I stumbled on a problem
with page breaks.
In my XML file I have data about teams for one month. I want each team
displayed
on a seperate page.
I tried
- page-break.before="always"
- page-break.after="always"
- page-break-after="always"
and
- keep-together.within-page="always"
as shown below.
Has anybody an answer on the question how I enfor a page break in my
output file?
Part of the XSL file:
<xsl:apply-templates select="month"/>
<fo:block keep-together.within-page="always">
<xsl:for-each select="team">
<!-- Print the team name as caption before the
table -->
<fo:block space-before.optimum="1cm" font-size="12pt"
font-weight="bold" font-family="serif" text-align="center">
<xsl:text>Hours of team </xsl:text>
<xsl:value-of select="text()"/>
</fo:block>
<!-- Keep all project codes of a team on one
page -->
<fo:block page-break.before="always">
<!-- The
table -->
<fo:table space-before.optimum="8pt"
space-after.optimum="0.6cm" border="2pt" empty-cells="show">
<fo:table-column column-width="2.9cm"/>
<fo:table-column column-width="3.5cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="4cm"/>
<fo:table-column column-width="1.5cm"/>
<fo:table-body>
<!-- The heading of the
table. -->
<xsl:for-each select="project_code">
etc.
P.S. The combination of the XML and XSL-file generates a pdf-file.
=====================================
Michel Bergijk
work: CMG TCU B.V.
By days I engineer processes.
private: m.be...@wxs.nl
=====================================
Hi Michel,
have you tried:
<fo:block break-before = "page" ...
I am using FOP-0.14.0 and it works for me.
Karsten
Thanks for your reply. I tried
<fo:block break-after="page" />
and it worked. The only problem I have with this solution is the extra
white
page.
C.U. Michel
--
=====================================
Michel Bergijk
private: m.be...@wxs.nl
=====================================