Dnia 2003-09-10 19:47, Użytkownik J.Pietschmann napisał:
As you've been told, use markers. Note that you can't tell the formatter to sum up stuff, you'll have to put already prepared markers into the FO source. For "summing up the whole stuff until this point" this is easy. Lets say your data is 10, 20, 30, ... The prepare a FO like (pseudo code) <fo:table-row> <fo:table-cell> <fo:block><fo:marker marker-class-name="sum">10</fo:marker> 10 </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block><fo:marker marker-class-name="sum">30</fo:marker> 20 </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block><fo:marker marker-class-name="sum">600</fo:marker> 30 </fo:block> </fo:table-cell> </fo:table-row>
and use something like <fo:block>Sum: <fo:retrieve-marker retrieve-class-name="sum" retrieve-position="last-starting-within-page"/></fo:block>
If you want to have sums per page, this is difficult to impossible because you don't know where to start the summation.
J.Pietschmann
Thank you. Great idea!
But I have problems with retrieve-position="first-starting-within-page" now. I want to print summary at the begin of every page. I want to put there the same value which is in the summary at end of previous page. I try to use something like this:
<fo:static-content flow-name="xsl-region-before">
<fo:block>Sum:
<fo:retrieve-marker retrieve-class-name="..."
retrieve-position="first-starting-within-page"/>
</fo:block>
</fo:static-content>and I think it doesn't works as it should. Look at my .fo file. Please, make pdf or ps using it. There are two strange behaviours:
1) I don't know why
<fo:retrieve-marker retrieve-class-name="..." retrieve-position="first-starting-within-page"/> takes value not from first marker but from second marker on the page, but... only from second page. On the first page it tooks value from first marker - and this is correct in my opinion. Is it a bug?
There are markers 'sumTwoBefore' in attached file, which are values of "summing up the whole stuff until this point without two last rows". I have to create them, because of this strange behaviour.
2) There is a problem with last page. As you see in created pdf (or ps) file there is '200' in header on last page. Try to comment last row definition in file (lines 202-208) and then create pdf. You will see '180' in header on the last page! Why? Is it a bug? In my opinion it is.
Kuba Królikowski
<?xml version="1.0" encoding="iso-8859-2"?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <!-- Layout definition --> <fo:layout-master-set> <fo:simple-page-master master-name="first" page-height="6.5cm" page-width="10cm" margin-top="1cm" margin-bottom="0cm" margin-left="1.0cm" margin-right="0.5cm"> <fo:region-body margin-top="1cm" margin-bottom="2cm"/> <fo:region-before extent="1cm"/> <fo:region-after extent="2cm"/> </fo:simple-page-master> </fo:layout-master-set> <!-- Start actual layout --> <fo:page-sequence master-reference="first" country="PL" language="pl"> <fo:static-content flow-name="xsl-region-after"> <fo:block>Sum: <fo:retrieve-marker retrieve-class-name="sum" retrieve-position="last-ending-within-page"/> </fo:block> </fo:static-content> <fo:static-content flow-name="xsl-region-before"> <fo:block>Sum: <fo:retrieve-marker retrieve-class-name="sumTwoBefore" retrieve-position="first-starting-within-page"/> </fo:block> </fo:static-content> <fo:flow flow-name="xsl-region-body" font-family="Times" font-size="10pt" hyphenate="true" hyphenation-push-character-count="2" hyphenation-remain-character-count="2"> <fo:table font-family="Times" font-size="10pt"> <fo:table-column column-width="20mm"/> <fo:table-header font-weight="bold"> <fo:table-row> <fo:table-cell text-weight="bold" text-align="left"> <fo:block>X</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell border-top-width="1pt" border-top-style="solid"> <fo:block> </fo:block> </fo:table-cell> </fo:table-row> </fo:table-header> <fo:table-footer> <fo:table-row> <fo:table-cell border-top-width="1pt" border-top-style="solid"> <fo:block> </fo:block> </fo:table-cell> </fo:table-row> </fo:table-footer> <fo:table-body> <fo:table-row> <fo:table-cell> <fo:block><fo:marker marker-class-name="sum">10</fo:marker> <fo:marker marker-class-name="sumTwoBefore">-10</fo:marker> 10</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block><fo:marker marker-class-name="sum">20</fo:marker> <fo:marker marker-class-name="sumTwoBefore">0</fo:marker> 10</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block><fo:marker marker-class-name="sum">30</fo:marker> <fo:marker marker-class-name="sumTwoBefore">10</fo:marker> 10</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block><fo:marker marker-class-name="sum">40</fo:marker> <fo:marker marker-class-name="sumTwoBefore">20</fo:marker> 10</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block><fo:marker marker-class-name="sum">50</fo:marker> <fo:marker marker-class-name="sumTwoBefore">30</fo:marker> 10</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block><fo:marker marker-class-name="sum">60</fo:marker> <fo:marker marker-class-name="sumTwoBefore">40</fo:marker> 10</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block><fo:marker marker-class-name="sum">70</fo:marker> <fo:marker marker-class-name="sumTwoBefore">50</fo:marker> 10</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block><fo:marker marker-class-name="sum">80</fo:marker> <fo:marker marker-class-name="sumTwoBefore">60</fo:marker> 10</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block><fo:marker marker-class-name="sum">90</fo:marker> <fo:marker marker-class-name="sumTwoBefore">70</fo:marker> 10</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block><fo:marker marker-class-name="sum">100</fo:marker> <fo:marker marker-class-name="sumTwoBefore">80</fo:marker> 10</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block><fo:marker marker-class-name="sum">110</fo:marker> <fo:marker marker-class-name="sumTwoBefore">90</fo:marker> 10</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block><fo:marker marker-class-name="sum">120</fo:marker> <fo:marker marker-class-name="sumTwoBefore">100</fo:marker> 10</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block><fo:marker marker-class-name="sum">130</fo:marker> <fo:marker marker-class-name="sumTwoBefore">110</fo:marker> 10</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block><fo:marker marker-class-name="sum">140</fo:marker> <fo:marker marker-class-name="sumTwoBefore">120</fo:marker> 10</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block><fo:marker marker-class-name="sum">150</fo:marker> <fo:marker marker-class-name="sumTwoBefore">130</fo:marker> 10</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block><fo:marker marker-class-name="sum">160</fo:marker> <fo:marker marker-class-name="sumTwoBefore">140</fo:marker> 10</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row>1 <fo:table-cell> <fo:block><fo:marker marker-class-name="sum">170</fo:marker> <fo:marker marker-class-name="sumTwoBefore">150</fo:marker> 10</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block><fo:marker marker-class-name="sum">180</fo:marker> <fo:marker marker-class-name="sumTwoBefore">160</fo:marker> 10</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block><fo:marker marker-class-name="sum">190</fo:marker> <fo:marker marker-class-name="sumTwoBefore">170</fo:marker> 10</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block><fo:marker marker-class-name="sum">200</fo:marker> <fo:marker marker-class-name="sumTwoBefore">180</fo:marker> 10</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block><fo:marker marker-class-name="sum">210</fo:marker> <fo:marker marker-class-name="sumTwoBefore">190</fo:marker> 10</fo:block> </fo:table-cell> </fo:table-row> <!-- comment this table-row to see strange behaviour --> <fo:table-row> <fo:table-cell> <fo:block><fo:marker marker-class-name="sum">220</fo:marker> <fo:marker marker-class-name="sumTwoBefore">200</fo:marker> 10</fo:block> </fo:table-cell> </fo:table-row> <!-- ============================================== --> </fo:table-body> </fo:table> </fo:flow> </fo:page-sequence> </fo:root>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
