xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten B." <c.bueh...@xdot.de>
Subject Re: Sobtotal per Page
Date Fri, 17 Jul 2009 13:50:49 GMT

Thanks for this answer, Chris.

Christopher R. Maden wrote:
> You are calling a template called “getSubtotal” and don’t have a
> template called “getSubtotal.”  Hence, the template could not be found.

I understand now. My mistake was i defined the template "getSubtotal" und my
main template.

I would recommend making a very simple XSLT that produces plain text or
HTML from your data, with a running subtotal at every section.  That
should point the way to doing it in FO.

Christopher R. Maden wrote:
> You may also consider raising this question on the xsl-list, as it’s
> independent of FOP.  However, the very helpful people there are also
> very busy, so prepare a stripped-down example that demonstrates your
> problem.  (You may also find that preparing such an example helps you to
> solve it yourself.)

Sorry, did not know I was wrong. So this will me my last question (Sorry,
but after this we have "hopefully" solved my Problem).

Christopher R. Maden wrote:
> When you retrieve a marker with last-ending-within-page, you’ll get the
> last one on that page.  So if you generated five subtotal markers on the
> page, you’ll just get the fifth one.

Is the a possibility to return a value from a template?

I would like to implement a rekursive "service". It shall lokk like this. 

3 Oders:
1 OderSum: 1
2 OderSum: 2
3 OrdeSum: 3
$total = 0

I go through my xml with a for-each.

<!-- Call template -->
     $total = $total + "OrderSum1";
     <!-- Call retrieve marker to check if it is the last OrdeSum on a page
     RETURN $total into $total from for-each
<!-- Call template end -->

Repeat from here if there are OderSums left.

So i would have:
1. Walk through: $total (for-each)=0    
     1. $OrderSum=1 
     2. $total (Template)=$total (Teplate)+$Ordersum (after this 1)
     3. RETURN total 
2. Walk through: $total (for-each)=1
     1. $OrderSum=2 
     2. $total (Template)=$total (Teplate)+$Ordersum (after this 3)
     3. RETURN total 
<!-- Pagebreak -->
    Call retrieve-marker with param $total (for-each) and print it in my
footer (Printed: Odersum: 3)
3. Walk through: $total (for-each)=3
     1. $OrderSum=2 
     2. $total (Template)=$total (Teplate)+$Ordersum (after this 5)
     3. RETURN total 
<!-- Pagebreak -->
    Call retrieve-marker with param $total (for-each) and print it in my
footer (Printed: Odersum: 5)

I hope you could follow my thoughts.

Is this in possible in any way. I would do something like that in JS or
View this message in context: http://www.nabble.com/Sobtotal-per-Page-tp24519516p24534811.html
Sent from the FOP - Users mailing list archive at Nabble.com.

To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org

View raw message