Question
· Jul 20, 2021

Zen Report page number variable

I have a report that requires a different header block for the first page and another for subsequent pages.

Is there a way to direct a header page to another header page  based on what the current page number is?

Product version: Caché 2018.1
Discussion (5)2
Log in or sign up to continue

There are two ways to use <pagemaster> and <masterreference> - (1) such that it encompasses your entire report or (2) the page details get reset for each entry in a group.

1. Have page 1 have one header/footer, and the rest of the report a different one

<report  define report details >

<pagemaster >
<masterreference masterReference="first" pagePosition="first">

<document  define document details> add styles</document>

<pageheader> define pageheader </pageheader>

<pagefooter> define pagefooter</pagefooter>
</
masterreference>

<masterreference masterReference="rest" pagePosition="rest">

<document  define document details> add styles</document>

<pageheader> define pageheader </pageheader>

<pagefooter> define pagefooter</pagefooter>
</
masterreference></
pagemaster><body report body here>
 

2. For each group in my xml have a specific first page, and then the rest all be something else

In my XML definition I have a group Sales and inside that group I have another group called SalesRep - the SalesReps are uniquely identified via an attribute I have defined as name

<report  define report details >

<section name="report name here" sectionName="Sales" primaryGroup="Sales/SalesRep">

<pagemaster >
<masterreference masterReference="first" pagePosition="first">

<document  define document details> add styles</document>

<pageheader> define pageheader </pageheader>

<pagefooter> define pagefooter</pagefooter>
</
masterreference>

<masterreference masterReference="rest" pagePosition="rest">

<document  define document details> add styles</document>

<pageheader> define pageheader </pageheader>

<pagefooter> define pagefooter</pagefooter>
</masterreference>

</pagemaster>
<body genLastPageIdOn="@name">

<group name="Sales/SalesRep" primaryGroup="true">

Report details here

</group>
</body>
</section>

Hope this helps.