Free Support Forum - aspose.com

Table header on each page

Hi,

how can i make my table header displayed on each page? since my table data doesnt fit on 1 page.

here is my code:

<xsl:template name="MainFlow">

<Section PageMarginTop="1cm" PageMarginLeft="1.5cm" PageMarginRight="1cm" PageMarginBottom="1.3cm" PageSize="A4" LineSpacing="2">

<xsl:if test="/rodinreport/pageinfo/showheader = 'J'">

<xsl:call-template name="pageinfo"/>

</xsl:if>

<xsl:if test="/rodinreport/pageinfo/showpages = 'J'">

<xsl:call-template name="ShowPage"/>

</xsl:if>

<xsl:if test="/rodinreport/pageinfo/showdate = 'J'">

<xsl:call-template name="ShowDate"/>

</xsl:if>

<xsl:call-template name="PrintLocations"/>

</Section>

</xsl:template>

<xsl:template name="PrintLocations">

<Text Alignment="Center" FontSize="{$fontsize * 2}" FontName="Verdana, Sans-Serif" Color="#777777" IsTrueTypeFontBold="true">

<Segment>Klant locatie overzicht</Segment>

</Text>

<Table ColumnWidths="1.29cm 3.21cm 0.64cm 3.87cm 7.71cm" FontSize="{$fontsize * 1.1}" FontName="Tahoma, sans-serif">

<DefaultCellBorder>

<All LineWidth="0"/>

</DefaultCellBorder>

<xsl:call-template name="GetTableHeader">

<xsl:with-param name="header" select="/rodinreport/header"/>

</xsl:call-template>

<xsl:for-each select="/rodinreport/sites/site">

<Row>

<Cell>

<Text>

<Segment>

<xsl:value-of select="code"/>

</Segment>

</Text>

</Cell>

<Cell ColumnsSpan="2">

<Text>

<Segment>

<xsl:value-of select="name"/>

</Segment>

</Text>

</Cell>

<Cell>

<Text>

<Segment>

<xsl:value-of select="city"/>

</Segment>

</Text>

</Cell>

<Cell>

<Text>

<Segment>

<xsl:value-of select="description"/>

</Segment>

</Text>

</Cell>

</Row>

</xsl:for-each>

</Table>

</xsl:template>

<xsl:template name="GetTableHeader">

<xsl:param name="header"/>

<Row>

<Cell ColumnsSpan="2">

<Text IsTrueTypeFontBold="true">

<Segment>Klant code</Segment>

</Text>

</Cell>

<Cell ColumnsSpan="3">

<Text>

<Segment>

<xsl:value-of select="$header/client/code"/>

</Segment>

</Text>

</Cell>

</Row>

<Row>

<Cell ColumnsSpan="2">

<Text IsTrueTypeFontBold="true">

<Segment>Klant naam</Segment>

</Text>

</Cell>

<Cell ColumnsSpan="3">

<Text>

<Segment>

<xsl:value-of select="$header/client/name"/>

</Segment>

</Text>

</Cell>

</Row>

<Row>

<Cell ColumnsSpan="2">

<Text IsTrueTypeFontBold="true">

<Segment>Aantal locaties</Segment>

</Text>

</Cell>

<Cell ColumnsSpan="3">

<Text>

<Segment>

<xsl:value-of select="$header/client/number"/>

</Segment>

</Text>

</Cell>

</Row>

<Row>

<Border>

<Bottom LineWidth="0.5"/>

</Border>

<Cell>

<Text IsTrueTypeFontBold="true" MarginTop="0.3cm">

<Segment>Code</Segment>

</Text>

</Cell>

<Cell ColumnsSpan="2">

<Text IsTrueTypeFontBold="true" MarginTop="0.3cm">

<Segment>Naam</Segment>

</Text>

</Cell>

<Cell>

<Text IsTrueTypeFontBold="true" MarginTop="0.3cm">

<Segment>Plaats</Segment>

</Text>

</Cell>

<Cell>

<Text IsTrueTypeFontBold="true" MarginTop="0.3cm">

<Segment>Omschrijving</Segment>

</Text>

</Cell>

</Row>

</xsl:template>

Hi,

In Aspose.Pdf API, Table class has a property named IsFirstRowRepeated that can be set to true, so that the same header displaying on the first page will be displayed on further pages.

For more information kindly visit Control Table and Row Splitting