Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Hiding some part of the report header on specific pages
Megha Nidhi Dahal
Hi,
Got stuck with this thing.
I have a report which breaks automatically to multiple pages. There are many information on the report header. I'm trying to show certain information from the master page header only on the first page and others on the following pages.
I have tried using pageNumber, but doesn't help much. I tried playing around with report/page variables and VARIABLE auto text, but couldn't acheive the intended result.
Please suggest some approach. It could be possible that I'm not using these variables properly.
regards
Arpan
Find more posts tagged with
Comments
mwilliams
Hi Arpan,
What is your BIRT version? Have you tried the following in the onRender of the element you want on all but the first page?
if (pageNumber == 1){
this.getStyle().display = "none";
}
Megha Nidhi Dahal
Hi Michael,<br />
<br />
I've tried this on 2.5.2 and 2.6.2 but couldn't reach anywhere. The above option i.e. using <strong class='bbc'>pageNumber</strong> works only if BIRT explicitly knows that there is a page break to happen. If you break a page intentionally, either by limiting the max rows in a page(page break interval) or by using explicit break requests, this option works very well.<br />
But, if the data is spanning more than a single page and an implicit page break happens, the pageNumber is still set to 1.<br />
<br />
Attached is a sample designer that I'm trying to achieve this with. Please suggest anything I should do.<br />
<br />
Arpan
mwilliams
This is very weird. This was supposed to be fixed in 2.6.2, and I swear that I've seen it work correctly, but it doesn't seem to be doing that for me now. I even created a new report with a single table not inside a grid and it still doesn't work. It works for the web viewer output, but not when exported to PDF, no matter what I try. Not even setting the page number in the design in a variable. Please log a bug for this at
http://www.birt-exchange.org/org/resources/bug-reporting/
.
Megha Nidhi Dahal
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="77565" data-time="1306355782" data-date="25 May 2011 - 01:36 PM"><p>
Please log a bug for this at <a class='bbc_url' href='
http://www.birt-exchange.org/org/resources/bug-reporting/.'>http://www.birt-exchange.org/org/resources/bug-reporting/.</a><br
/></p></blockquote>
Michael,<br />
<br />
I have raised a bug in bugzilla. Please verify that the description is correct.<br />
<a class='bbc_url' href='
https://bugs.eclipse.org/bugs/show_bug.cgi?id=347251'>https://bugs.eclipse.org/bugs/show_bug.cgi?id=347251</a><br
/>
<br />
Arpan
mwilliams
Arpan,
One way that you can make it work in either version you're using is to store the header value in a "page variable" in the onPageStart event. Setting the value the first time and then to "" after that. Then use the variables auto text in the masterpage to display the value. The other is still a bug in my opinion though.
P.S. - Your bug report sounds about right!
Megha Nidhi Dahal
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="77613" data-time="1306417326" data-date="26 May 2011 - 06:42 AM"><p>
Arpan,<br />
<br />
One way that you can make it work in either version you're using is to store the header value in a "page variable" in the onPageStart event. Setting the value the first time and then to "" after that. Then use the variables auto text in the masterpage to display the value.<br /></p></blockquote>
Michael,<br />
<br />
I tried this way round also, but somehow I was unable to find what I was looking for. These methods are invoked only once. Since BIRT doesn't know that there's a page break, it is not invoking these methods for the second time.<br />
I might have missed out something. If you can help me out with a sample, it would be very helpful.<br />
<br />
Arpan
mwilliams
You may have to use 2.6.2 for this one to work right. I can post a sample if needed.