Login   Register  
PHP Classes
elePHPant
Icontem

File: PHPReportPage.xsl

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Eustaquio Rangel de Oliveira Jr.  >  phpreports  >  PHPReportPage.xsl  >  Download  
File: PHPReportPage.xsl
Role: Auxiliary data
Content type: text/plain
Description: Page layer transformation
Class: phpreports
Report Generator
Author: By
Last change:
Date: 2003-03-13 15:00
Size: 2,312 bytes
 

Contents

Class file image Download
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
	Make code to generate the page object
	Includes the page header and footer
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:template name="MAKE_PAGE">
		// this is the customized page object for this report
		class PHPRepoPage_ extends PHPRepoPage {
			// prints customized header for this page object
			function printHeader( $oValue ) {
				$header = $oValue;	// nice way to refer to header data ;-)
				<xsl:text>print &quot;&lt;table </xsl:text>
				<xsl:apply-templates select="/REPORT/PAGE"/>
				<xsl:text>&gt;&quot;;&#10;</xsl:text>
				<xsl:call-template name="MAKE_PAGE_HEADER"/>
				<xsl:text>&#9;&#9;&#9;}&#10;</xsl:text>
				
			// prints customized footer for this page object
			function printFooter( $oValue, $bJump=true ) {
				<xsl:call-template name="MAKE_PAGE_FOOTER"/>
				<xsl:text>&#10;&#9;&#9;&#9;}&#10;&#9;&#9;}&#10;</xsl:text>
</xsl:template>

<!--
	Page header
-->			
<xsl:template name="MAKE_PAGE_HEADER">
	<xsl:for-each select="/REPORT/PAGE/HEADER/ROW">
		<xsl:text>&#9;&#9;&#9;&#9;print &quot;&lt;tr&gt;&quot;;&#10;</xsl:text>
		<xsl:for-each select="COL">
			<xsl:call-template name="MAKE_COL"/> 
		</xsl:for-each>
		<xsl:text>&#10;&#9;&#9;&#9;&#9;print &quot;&lt;/tr&gt;&quot;;&#10;</xsl:text>
	</xsl:for-each>		
</xsl:template>
	
<!--
	Page footer
-->			
<xsl:template name="MAKE_PAGE_FOOTER">
	<xsl:for-each select="/REPORT/PAGE/FOOTER/ROW">
		<xsl:if test="position()&gt;1">
			<xsl:text>&#9;&#9;&#9;&#9;</xsl:text>
		</xsl:if>	
		<xsl:text>print &quot;&lt;tr&gt;&quot;;&#10;</xsl:text>
		<xsl:for-each select="COL">
			<xsl:call-template name="MAKE_COL"/> 
		</xsl:for-each>
		<xsl:text>&#10;&#9;&#9;&#9;&#9;print &quot;&lt;/tr&gt;&quot;;&#10;</xsl:text>
	</xsl:for-each>		
	<xsl:text>&#9;&#9;&#9;&#9;print &quot;&lt;/table&gt;&quot;;&#10;</xsl:text>
	
	<!-- test if there is a document footer - if so, dont break lines -->	
	<xsl:if test="count(/REPORT/DOCUMENT/FOOTER)&lt;=0">
		<xsl:text>&#9;&#9;&#9;&#9;print &quot;&lt;br clear='all'/&gt;&lt;br/&gt;&quot;;&#10;</xsl:text>
	</xsl:if>
			
	<xsl:text>&#9;&#9;&#9;&#9;if($bJump)&#10;</xsl:text>
	<xsl:text>&#9;&#9;&#9;&#9;&#9;print &quot;&lt;p class='breakhere'&gt;&lt;/p&gt;&quot;;&#10;</xsl:text>
</xsl:template>

</xsl:stylesheet>