Re: [xsl] Subtotals by page

Subject: Re: [xsl] Subtotals by page
From: Jaine_e <sair777@xxxxxxxxx>
Date: Mon, 14 Mar 2005 22:30:38 -0800 (PST)
Thankx Eliot 

Lets say I have 22 rows in the body region of my
documents and then I generate the footer which
contains the page total value for that page.

But using the sum() function is xsl I am able to
generate the running total as well as the  total for
the previous page as follows:

Running total:

<fo:marker marker-class-name="page-total">
select="format-number(sum(preceding::itemprice) +
itemprice, '#,##0.00')"/>

Total for the previous page:
<fo:marker marker-class-name="part-sum">

Now what I actually want is the page total on this
page: which would be the value I get when I subtract
the above two values like this:
pagetotal - partsum
In XSL-FO it is not possible to do this.

So my question is even if I do know the number of rows
how do I make it sum that many number of rows?


but the question is how do I tell the processor to sum
--- Eliot Kimber <ekimber@xxxxxxxxxxxxxxxxxxx> wrote:
> Jaine_e wrote:
> >  
> > 
> >>You haven't said what medium you are using for the
> >>final format.
> >>
> > 
> > 
> > I'm using XSL-FO for the final formatting
> There's no direct way to do this with XSL-FO 1.0 as
> there's no way to 
> know, in the general case, when your table will go
> to a new page. 
> However, if the depth of your rows is fixed and the
> start point of your 
> table is consistent then you should be able to
> determine accurately how 
> many rows will go on a page and therefore you can
> generate the "footer" 
> row (which will just be a normal row) as part of
> your XSLT process.
> XSL-FO 1.1 adds a new feature, table markers, which
> allows you to use 
> markers in table headers and footers. This will let
> you do exactly what 
> you want in a very direct way.
> As mentioned by David C., you can also use some form
> of two-pass process 
> depending on the features of the XSL-FO
> implementation you are using.
> Cheers,
> E.
> -- 
> W. Eliot Kimber
> Professional Services
> Innodata Isogen
> 9390 Research Blvd, #410
> Austin, TX 78759
> (512) 372-8122
> ekimber@xxxxxxxxxxxxxxxxxxx

Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site! 

Current Thread