XSL:FO, Probleme mit Umbruch bei Tabellen

vNeumann

Mitglied
Hallo,
ich denke dass ist das richtige Forum, falls nicht bitte verschieben.

Ich arbeite gerade an einem PDF, auf dem unter anderem eine lange Tabelle mittels fo:table dargestellt wird. Die Tabelle hat eine variable Länge, und ich habe derzeit das Problem, dass die Tabelle asynchron umgebrochen wird:

Auf Seite 1 werden lediglich 5 Zeilen dargestellt, auf Seite 2 23 Zeilen, auf Seite 3 11 Zeilen, und das obwohl genügend Platz vorhanden ist. Wie kann ich sowas verhindern, und warum ist das überhaupt so?

Code:
<fo:table table-layout="fixed" width="100%" keep-together="auto" font-size="8pt">
                        <fo:table-column column-width="20mm"/>
                        <fo:table-column column-width="15mm"/>
                        <fo:table-column column-width="15mm"/>
                        <fo:table-column column-width="15mm"/>
                        <fo:table-column column-width="10mm"/>
                        <fo:table-column column-width="10mm"/>
                        <fo:table-column column-width="70mm"/>
                        <fo:table-column column-width="25mm"/>
                        <fo:table-body>
                            <fo:table-row font-weight="bold">
                                <fo:table-cell border="0.2mm solid" padding="1mm">
                                    <fo:block>Date</fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="0.2mm solid" padding="1mm">
                                    <fo:block>Start</fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="0.2mm solid" padding="1mm">
                                    <fo:block>End</fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="0.2mm solid" padding="1mm">
                                    <fo:block>Duration</fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="0.2mm solid" padding="1mm">
                                    <fo:block>A*</fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="0.2mm solid" padding="1mm">
                                    <fo:block>E**</fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="0.2mm solid" padding="1mm">
                                    <fo:block>Subject</fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="0.2mm solid" padding="1mm">
                                    <fo:block>Deduction</fo:block>
                                </fo:table-cell>
                            </fo:table-row>
                            <xsl:apply-templates select="downtimeevents/downtimeevent"/>
                        </fo:table-body>
                    </fo:table>

Danke für eure Hilfe, ich steh vor einem Rätsel
 
Ich habe das Problem nun lang 2 stündiger Suche und selbstherumtüfteln gefunden, und stelle es hier rein, falls es noch jemand braucht:

Die Zeile <xsl:apply-templates select="downtimeevents/downtimeevent"/> macht nichts anderes, als aus den einzelnen Elementen <fo:table-row> zu erstellen. Wird bei JEDER <fo:table-row> nun das Attribut keep-together="always" angegeben, so wird die Tabelle ganz "normal" dargstellt (also so viele Zeilen wie möglich auf der 1. Seite, dann soviel wie möglich auf der 2. Seite, etc.
 
Zurück