You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Fahad Ansari <fa...@ansaris.us> on 2006/09/07 21:04:17 UTC
changing before content for repeatable page
Hello all,
I haven't been able to find information on this so wondering if anyone
has achieved this before.
I have a running report with one flow that requires a different header
information on first page and rest of the page headers are same. I
declared a simple-page-master
<fo:layout-master-set>
<fo:simple-page-master master-name="main">
<fo:region-before region-name="header"/>
<fo:region-body region-name="body"/>
<fo:region-after region-name="footer" />
</fo:simple-page-master>
<!-- Specify the page sequence -->
<fo:page-sequence-master master-name="master-sequence">
<fo:repeatable-page-master-reference
master-reference="main"/>
</fo:page-sequence-master>
</fo:layout-master-set>
and then in the header region I tried using
<xsl:choose>
<xsl:when test="fo:page-number=1">show first page content</xsl:when>
<xsl:otherwise>show rest of the page content</xsl:when>
</xsl:choose>
but fo:page-number is apparently empty at this point.
Just need to find out what would be the best way to change the header
from page 2 to n for a report that has dynamic page content.
Thanks in advance.
Fahad Ansari
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: changing before content for repeatable page
Posted by Lo...@log-net.com.
If you just want to display some static text that is different on the
first page ("This is the first page") and repeats on every page after
("This is not the first page"), use something like:
<fo:layout-master-set>
<fo:simple-page-master master-name="firstPage"
page-height="215mm"
page-width="278mm"
margin-top="10mm"
margin-bottom="5mm"
margin-left="10mm"
margin-right="10mm">
<fo:region-before
region-name="region-before-first" extent="80mm"/>
<fo:region-after region-name="region-after-first"
extent="50mm"/>
<fo:region-body margin-top="80mm"
margin-bottom="50mm"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="otherPage"
page-height="215mm"
page-width="278mm"
margin-top="10mm"
margin-bottom="5mm"
margin-left="10mm"
margin-right="10mm">
<fo:region-before region-name="region-before-rest"
extent="80mm"/>
<fo:region-after region-name="region-after-rest"
extent="10mm"/>
<fo:region-body margin-top="80mm"
margin-bottom="10mm"/>
</fo:simple-page-master>
<fo:page-sequence-master master-name="mainSequence">
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference
page-position="first" master-reference="firstPage"/>
<fo:conditional-page-master-reference
page-position="rest" master-reference="otherPage"/>
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="mainSequence" language="en"
country="us">
<fo:static-content flow-name="region-before-first">
<fo:block>This is the first page</fo:block>
</fo:static-content>
<fo:static-content flow-name="region-before-rest">
<fo:block>This is not the first page</fo:block>
</fo:static-content>
<fo:static-content flow-name="region-after-first">
<fo:block>This is the first page</fo:block>
</fo:static-content>
<fo:static-content flow-name="region-after-rest">
<fo:block>This is not the first page</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<!--body stuff here-->
</fo:flow>
</fo:page-sequence>
If you want the text to be based on data on the page, then you need to be
creative and use markers. If you need a snip for that, let me know.
-Lou
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LOG-NET, Inc.
The Logistics Network Management System
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
230 Half Mile Road
Third Floor
Red Bank, NJ 07701
PH: 732-758-6800
FAX: 732-747-7497
http://www.LOG-NET.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CONFIDENTIAL & PRIVILEGED
Unless otherwise indicated or if obvious from the nature of the content,
the information contained herein is privileged and confidential
information/work product. The communication is intended for the use of the
individual or entity named above. If the reader of this transmission is
not the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this communication is strictly
prohibited. If you have received this communication in error, please
notify the sender immediately by telephone (732-758-6800) or by electronic
mail (postmaster@LOG-NET.com), and destroy any copies, electronic, paper
or otherwise, which you may have of this communication. Thank you.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fahad Ansari <fa...@ansaris.us> wrote on 09/07/2006 03:04:17 PM:
> Hello all,
>
> I haven't been able to find information on this so wondering if anyone
> has achieved this before.
>
> I have a running report with one flow that requires a different header
> information on first page and rest of the page headers are same. I
> declared a simple-page-master
>
> <fo:layout-master-set>
> <fo:simple-page-master master-name="main">
> <fo:region-before region-name="header"/>
> <fo:region-body region-name="body"/>
> <fo:region-after region-name="footer" />
> </fo:simple-page-master>
> <!-- Specify the page sequence -->
> <fo:page-sequence-master master-name="master-sequence">
> <fo:repeatable-page-master-reference
> master-reference="main"/>
> </fo:page-sequence-master>
> </fo:layout-master-set>
>
> and then in the header region I tried using
>
> <xsl:choose>
> <xsl:when test="fo:page-number=1">show first page content</xsl:when>
> <xsl:otherwise>show rest of the page content</xsl:when>
> </xsl:choose>
>
> but fo:page-number is apparently empty at this point.
>
> Just need to find out what would be the best way to change the header
> from page 2 to n for a report that has dynamic page content.
>
> Thanks in advance.
>
> Fahad Ansari
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>