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)
Table Data in Page Header
phancox
I'm relatively new to BIRT and trying to convert a bunch of Crystal reports.<br />
<br />
Issue that I'm currently struggling with is how to use table data in a page header. I've trolled through the forums for examples and have most of this working by setting a variable in the "onCreate" for the table row, then setting a page variable in the "onPageBreak" for the table.<br />
<br />
<span class='bbc_underline'><strong class='bbc'>onPageBreak:</strong></span><br />
<pre class='_prettyXprint _lang-auto _linenums:0'>reportContext.setPageVariable("COMPETITION_CODE",CompetitionCode);
reportContext.setPageVariable("DIVISION_CODE",DivisionCode);
reportContext.setPageVariable("POOL_CODE",PoolCode);</pre>
<br />
<span class='bbc_underline'><strong class='bbc'>onCreate:</strong></span><br />
<pre class='_prettyXprint _lang-auto _linenums:0'>CompetitionCode = this.getRowData().getColumnValue("COMPETITION__CODE");
DivisionCode = this.getRowData().getColumnValue("DIVISION__CODE");
PoolCode = this.getRowData().getColumnValue("POOL__CODE");</pre>
<br />
What I can't get working is that the header displays the data associated with the last row on the preceding page rather than the first row on the current page.<br />
<br />
Not sure whether it makes a difference but reports are being produced as PDF via a Java desktop application rather than the report viewer.<br />
<br />
Can anyone provide suggestions as to how this should be done or point me to some examples?<br />
<br />
THANKS
Find more posts tagged with
Comments
mwilliams
Have you tried setting the value in the onPageStart event instead of the onPageBreak. If you set it in onPageBreak, I would think it should definitely be from the previous page. Let me know.
phancox
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="75048" data-time="1301088074" data-date="25 March 2011 - 02:21 PM"><p>
Have you tried setting the value in the onPageStart event instead of the onPageBreak. If you set it in onPageBreak, I would think it should definitely be from the previous page. Let me know.<br /></p></blockquote>
Moving the code from the Table onPageBreak event to the MasterPage onPageStart event makes no difference.<br />
<br />
I have changed my approach to use a group header to achieve the desired result. Perhaps in this particular case it is the "better" option any way. However, I think it will be quite a severe limitation if information rendered in a MasterPage header cannot utilise data from the page itself. Is this limitation perhaps due to using RunAndRenderTask rather than running and rendering as separate tasks?
mwilliams
What is your BIRT version?
phancox
Running latest version (2.6.2)
mwilliams
This report is close. Have a small issue with the first row of the next page being available early, pushing the "first" value of the page down to the second line after the first page and the "last" value is the first value on the next page until the last page. Might just be missing something simple since I just threw it together quickly, but with a little work, it can probably be done. I'm just missing something simple, I'm sure.
phancox
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="75175" data-time="1301414353" data-date="29 March 2011 - 08:59 AM"><p>
This report is close. Have a small issue with the first row of the next page being available early, pushing the "first" value of the page down to the second line after the first page and the "last" value is the first value on the next page until the last page. Might just be missing something simple since I just threw it together quickly, but with a little work, it can probably be done. I'm just missing something simple, I'm sure.
<br /></p></blockquote>
This is basically the issue I've been having all along.<br />
<br />
I've fiddled with the report and resolved issues with the page footer data being incorrect by keeping a "rolling" record of data (e.g., previous=current;current=row["CREDITLIMIT"]) in the "onCreate" though first and last pages seem to behave slightly differently from the other pages. Given the page header data is "one too far", then that issue can probably be solved the same way.<br />
<br />
That said, although the issues are probably solvable, the solution is overly complex and seems fragile. I'm trying to come up with a reasonably generic solution that can be predominantly packaged in a library. For the moment I'm going to stick with group headers instead of page headers to achieve the desired result.<br />
<br />
Really appreciate your efforts in helping me out.
mwilliams
Can you please log a bug for this at
http://www.birt-exchange.org/org/resources/bug-reporting/
and include the bug information in this thread for future reference? Thanks!
phancox
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="75420" data-time="1301933369" data-date="04 April 2011 - 09:09 AM"><p>
Can you 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>
; and include the bug information in this thread for future reference? Thanks!
<br /></p></blockquote>
Created Bug 341855 in Eclipse Bugzilla <a class='bbc_url' href='
https://bugs.eclipse.org/bugs/show_bug.cgi?id=341855'>https://bugs.eclipse.org/bugs/show_bug.cgi?id=341855</a>
;
mwilliams
Thanks for the update!