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)
Page number autotext issue in BIRT 2.6.0
szopkoa
Hi there,
I got a problem regarding page numbers. We use PDF format.
We have been using library elements for generating reports:
There are simple "[page number] / [total page count]" autotext elements in the footer of the master page.
All the reports consist of a cover page. We do not need headers/footers there, so it uses a separate master page.
Then comes a grid with parameters, using the "regular" master page with the page number in the footer. We need this grid to be separated from the actual data, so its page break after property is "always".
Then there is a table, containing the data, which can be over 100 pages. This one uses the "regular" master page as well.
All the reports referencing the two master pages from the library.
All of that worked fine with version 2.5.x, until we upgraded to 2.6.0 from 2.5.2.
After that, the page number stops counting at 3, and it shows 3 until the last page. The strange thing is, that running from the designer it is OK.
The difference between running from the designer and on the app server, is that on the app server we use the run and render tasks separately (to be able to keep the .rptdocument file), and - as I know - the designer uses it at once.
It makes no difference if the table's page break inside property is set to "avoid" or "auto". I also tried to set te page break interval to zero - still no luck.
My guess is, that somehow a page break event is not passed when presenting the table data.
Would be appreciate if someone could help me,
Thanks a lot,
Andras
Find more posts tagged with
Comments
mwilliams
Hi Andras,
What was your page break interval originally set at? And how many lines show up per page?
szopkoa
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="68628" data-time="1285096939" data-date="21 September 2010 - 12:22 PM"><p>
Hi Andras,<br />
<br />
What was your page break interval originally set at? And how many lines show up per page?<br /></p></blockquote>
<br />
Hi Michael,<br />
<br />
thanks for your reply. The page break interval was left untouched, the default value was 40. Around 23 rows shows up per page - but all the pages are filled nicely.<br />
<br />
The page number is "3" from the third page onwards, even on the last page of a 174. page output.<br />
<br />
Regards,<br />
Andras
mwilliams
Andras,
Sounds like the page break interval count is resetting when there is an actual break, so that you don't end up with a half page of data on every other page since you don't reach 40. Since this happens, you're getting to 3 because of your report setup with 3 tables causing page breaks, but the page break event may not be getting called during the count reset, which would be a bug if that's the case. Do me a favor and try putting like 20 as your page break interval. I'm guessing it will count the pages correctly then, if my idea is right.. But that's just a guess. Let me know.
szopkoa
Hello Michael,
your guess was right. I put 20 in the page break interval, and the page number is incremented. But it is not right though, since we have groups on the table, so when a footer comes in (which can occupy nearly half of a page here due to summaries) the page number is the same on the next page as well. After that it is calculated correctly (right until the next footer).
Should I file it as a bug in bugzilla?
Cheers,
Andras
mwilliams
Andras,
Definitely file a bug for this in the bugzilla. I would guess they're already working on this issue for the next release, but it never hurts to file it. They'll reference the original bug in your report if it's been reported already.
mwilliams
Andras,
If you reported a bug for this, could you post the bug info in here for future reference? Thanks!
szopkoa
Hello Michael,
sorry, I was away from work in the last couple of days. I found a bug describing the same problem:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=326513
I made a comment, even put the link of this thread.
mwilliams
Great! Thanks for the update!
Farrah
<blockquote class='ipsBlockquote' data-author="'szopkoa'" data-cid="69222" data-time="1286804485" data-date="11 October 2010 - 06:41 AM"><p>
Hello Michael,<br />
<br />
sorry, I was away from work in the last couple of days. I found a bug describing the same problem: <a class='bbc_url' href='
https://bugs.eclipse.org/bugs/show_bug.cgi?id=326513'>https://bugs.eclipse.org/bugs/show_bug.cgi?id=326513</a>
; <br />
<br />
I made a comment, even put the link of this thread.<br /></p></blockquote>
<br />
Have you tried to set the page layout = fixed layout + page break interval = 0?<br />
In this way, PDF and HTMl has the same pagination, and each PDF page will have as much contents as it can.<br />
The page number should be correct in this setting.
mwilliams
Hi Farrah,
Is this with 2.6.0 and in the deployed viewer that this works for you?
Farrah
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="69270" data-time="1286912816" data-date="12 October 2010 - 12:46 PM"><p>
Hi Farrah,<br />
<br />
Is this with 2.6.0 and in the deployed viewer that this works for you?<br /></p></blockquote>
<br />
Yes, this works with 2.6.0 release. Both the designer and deployed web viewer.
zsalab
<blockquote class='ipsBlockquote' data-author="'Farrah'" data-cid="69348" data-time="1287038657" data-date="13 October 2010 - 11:44 PM"><p>
Yes, this works with 2.6.0 release. Both the designer and deployed web viewer.<br /></p></blockquote>
<br />
No, it's not work properly if the main table has gouping with page break after first group. The next page get some page number if the group is overflow on the page.<br />
<br />
Forexample:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
Customer PsyhicalPage PageNumberOnPage
1 1 1
2 2 2
2 3 2
3 4 3
.........
</pre>
zsalab
<blockquote class='ipsBlockquote' data-author="'zsalab'" data-cid="69419" data-time="1287137130" data-date="15 October 2010 - 03:05 AM"><p>
No, it's not work properly if the main table has gouping with page break after first group. The next page get some page number if the group is overflow on the page.<br />
<br />
Forexample:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
Customer PsyhicalPage PageNumberOnPage
1 1 1
2 2 2
2 3 2
3 4 3
.........
</pre></p></blockquote>
<br />
I found an interesting workaround:<br />
Put a fake, but valid javascript expression to the onRender event for the "Page Number" autotext ( forexample: fakeValue++; ) and the page numbering is working fine.
mwilliams
Hi zsalab,
If it was not working correctly and what you changed to make it work was to put the fake script in, please log a bug for this
http://www.birt-exchange.org/org/resources/bug-reporting/
. Be sure to let them know about the weird workaround. Thanks!
shahamar
Is there any solution other than using Fixed Layout. Setting Fixed Layout affects the other part of report like row data overlapp to each other or column data overlapping specifically when using width or height in %. Did any one reached to the root of this solution as why is it happening? We are looking for some neater solution to this problem.
mwilliams
Can you put in a page break interval on your table for the amount of rows that will fit on a table? This will force the onPageBreak to be called, which should increment the page number.
mwilliams
Also, can someone who has this issue recreate it with the sample database and post the report in here?
shahamar
Williams,
We have Sample Report Attached to bugzilla on the same bug.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=326513
( Attachment:
https://bugs.eclipse.org/bugs/attachment.cgi?id=180822)
Setting a page break interval on table is one of the option, but not preferred for few reason
1. All rows are not to be of consistent height, let say if data is large it gets wrapped. In such scenario less records will be accomodated in a page. Also, let say if it is set to 20 and if 20th record is on half way of page, it will add page break leaving blank space on the page.
2. We have arround 60-70 reports which we would have to manually modify just for this defect.
3. This settings was working fine with Birt 2.3 version.
I was going through Source code in detail for this issues and found that, in BIRT2.6 EngineTask, createReportLayoutEngine>>LayoutEngineFactory.createReportLayoutEngine() : This method uses hardcoded HTMLReportLayoutEngine. I couldn't figured out exact reason for why it is done. But I feel core issues lies because of use of HTMLReportLayoutEngine.
public static IReportLayoutEngine createLayoutEngine( String paginationType )
{
/*if ( ExtensionManager.PAPER_SIZE_PAGINATION.equals( paginationType ) )
{
try
{
Class clazz = Class
.forName( "org.eclipse.birt.report.engine.layout.pdf.PDFReportLayoutEngine" ); //$NON-NLS-1$
Object engine = clazz.newInstance( );
return (IReportLayoutEngine) engine;
}
catch ( Exception ex )
{
}
return null;
}*/
return new HTMLReportLayoutEngine( );
}
mwilliams
shahamar,
Yeah, I knew that would be a limit to the fixed page break interval. It just seems the only way to do it with the current issue, short of changing the source code or evaluating every row of your table, estimating how much space it will take up, and inserting manual page breaks when you've reached your estimated page limit. From the sounds of it, changing reports from auto to fixed layout runs into many problems as well. So, the possible solutions are all kinda messy it seems.
shahamar
mwilliams,
Thanks for your help.
we tried setting one of the option RESERVE_DOCUMENT_PAGE_NUMBER=false in the PDFRenderOPtion and we could see multiple page number created for single long page as expected. But only problem with this issues is Total Page Number is not getting updated.
so it looks like below for 2 page HTML report
1..2
2..2
3..2
....
20..2
If we can have solution to this problem then I think we are still good to go. If you or some one from BIRT team could help in this issues it would be great.
Thanks
Amar
mk2337
Amar,
Were you able to find a way to set RESERVE_DOCUMENT_PAGE_NUMBER=false when rendering the report in the BIRT Viewer?
Thanks,
Brad
mwilliams
Amar,
I would log a bug for the total page issue. There is probably a problem of availability of the total page value. It's not grabbing the total that is forced by the page size in PDF, it's grabbing the total of the number of page breaks you manually put in. If you were to put in another element in your design and put a forced page break after the element, the total pages would probably be 3. That's just a guess though.