[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: how to create sub-totals and carry-overs

Subject: Re: how to create sub-totals and carry-overs
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Thu, 26 Jun 2003 19:30:48 +0200
xsl fo zwischensumme
For a linear solution for obtaining incremental results over a list
(e.g. running totals, etc.) do have a look at the functions scanl() and
scanl1() from the FXSL functional programming library. they are located
in the file scanl.xsl


Hope this helped.

Cheers,
Dimitre Novatchev.


"Moenig, Dorit" <Dorit.Moenig@xxxxxxxxxxxxxx> wrote in message
news:6B2492D663ECD4119EB70008C7E6F67303A5CBE5@xxxxxxxxxxxxxxxxxxxxxxxxxx
> i have to sum up special amounts and show sub-totals
> on the bottom of a page, and carry-overs at the top of
> the following page.
> i use markers for this.
> code for creating the subtotals looks like this:
>
> <fo:marker marker-class-name="subtotalvalue">
> <xsl:call-template name="calculate">
> <xsl:with-param name="text">Zwischensumme</xsl:with-param>
> <xsl:with-param name="mode">1</xsl:with-param>
> <xsl:with-param name="amount">
> <xsl:choose>
> <xsl:when test="AmountISH!='' and
> starts-with(@SubcodeISH,'A')">
> <xsl:value-of select="AmountISH + sum
> (preceding::AmountISH[.!= '' and starts-with(../@SubcodeISH,'A')])"/>
> </xsl:when>
> <xsl:otherwise>
> <xsl:value-of select="sum(preceding::AmountISH[.!= '' and
> starts-with(../@SubcodeISH,'A')])"/>
> </xsl:otherwise>
> </xsl:choose>
> </xsl:with-param>
> <xsl:with-param name="currency" select="CurrencyISH"/>
> </xsl:call-template>
> </fo:marker>
>
> the disadvantage of this construction is that for each (!) position
> (table-row) all the preceding AmountISH nodes
> are processed. same again for creating the carry-overs.
> when i have a document with 10000 amount positions, this doesn't make
sense
> to me.
> do you have a better idea to do the (partial) summing up ?
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.