Home
Analytics
Displaying/Hiding Masterpage/Header/Footer on different pages
Mr.Reed
Hi there,<br />
<br />
seems like this problem is often discussed, so here is my problem (with Birt 2.6.1, rendering report as pdf):<br />
<br />
I have placed several grids one after another.<br />
I want the grids (and so the information in it) to be displayed continuous (without any page breaks). The first two grids are always displayed. All other grids are bound to conditions, wether to display or not.<br />
Furthermore I would like to place a header on each page. Besides that header i would like to place a header on top of the just mentioned header - but only on the first page (see attached pdf). <br />
<br />
What i have tried so far:<br />
Using a table instead. In the detail row i place the grids. The table is set with the masterpage (which includes both header). The header to be displayed only on page 1 is set to hide, when on pageEnd of the Masterpage is set some variable. <br />
So on "onPageEnd" of the masterpage i set:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>reportContext.setGlobalVariable("someVariable", 1)</pre>
<br />
On the header to be displayed on page 1 (which is a grid in a grid) I set on "onRender":<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>if (1==parseInt(reportContext.getGlobalVariable("someVariable"))) {
this.getStyle().display="none";
}</pre>
<br />
But it seems like this is not working.<br />
<br />
By the way: what is the difference between reportContext.setGlobalVariable and reportContext.setPageVariable? where should these calls to be used?<br />
<br />
Can someone help me with that or give me some hints what i could do?<br />
<br />
Thanks in advance...
Find more posts tagged with
Comments
mwilliams
Why not just use pageNumber?
mwilliams
Page Variables/Report Variables can be added in your data explorer. They can be recalled in the "Variable" auto-text on the masterpage. They were added in BIRT 2.5.
Mr.Reed
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="76323" data-time="1303924146" data-date="27 April 2011 - 10:09 AM"><p>
Why not just use pageNumber?<br /></p></blockquote>
<br />
Hi Michael,<br />
<br />
thanks for the reply.<br />
<br />
It seems like pageNumber always returns 1. Isn't it suppose to give me the current page which i am on?
mwilliams
Before 2.6.2, there was an issue with the end of page script methods being called in PDF if a page break was not forced. Meaning, if you didn't hit the page break interval of a table or if you didn't set a page break after a specific element, the page number didn't get incremented. If you run the same report in the web viewer, it worked as expected. So, for it to work, you'd have to be sure that you are forcing the page breaks as the end of page events are not called correctly in natural page breaks in PDF until 2.6.2.
Mr.Reed
That means i have problem at this point
since I don't want to force page breaks. Or what would be the way of forcing a page break without messing up the flow of the text which i would like to have without defined cuts?<br />
<br />
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="76336" data-time="1303929714" data-date="27 April 2011 - 11:41 AM"><p>
Before 2.6.2, there was an issue with the end of page script methods being called in PDF if a page break was not forced. Meaning, if you didn't hit the page break interval of a table or if you didn't set a page break after a specific element, the page number didn't get incremented. If you run the same report in the web viewer, it worked as expected. So, for it to work, you'd have to be sure that you are forcing the page breaks as the end of page events are not called correctly in natural page breaks in PDF until 2.6.2.<br /></p></blockquote>
mwilliams
Can you upgrade from 2.6.1 to 2.6.2? You might download 2.6.2, try it out and see if it fixes your issue and then decide from there.
Mr.Reed
Guess that will be the only way, if I can't find another way.<br />
Thanks again for your help.<br />
<br />
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="76345" data-time="1303937146" data-date="27 April 2011 - 01:45 PM"><p>
Can you upgrade from 2.6.1 to 2.6.2? You might download 2.6.2, try it out and see if it fixes your issue and then decide from there.<br /></p></blockquote>
mwilliams
Yeah, with the end of page events not firing in PDF when a "natural" page break occurs in 2.6.1, it makes what you're trying to do very difficult.