View Single Post
  #1 (permalink)  
Old April 20th, 2011, 09:08 AM
srmxslca srmxslca is offline
Registered User
Points: 30, Level: 1
Points: 30, Level: 1 Points: 30, Level: 1 Points: 30, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default PDF giving first page as blank if page count > 1 using xsl:fo

Hi All,
I am generating a pdf from xsl:fo with 5x2 labels (10 )on each page , if lables are more than 10 it is giving first page as blank, second page onwards it is prinitng...
Could some one help me, i am having the code as follows:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">


<xsl:template match="/candidates">


<fo:root>

<fo:layout-master-set>
<fo:simple-page-master master-name="my-page" page-width="8in" page-height="11.5in">
<fo:region-body margin-top="0.80in" margin-bottom="0.20in" margin-left="0.20in" margin-right="0.20in" />
</fo:simple-page-master>
</fo:layout-master-set>

<fo:page-sequence master-reference="my-page">

<fo:flow flow-name="xsl-region-body">
<fo:block>
<fo:table text-align="center" border-spacing="3pt">

<fo:table-column column-number="1" />
<fo:table-column column-number="2" />


<fo:table-header>
<fo:table-row>
<fo:table-cell number-columns-spanned="2">
</fo:table-cell>
</fo:table-row>
</fo:table-header>

<fo:table-body>


<xsl:apply-templates select="report-bO/candidate-ro-details"/>
</fo:table-body>

</fo:table>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>


<xsl:template match="report-bO/candidate-ro-details">

<fo:table-row>

<fo:table-cell height="5cm" overflow="hidden" number-rows-spanned="2" number-columns-spanned="1">
<fo:block>
<fo:block text-align="left" margin-left="40pt" font-size="10pt" white-space-collapse="false" white-space-treatment="preserve"><xsl:value-of select="attendancenumber"/></fo:block>
<fo:block text-align="left" margin-left="40pt" font-size="10pt" white-space-collapse="false" white-space-treatment="preserve"><xsl:value-of select="roname"/></fo:block>
<fo:block text-align="left" margin-left="40pt" font-size="10pt" white-space-collapse="false" white-space-treatment="preserve"><xsl:value-of select="contactname"/></fo:block>
<fo:block text-align="left" margin-left="40pt" font-size="10pt" white-space-collapse="false" white-space-treatment="preserve"><xsl:value-of select="filecasenumber"/></fo:block>
<fo:block text-align="left" margin-left="40pt" font-size="10pt" ><xsl:value-of select="addressline1"/></fo:block>
<fo:block text-align="left" margin-left="40pt" font-size="10pt" ><xsl:value-of select="addressline2"/></fo:block>
<fo:block text-align="left" margin-left="40pt" font-size="10pt" ><xsl:value-of select="addressline3"/>
<xsl:choose>
<xsl:when test="(string-length(addressline4)&gt;0)">
, <xsl:value-of select="addressline4"/>
</xsl:when>
<xsl:otherwise>
<fo:leader/>
</xsl:otherwise>
</xsl:choose>

</fo:block>
<fo:block text-align="left" margin-left="40pt" font-size="10pt"><xsl:value-of select="addressline5"/>
<xsl:choose>
<xsl:when test="(string-length(addressline6)&gt;0)">
, <xsl:value-of select="addressline6"/>
</xsl:when>
<xsl:otherwise>
<fo:leader/>
</xsl:otherwise>
</xsl:choose>

</fo:block>

<fo:block text-align="left" font-size="20pt"><fo:leader/></fo:block>
</fo:block>
</fo:table-cell>


</fo:table-row>
</xsl:template>
</xsl:stylesheet>
Reply With Quote