Home
Analytics
BIRT 2.6.1 PDF Group Page Number
mzeevalk
We have requirements for a BIRT report to include a page number within a group with the page number resetting upon the group changing. Our reports are generated through BIRT runtime and always generated in PDF format. I haven't found a good way to come up with scripting to track the page number and get it working in PDF. I created scripts to track the page number on the Group row onCreate event and also tried using the onPageBreak event, but never received anything but the page number being set to 1 for all pages. Looking in this forum there appears to be issues with tracking page number when generating PDF reports. My questions are:
- Does someone have a workaround so that the page number can be included within the group table and reset upon the group changing when generating the report as PDF?
- If there is not a way to do this at the group level, is there a way the page number can be included on the master page header and reset when the group changes when generating the report as PDF?
- Do newer versions of BIRT support group page number tracking? If so, what version should we upgrade to?
Again, we are running BIRT 2.6.1. Thanks in advance for any helpful guidance.
Find more posts tagged with
Comments
mwilliams
If you set a page break interval that will fit on the page of a PDF page, the page numbering in PDF should be correct. If you upgrade to 3.7, the natural page breaks are recognized, so you could put a page break interval of 0 with a fixed layout and the end of page scripts will call at the end of each PDF page. As far as group page numbering, you'll have to compute this yourself. So far, there is not a group page numbering feature. This post in the devShare might help you with numbering groups though:
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1404-group-page-numbering/
mzeevalk
Michael,
The solution on devShare for group page numbering does not work when generating directly to PDF which is what we are required to do. I have a solution (a slightly different approach) that works when generating through the report viewer, but still does not work when generating to PDF. Is there an example on how to handle group page numbering when generating PDF reports?
Thanks...
mwilliams
As long as you use the run and render tasks separately, it should work. If you're calling your reports with URL, you should be able to use the format=pdf url parameter.
rdpeterson
<p>I downloaded the group page numbering solution and renamed the file. I ran the sample report to the Web Viewer in BIRT, then exported it as a PDF as the best known emulation of the report generation and output process in Maximo 7.5x. The solution mostly works, but note the error on page 19 of the PDF output file for page numbers. Page number there should be "2 of 2" as it's the second of two pages for Country Spain. Any idea how to correct this? Please see attached RPTDESIGN and PDF output files.</p>
roger1234
<p>Hi rdpeterson,</p><p>the isNaN is a divide by zero error. Not sure why you are getting it. If you use the isNaN check on the page numbering it should go away. Thanks.</p>