Subject: Re: [xsl] Adding subtotals to a report From: "J.Pietschmann" <j3322ptm@xxxxxxxx> Date: Fri, 19 Apr 2002 01:50:41 +0200 |
<xsl:template match="ScheduleVariance">...
...<td><font color="gold"><b>Total</b></font></td> <xsl:for-each select="Employee"> <xsl:variable name="subtotals"> <subtotal><xsl:value-of select="Total" /></subtotal> </xsl:variable> <tr> <xsl:call-template name="Employee" /> </tr> </xsl:for-each>
I get the report formatted the way they want it, but when I try to add> this to it to get subtotals, I get variable is not defined or in scope.
That's because the variable is not in scope. The scope of variables is the enclosing element, in this case the for-each statement working on your Employee elements.
<tr> <td></td> <td><b>Totals</b></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td><xsl:value-of select="sum(Employee/Total)" /></td> </tr>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Adding subtotals to a report, David Messing 477-1 | Thread | RE: [xsl] Adding subtotals to a rep, Michael Kay |
Re: [xsl] set header in XSLT, J.Pietschmann | Date | RE: [xsl] Adding subtotals to a rep, David Messing 477-1 |
Month |