Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Problem with the total page-function(Total page count unreliable)
Problem with the total page-function [message #677045] Tue, 07 June 2011 12:02 Go to next message
aca Missing name is currently offline aca Missing nameFriend
Messages: 35
Registered: March 2011
Member
Hi,
I'm using BIRT 2.6.2 and have a problem with the total page count. Sometimes it shows the correct number, that is the actual number of pages the end report consists of, and sometimes it shows a higher number.
Example:
The end report (pdf): 7 pages
In the header of each page:
1(9)
2(9)
etc. up to
7(9)

Is there any way around this problem? I've read a rumour of a similar bug that should be solved in the upcoming new release of BIRT, but unfortunately I need to solve this in version 2.6.2.

Background:
The last months I've been working on upgrading BIRT to 2.6.2 and one of the changes I've made is switching from RunAndRenderMethod to using RunMethod and RenderMethod separately. This to enable the use of the page count method and adding an empty page when needed.

Re: Problem with the total page-function [message #677197 is a reply to message #677045] Tue, 07 June 2011 18:07 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Can you reproduce the issue with the sample db and post the report?

Jason

On 6/7/2011 8:02 AM, aca wrote:
> Hi,
> I'm using BIRT 2.6.2 and have a problem with the total page count.
> Sometimes it shows the correct number, that is the actual number of
> pages the end report consists of, and sometimes it shows a higher number.
> Example:
> The end report (pdf): 7 pages
> In the header of each page: 1(9)
> 2(9)
> etc. up to
> 7(9)
>
> Is there any way around this problem? I've read a rumour of a similar
> bug that should be solved in the upcoming new release of BIRT, but
> unfortunately I need to solve this in version 2.6.2.
>
> Background:
> The last months I've been working on upgrading BIRT to 2.6.2 and one of
> the changes I've made is switching from RunAndRenderMethod to using
> RunMethod and RenderMethod separately. This to enable the use of the
> page count method and adding an empty page when needed.
>
Re: Problem with the total page-function [message #683799 is a reply to message #677197] Tue, 14 June 2011 12:53 Go to previous messageGo to next message
aca Missing name is currently offline aca Missing nameFriend
Messages: 35
Registered: March 2011
Member
I sent an example report last wednesday by email and I am now wondering if there is any news on this subject?
Re: Problem with the total page-function [message #683841 is a reply to message #683799] Tue, 14 June 2011 13:50 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Sorry for the delay. I did not see it when it came in. I just
responded to your email. I think the issue is that the total page
variable is getting clipped.

Jason

On 6/14/2011 8:53 AM, aca wrote:
> I sent an example report last wednesday by email and I am now wondering
> if there is any news on this subject?
Re: Problem with the total page-function [message #683854 is a reply to message #683841] Tue, 14 June 2011 14:12 Go to previous messageGo to next message
aca Missing name is currently offline aca Missing nameFriend
Messages: 35
Registered: March 2011
Member
Ah, I see. That means I didn't succeed in reproducing the problem in the report connected to the sample db. The problem still exists in the original report so I will try to reproduce it in another way.
Re: Problem with the total page-function [message #692916 is a reply to message #683854] Tue, 05 July 2011 13:23 Go to previous messageGo to next message
aca Missing name is currently offline aca Missing nameFriend
Messages: 35
Registered: March 2011
Member
Unfortunately I have still not been able to reproduce the total page number problem when I read data from the database.
I have found something else that affects this problem. Some of the report items uses Page Break = avoid. I noticed that the report had avoid on several layers within one list.
For example: A list containing a grid containing rows, and Page Break = avoid is set on all 3 layers.
When I change all the "avoid" to "auto" the total page number is correct!

Question 1. Is there any known problems with the page break property?
Question 2. What's the recommended way of using the avoid value? On top-level only?
Re: Problem with the total page-function [message #693037 is a reply to message #692916] Tue, 05 July 2011 16:33 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

This sounds like a bug. Can you open a bugzilla entry for it?

Jason

On 7/5/2011 9:23 AM, aca wrote:
> Unfortunately I have still not been able to reproduce the total page
> number problem when I read data from the database.
> I have found something else that affects this problem. Some of the
> report items uses Page Break = avoid. I noticed that the report had
> avoid on several layers within one list. For example: A list containing
> a grid containing rows, and Page Break = avoid is set on all 3 layers.
> When I change all the "avoid" to "auto" the total page number is correct!
> Question 1. Is there any known problems with the page break property?
> Question 2. What's the recommended way of using the avoid value? On
> top-level only?
Re: Problem with the total page-function [message #694076 is a reply to message #693037] Thu, 07 July 2011 18:53 Go to previous messageGo to next message
aca Missing name is currently offline aca Missing nameFriend
Messages: 35
Registered: March 2011
Member
Hi again!
Now I know exactly what the problem is! Under the Visibility property I select the Hide element and state an expression, then the page total is wrong in the end pdf report. I include an example report connected to the sample db and that shows the problem.

My question then becomes: What is the solution to this?

Regards
Aca

ps. As you will see i the example report this has nothing to do with page break and avoid property which I thought before. I have not entered a bugzilla entry.

[Updated on: Thu, 07 July 2011 18:57]

Report message to a moderator

Re: Problem with the total page-function [message #694279 is a reply to message #694076] Fri, 08 July 2011 09:08 Go to previous messageGo to next message
aca Missing name is currently offline aca Missing nameFriend
Messages: 35
Registered: March 2011
Member
Additional information:
It might be interesting to know that the page total shown on the pdf IS correct if I use the RunAndRenderTask in the engine.
When using RunTask and RenderTask separately the page total is incorrect due to the visibility problem. I was earlier informed of the getpageCount() (from IReportDocument) which can only be used together with RunTask and RenderTask, and that function displays the same erroneous total as is shown on the pdf report.
(This is in BIRT 3.6.2)

[Updated on: Fri, 08 July 2011 09:14]

Report message to a moderator

Re: Problem with the total page-function [message #694424 is a reply to message #694279] Fri, 08 July 2011 14:41 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Can you add your comments to this bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=331541

I think this is a problem with fixed layout. All output formats have
the same number of pages when using a run task and then a render task.
You can switch to auto layout but this is probably not what you want.

Jason

On 7/8/2011 5:08 AM, aca wrote:
> It might be interesting to know that the page total shown on the pdf IS
> correct if I use the RunAndRenderTask in the engine. When using RunTask
> and RenderTask separately the page total is incorrect due to the
> visibility problem. (This is in BIRT 3.6.2)
Re: Problem with the total page-function [message #697018 is a reply to message #694424] Fri, 15 July 2011 10:34 Go to previous messageGo to next message
aca Missing name is currently offline aca Missing nameFriend
Messages: 35
Registered: March 2011
Member
Comments added to the bug you mentioned.
Thanks for all your help!

Smile
Re: Problem with the total page-function [message #704180 is a reply to message #697018] Thu, 28 July 2011 11:05 Go to previous messageGo to next message
aszopko  is currently offline aszopko Friend
Messages: 1
Registered: July 2011
Junior Member
Hi there,

we have the same exact problem in BIRT 2.6.2

As I understood from the bug no. 331541 (comment 12), this is a design problem in BIRT.

Did you find a workaround for this?
Re: Problem with the total page-function [message #704345 is a reply to message #704180] Thu, 28 July 2011 14:04 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I do not know of a work around to this problem (with the exception of
writing two reports), but please add your comments to the bug.

Jason

On 7/28/2011 7:05 AM, aszopko wrote:
> Hi there,
>
> we have the same exact problem in BIRT 2.6.2
>
> As I understood from the bug no. 331541 (comment 12), this is a design
> problem in BIRT.
>
> Did you find a workaround for this?
Re: Problem with the total page-function [message #715687 is a reply to message #704345] Mon, 15 August 2011 08:03 Go to previous messageGo to next message
aca Missing name is currently offline aca Missing nameFriend
Messages: 35
Registered: March 2011
Member
Hi,
I have actually found a work around, but it is not connected to BIRT. As my end result always is a pdf-report I use the getNumberOfPages on pdfReader instead. That way I can render the report with RunAndRender in BIRT which gives a correct pagenumber in the header. After the rendering I can count the actual number of pages with pdfReader and insert empty pages when needed.

As this is a work around in pdfReader I have not added this to the bug. Let me know if I should add it anyway.

Aca
Re: Problem with the total page-function [message #715820 is a reply to message #715687] Mon, 15 August 2011 16:49 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I would like to see this as a dev share item in BIRT-Exchange.org, if
you have the time. Then you could update the bug to point to the item
to show how you worked around the issue.

Jason

On 8/15/2011 4:03 AM, aca wrote:
> Hi, I have actually found a work around, but it is not connected to
> BIRT. As my end result always is a pdf-report I use the getNumberOfPages
> on pdfReader instead. That way I can render the report with RunAndRender
> in BIRT which gives a correct pagenumber in the header. After the
> rendering I can count the actual number of pages with pdfReader and
> insert empty pages when needed.
> As this is a work around in pdfReader I have not added this to the bug.
> Let me know if I should add it anyway.
>
> Aca
Re: Problem with the total page-function [message #716123 is a reply to message #715820] Tue, 16 August 2011 13:48 Go to previous messageGo to next message
aca Missing name is currently offline aca Missing nameFriend
Messages: 35
Registered: March 2011
Member
I'm sorry but I don't know what a dev share item is.

The steps I have added in the ReportEngineService are the following...

1. Create the report with createRunAndRenderTask(report) which results in a byteArrayOutPutStream. (This is standard code, but I include this step as a background for the following steps)
2. Convert the byteArrayOutPutStream into an byteArrayInputStream and create a pdfReader object.
PdfReader reader = new PdfReader(new ByteArrayInputStream(baos.toByteArray());
3. Get number of pages from the reader and use it
int pageCount = reader.getNumberOfPages();
if(pageCount%2>0){ //add an empty page }

[Updated on: Tue, 16 August 2011 13:49]

Report message to a moderator

Re: Problem with the total page-function [message #716228 is a reply to message #716123] Tue, 16 August 2011 17:44 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Thanks. A devshare item is just an example that is posted on
birt-exchange.org's dev share. If you look here:
http://www.birt-exchange.org/org/devshare/

You will see a lot of BIRT examples (Reports, articles, example APIs, etc)

Jason

On 8/16/2011 9:48 AM, aca wrote:
> I'm sorry but I don't know what a dev share item is.
> The steps I have added in the ReportEngineService are the following...
>
> 1. Create the report with createRunAndRenderTask(report) which results
> in a byteArrayOutPutStream. (This is standard code, but I include this
> step as a background for the following steps)
> 2. Convert the byteArrayOutPutStream into an byteArrayInputStream and
> create a pdfReader object.
> PdfReader reader = new PdfReader(new
> ByteArrayInputStream(baos.toByteArray());
> 3. Get number of pages from the reader int pageCount =
> reader.getNumberOfPages();
> if(pageCount%2>0){ //add an empty page }
Previous Topic:Birt 2.2 on JBoss 6
Next Topic:Aggregating data from two different data sets
Goto Forum:
  


Current Time: Fri Mar 29 09:46:28 GMT 2024

Powered by FUDForum. Page generated in 0.04114 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top