"Jim Urban" <[EMAIL PROTECTED]> wrote: > Here is another thing I need to do. I have a single document which contains > reports for multiple locations. I need to reset the page number on a > location change. IE: Report contains 3 locations. The first location gets > 3 pages, the second 2 pages and the third 4 pages. Currently FOP is > generating Page 1 of 9, Page 2 of 9 etc. I need to generate Page 1 of 3, > Page 2 of 3, Page 3 of 3, Page 1 of 2, Page 2 of 2, Page 1 of 4 etc. How > do I go this?
This has been recently discussed on this list. Create a page-flow for each report. Since you want to have the total page number for each page-flow referenced, you'll have to be careful choosing the identifier for the block used in the reference trick. If you generate the FO by XSLT, and your reports are wrapped in "record" elements in your source XML, you can use a code similar to: <xsl:template match="report"> <fo:page-sequence master-name="report" initial-page-number="1" > <fo:static-content flow-name="xsl-region-after"> <fo:block text-align="end"> <xsl:text>Page </xsl:text> <fo:page-number/> <xsl:text> of </xsl:text> <fo:page-number-citation ref-id="endofflow-{generate-id()}"/> </fo:block> </fo:static-content> <fo:flow flow-name="xsl-region-body"> <xsl:apply-templates/> <fo:block id="endofflow-{generate-id()}"/> </fo:flow> </fo:page-sequence> </xsl:template> HTH J.Pietschmann --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]