You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Lincoln Nhari <Li...@mcbank.co.za> on 2000/07/12 12:45:17 UTC

XSL FO - Pagination

I need help with pagination. I am creating a master-detail report and I need
each master-record and to appear on separate pages. I am forcing a page
break after each master-detail set, but I end up with a blank page at the
end. Any ideas on how I can overcome this. I have included the structure of
my xsl at the bottom.

Thanks in advance.

Lincoln


The structure of my XSL is as follows at the moment:

<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="/">
		<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
		<!-- Defines page layout -->
			<fo:layout-master-set>
				<!--Layout for the first page -->
				<fo:simple-page-master
page-master-name="first" page-width="29.7cm" page-height="21cm"
margin-top="2cm" 
					margin-bottom="2cm"
margin-left="2cm" margin-right="2cm">
					<!--Place holder-->
				</fo:simple-page-master>
				<!--Layout for other pages -->
				<fo:simple-page-master
page-master-name="rest" page-width="29.7cm" page-height="21cm"
margin-top="2cm" 
					margin-bottom="2cm"
margin-left="2cm" margin-right="2cm">
						<!--place holder-->
				</fo:simple-page-master>
			</fo:layout-master-set>
		<!--end defines page layout -->
			
		<!--actual layout-->
			<fo:page-sequence>
			<!--usage of page layout-->
				<fo:sequence-specification>
					<fo:sequence-specifier-repeating
page-master-first="first" page-master-repeating="rest"/>
				</fo:sequence-specification>
				<!-- Header -->
				<xsl:apply-templates/>
			</fo:page-sequence>
		</fo:root>
	</xsl:template>
	
	<xsl:template match="settlement">
		<fo:static-content flow-name="xsl-before">
			<fo:block text-align="end" font-size="6pt"
font-family="serif" line-height="14pt">
				Page	<fo:page-number/>
			</fo:block>
			<!--REPORT HEADER -->
					</fo:table-row>
				</fo:table-body>
			</fo:table>
				
		</fo:static-content>

		<fo:flow flow-name="xsl-body">
			<xsl:apply-templates select="masterrecord"/>
		</fo:flow>
	</xsl:template>
	
	<xsl:template match="masterrecord">
			<!--GROUP HEADER LABELS-->
			
			<!--...-->
			<xsl:apply-templates select="detailedrecords">
		  </xsl:apply-templates>

			<fo:block break-after="page"/>
					   
	</xsl:template>
	
	<xsl:template match="detailedrecords">
		<fo:table width="25.7cm" table-layout="fixed"
background-color="white">
			...
	    <fo:table-body>
		      <xsl:apply-templates select="detail_record">
		      </xsl:apply-templates>
		   </fo:table-body>
		</fo:table>
	</xsl:template>
	
	<xsl:template match="detail_record">
	  <fo:table-row>
	    <xsl:apply-templates/>
	  </fo:table-row>
	</xsl:template>
	<!--MORE TEMPLATES-->	
</xsl:stylesheet>

Re: XSL FO - Pagination

Posted by Arved Sandstrom <Ar...@chebucto.ns.ca>.
Hi, Lincoln

If the contents of your file are not private, can you send me the complete
thing as an attachment? You are using the older spec - I'll rework your file to
illustrate use of the new spec.

Regards, Arved Sandstrom

On Wed, 12 Jul 2000, Lincoln Nhari wrote: > I
need help with pagination. I am creating a master-detail report and I need >
each master-record and to appear on separate pages. I am forcing a page > break
after each master-detail set, but I end up with a blank page at the > end. Any
ideas on how I can overcome this. I have included the structure of > my xsl at
the bottom. > 
> Thanks in advance.
> 
> Lincoln
> 
> 
> The structure of my XSL is as follows at the moment:
> 
> <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="/">
> 		<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
> 		<!-- Defines page layout -->
> 			<fo:layout-master-set>
> 				<!--Layout for the first page -->
> 				<fo:simple-page-master
> page-master-name="first" page-width="29.7cm" page-height="21cm"
> margin-top="2cm" 
> 					margin-bottom="2cm"
> margin-left="2cm" margin-right="2cm">
> 					<!--Place holder-->
> 				</fo:simple-page-master>
> 				<!--Layout for other pages -->
> 				<fo:simple-page-master
> page-master-name="rest" page-width="29.7cm" page-height="21cm"
> margin-top="2cm" 
> 					margin-bottom="2cm"
> margin-left="2cm" margin-right="2cm">
> 						<!--place holder-->
> 				</fo:simple-page-master>
> 			</fo:layout-master-set>
> 		<!--end defines page layout -->
> 			
> 		<!--actual layout-->
> 			<fo:page-sequence>
> 			<!--usage of page layout-->
> 				<fo:sequence-specification>
> 					<fo:sequence-specifier-repeating
> page-master-first="first" page-master-repeating="rest"/>
> 				</fo:sequence-specification>
> 				<!-- Header -->
> 				<xsl:apply-templates/>
> 			</fo:page-sequence>
> 		</fo:root>
> 	</xsl:template>
> 	
> 	<xsl:template match="settlement">
> 		<fo:static-content flow-name="xsl-before">
> 			<fo:block text-align="end" font-size="6pt"
> font-family="serif" line-height="14pt">
> 				Page	<fo:page-number/>
> 			</fo:block>
> 			<!--REPORT HEADER -->
> 					</fo:table-row>
> 				</fo:table-body>
> 			</fo:table>
> 				
> 		</fo:static-content>
> 
> 		<fo:flow flow-name="xsl-body">
> 			<xsl:apply-templates select="masterrecord"/>
> 		</fo:flow>
> 	</xsl:template>
> 	
> 	<xsl:template match="masterrecord">
> 			<!--GROUP HEADER LABELS-->
> 			
> 			<!--...-->
> 			<xsl:apply-templates select="detailedrecords">
> 		  </xsl:apply-templates>
> 
> 			<fo:block break-after="page"/>
> 					   
> 	</xsl:template>
> 	
> 	<xsl:template match="detailedrecords">
> 		<fo:table width="25.7cm" table-layout="fixed"
> background-color="white">
> 			...
> 	    <fo:table-body>
> 		      <xsl:apply-templates select="detail_record">
> 		      </xsl:apply-templates>
> 		   </fo:table-body>
> 		</fo:table>
> 	</xsl:template>
> 	
> 	<xsl:template match="detail_record">
> 	  <fo:table-row>
> 	    <xsl:apply-templates/>
> 	  </fo:table-row>
> 	</xsl:template>
> 	<!--MORE TEMPLATES-->	
> </xsl:stylesheet>
-- 
Senior Developer
e-plicity.com (www.e-plicity.com)
Halifax, Nova Scotia
"B2B Wireless in Canada's Ocean Playground"