Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » pageNumber variable does not seem to work correctly(When an element of a report takes up more than a page, pageNumber seems incorrect)
pageNumber variable does not seem to work correctly [message #795633] Fri, 10 February 2012 18:07 Go to next message
A N is currently offline A NFriend
Messages: 15
Registered: December 2011
Junior Member
Hello,

I was attempting to implement duplex printing on a report and was using the pageNumber variable to determine whether or not a certain page number was even or odd. However, it seems when an element, such as a text label, spans for more than a page, the pageNumber variable loses track of the element it is created on.

I found an example of how to use the pageNumber variable online, and have attached the report design file. It is not my work.

I have also attached a report design that demonstrates when a very large text label is added to the report, the pageNumber variable fails to keep count correctly on this report.

Each report outputs a file to c:\temp using a Printwriter that prints out the pageNumber variable when it is called in the group footer label.

When a PDF is generated, certain countries such as Belgium are printed starting on an even page in the non working report, which is not desired.

I am not sure if I am just using the variable incorrectly or if there is an actual problem with the variable. Could someone clarify?

Thanks.
Re: pageNumber variable does not seem to work correctly [message #797616 is a reply to message #795633] Mon, 13 February 2012 17:50 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Can you try setting the page break interval for the table to 0?
Currently it is set to 40. Select the table and in the properties view
click on the Page Break item. The setting is named Page Break Interval.

Jason

On 2/10/2012 1:07 PM, A N wrote:
> Hello,
>
> I was attempting to implement duplex printing on a report and was using the pageNumber variable to determine whether or not a certain page number was even or odd. However, it seems when an element, such as a text label, spans for more than a page, the pageNumber variable loses track of the element it is created on.
>
> I found an example of how to use the pageNumber variable online, and have attached the report design file. It is not my work.
>
> I have also attached a report design that demonstrates when a very large text label is added to the report, the pageNumber variable fails to keep count correctly on this report.
>
> Each report outputs a file to c:\temp using a Printwriter that prints out the pageNumber variable when it is called in the group footer label.
>
> When a PDF is generated, certain countries such as Belgium are printed starting on an even page in the non working report, which is not desired.
>
> I am not sure if I am just using the variable incorrectly or if there is an actual problem with the variable. Could someone clarify?
>
> Thanks.
Re: pageNumber variable does not seem to work correctly [message #798395 is a reply to message #797616] Tue, 14 February 2012 16:36 Go to previous messageGo to next message
A N is currently offline A NFriend
Messages: 15
Registered: December 2011
Junior Member
Jason,

I tried what you have suggested by selecting the table and setting the page break interval to 0 in the property editor tab. The output of the pageNumber variable changed in the text output, but it is still incorrect. Specifically, the output shows that the footer is occurring on every other page now, which it should not.

For instance:

footer pageNumber: 1
footer pageNumber: 3
footer pageNumber: 5
footer pageNumber: 7
footer pageNumber: 9
Re: pageNumber variable does not seem to work correctly [message #798463 is a reply to message #798395] Tue, 14 February 2012 18:20 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Can you give me some detail on what you are trying to do and maybe I can
offer a different solution. Are you trying to alternate the page footer?

Jason

On 2/14/2012 11:36 AM, A N wrote:
> Jason,
>
> I tried what you have suggested by selecting the table and setting the
> page break interval to 0 in the property editor tab. The output of the
> pageNumber variable changed in the text output, but it is still
> incorrect. Specifically, the output shows that the footer is occurring
> on every other page now, which it should not.
>
> For instance:
>
> footer pageNumber: 1
> footer pageNumber: 3
> footer pageNumber: 5
> footer pageNumber: 7
> footer pageNumber: 9
Re: pageNumber variable does not seem to work correctly [message #798485 is a reply to message #798463] Tue, 14 February 2012 18:56 Go to previous messageGo to next message
A N is currently offline A NFriend
Messages: 15
Registered: December 2011
Junior Member
Jason,

Oh sorry, I probably did not explain the situation well. The example I showed after the "for instance" of my previous post was the output that was generated from the non working sample report, which is incorrect. The pageNumber variable should (from what I understand) be the page number where the element's onCreate method is called (in this case, the label in the footer). Based on the output, it looks like BIRT thinks the footer occurs every other page, which is not right.

The non working sample report represents a simplification of the problem. The report that I am actually working with has a few nested tables (e.g. a Work Order Report). When one of these work orders spills on to the next page (takes up more than a page), the pageNumber variable does not seem to be able to accurately determine the page number of the element that it is created on.

So in order to reproduce this problem in a more simple manner, I attached the report design with a large amount of text in the report header label to my original post, thinking that the problem is relatively similar.

Any ideas?
Re: pageNumber variable does not seem to work correctly [message #798513 is a reply to message #798485] Tue, 14 February 2012 19:36 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

When I run the report through the viewer I get the following output:

footer pageNumber: 6
footer pageNumber: 9
footer pageNumber: 14
footer pageNumber: 18
footer pageNumber: 22
footer pageNumber: 26
footer pageNumber: 35
footer pageNumber: 40
footer pageNumber: 42
footer pageNumber: 44
footer pageNumber: 49
footer pageNumber: 54
footer pageNumber: 59
footer pageNumber: 65
footer pageNumber: 70
footer pageNumber: 74
footer pageNumber: 84
footer pageNumber: 87
footer pageNumber: 92
footer pageNumber: 97
..
..

Which appears to be correct. I am re-attaching the report I ran. How
are you executing the report?

Jason

On 2/14/2012 1:56 PM, A N wrote:
> Jason,
>
> Oh sorry, I probably did not explain the situation well. The example I
> showed after the "for instance" of my previous post was the output that
> was generated from the non working sample report, which is incorrect.
> The pageNumber variable should (from what I understand) be the page
> number where the element's onCreate method is called (in this case, the
> label in the footer). Based on the output, it looks like BIRT thinks the
> footer occurs every other page, which is not right.
>
> The non working sample report represents a simplification of the
> problem. The report that I am actually working with has a few nested
> tables (e.g. a Work Order Report). When one of these work orders spills
> on to the next page (takes up more than a page), the pageNumber variable
> does not seem to be able to accurately determine the page number of the
> element that it is created on.
>
> So in order to reproduce this problem in a more simple manner, I
> attached the report design with a large amount of text in the report
> header label to my original post, thinking that the problem is
> relatively similar.
>
> Any ideas?
  • Attachment: pagevar.zip
    (Size: 4.16KB, Downloaded 330 times)
Re: pageNumber variable does not seem to work correctly [message #798517 is a reply to message #798485] Tue, 14 February 2012 19:36 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

When I run the report through the viewer I get the following output:

footer pageNumber: 6
footer pageNumber: 9
footer pageNumber: 14
footer pageNumber: 18
footer pageNumber: 22
footer pageNumber: 26
footer pageNumber: 35
footer pageNumber: 40
footer pageNumber: 42
footer pageNumber: 44
footer pageNumber: 49
footer pageNumber: 54
footer pageNumber: 59
footer pageNumber: 65
footer pageNumber: 70
footer pageNumber: 74
footer pageNumber: 84
footer pageNumber: 87
footer pageNumber: 92
footer pageNumber: 97
..
..

Which appears to be correct. I am re-attaching the report I ran. How
are you executing the report?

Jason

On 2/14/2012 1:56 PM, A N wrote:
> Jason,
>
> Oh sorry, I probably did not explain the situation well. The example I
> showed after the "for instance" of my previous post was the output that
> was generated from the non working sample report, which is incorrect.
> The pageNumber variable should (from what I understand) be the page
> number where the element's onCreate method is called (in this case, the
> label in the footer). Based on the output, it looks like BIRT thinks the
> footer occurs every other page, which is not right.
>
> The non working sample report represents a simplification of the
> problem. The report that I am actually working with has a few nested
> tables (e.g. a Work Order Report). When one of these work orders spills
> on to the next page (takes up more than a page), the pageNumber variable
> does not seem to be able to accurately determine the page number of the
> element that it is created on.
>
> So in order to reproduce this problem in a more simple manner, I
> attached the report design with a large amount of text in the report
> header label to my original post, thinking that the problem is
> relatively similar.
>
> Any ideas?
  • Attachment: pagevar.zip
    (Size: 4.16KB, Downloaded 317 times)
Re: pageNumber variable does not seem to work correctly [message #798520 is a reply to message #798485] Tue, 14 February 2012 19:36 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

When I run the report through the viewer I get the following output:

footer pageNumber: 6
footer pageNumber: 9
footer pageNumber: 14
footer pageNumber: 18
footer pageNumber: 22
footer pageNumber: 26
footer pageNumber: 35
footer pageNumber: 40
footer pageNumber: 42
footer pageNumber: 44
footer pageNumber: 49
footer pageNumber: 54
footer pageNumber: 59
footer pageNumber: 65
footer pageNumber: 70
footer pageNumber: 74
footer pageNumber: 84
footer pageNumber: 87
footer pageNumber: 92
footer pageNumber: 97
..
..

Which appears to be correct. I am re-attaching the report I ran. How
are you executing the report?

Jason

On 2/14/2012 1:56 PM, A N wrote:
> Jason,
>
> Oh sorry, I probably did not explain the situation well. The example I
> showed after the "for instance" of my previous post was the output that
> was generated from the non working sample report, which is incorrect.
> The pageNumber variable should (from what I understand) be the page
> number where the element's onCreate method is called (in this case, the
> label in the footer). Based on the output, it looks like BIRT thinks the
> footer occurs every other page, which is not right.
>
> The non working sample report represents a simplification of the
> problem. The report that I am actually working with has a few nested
> tables (e.g. a Work Order Report). When one of these work orders spills
> on to the next page (takes up more than a page), the pageNumber variable
> does not seem to be able to accurately determine the page number of the
> element that it is created on.
>
> So in order to reproduce this problem in a more simple manner, I
> attached the report design with a large amount of text in the report
> header label to my original post, thinking that the problem is
> relatively similar.
>
> Any ideas?
  • Attachment: pagevar.zip
    (Size: 4.16KB, Downloaded 367 times)
Re: pageNumber variable does not seem to work correctly [message #798527 is a reply to message #798513] Tue, 14 February 2012 19:59 Go to previous messageGo to next message
A N is currently offline A NFriend
Messages: 15
Registered: December 2011
Junior Member
I am running the report through BIRT designer 371 using the run -> view report -> as PDF option (on the top menu bar). Is that the same way you were running it?
Re: pageNumber variable does not seem to work correctly [message #798535 is a reply to message #798527] Tue, 14 February 2012 20:13 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

No, I view it in html and then export to pdf. The view as pdf uses a
runandrender task instead of a run task followed by a render task. The
runandrender task currently does not support page variables and page
scripts.

Jason

On 2/14/2012 2:59 PM, A N wrote:
> I am running the report through BIRT designer 371 using the run -> view
> report -> as PDF option (on the top menu bar). Is that the same way you
> were running it?
Re: pageNumber variable does not seem to work correctly [message #798536 is a reply to message #798535] Tue, 14 February 2012 20:14 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

BTW when I view in hmtl I use the View Report in Web Viewer option.

Jason

On 2/14/2012 3:13 PM, Jason Weathersby wrote:
> No, I view it in html and then export to pdf. The view as pdf uses a
> runandrender task instead of a run task followed by a render task. The
> runandrender task currently does not support page variables and page
> scripts.
>
> Jason
>
> On 2/14/2012 2:59 PM, A N wrote:
>> I am running the report through BIRT designer 371 using the run -> view
>> report -> as PDF option (on the top menu bar). Is that the same way you
>> were running it?
>
Re: pageNumber variable does not seem to work correctly [message #803707 is a reply to message #798536] Tue, 21 February 2012 17:29 Go to previous messageGo to next message
A N is currently offline A NFriend
Messages: 15
Registered: December 2011
Junior Member
Thanks for the reply Jason, it seems using separate run and render tasks solves the problem. Do you know if there are plans to support page number variables in a single runandrender task?
Re: pageNumber variable does not seem to work correctly [message #803907 is a reply to message #803707] Wed, 22 February 2012 00:45 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I do not think there any plans to change this currently.

Jason

On 2/21/2012 12:29 PM, A N wrote:
> Thanks for the reply Jason, it seems using separate run and render tasks
> solves the problem. Do you know if there are plans to support page
> number variables in a single runandrender task?
Re: pageNumber variable does not seem to work correctly [message #813834 is a reply to message #803907] Mon, 05 March 2012 19:16 Go to previous messageGo to next message
A N is currently offline A NFriend
Messages: 15
Registered: December 2011
Junior Member
Jason,

I am having another problem with the pageNumber issue. I have a requirement that the reports use auto layout. It seems that when I use auto layout, the pageNumber variable is off again (the text file indicates that the footer occurs every other page, which it doesn't). Is the pageNumber variable supported with auto layout?

To reproduce this problem, all you have to do is set your previous attached report (pagevar.rptdesign) to use auto layout.

Thanks.
Re: pageNumber variable does not seem to work correctly [message #813991 is a reply to message #813834] Mon, 05 March 2012 22:57 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I believe for auto layout to work with the pageNumber you have to
specify a page break interval that is never bigger than what will
actually be put on a page. If the number of rows runs over the page
length the variable will contain the wrong value.

Jason

On 3/5/2012 2:16 PM, A N wrote:
> Jason,
>
> I am having another problem with the pageNumber issue. I have a
> requirement that the reports use auto layout. It seems that when I use
> auto layout, the pageNumber variable is off again (the text file
> indicates that the footer occurs every other page, which it doesn't). Is
> the pageNumber variable supported with auto layout?
>
> To reproduce this problem, all you have to do is set your previous
> attached report (pagevar.rptdesign) to use auto layout.
>
> Thanks.
Re: pageNumber variable does not seem to work correctly [message #814696 is a reply to message #813991] Tue, 06 March 2012 19:39 Go to previous messageGo to next message
A N is currently offline A NFriend
Messages: 15
Registered: December 2011
Junior Member
Jason,

Thanks for the information. Does that imply that if the report has a significantly variable row, such as a description pulled out of a database (or, if the row takes up more than a page, like we have been dealing with) then using the pageNumber variable with auto layout will not work or have guaranteed results?

Thanks.
Re: pageNumber variable does not seem to work correctly [message #814710 is a reply to message #814696] Tue, 06 March 2012 19:52 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

That is correct.

Jason

On 3/6/2012 2:39 PM, A N wrote:
> Jason,
>
> Thanks for the information. Does that imply that if the report has a
> significantly variable row, such as a description pulled out of a
> database (or, if the row takes up more than a page, like we have been
> dealing with) then using the pageNumber variable with auto layout will
> not work or have guaranteed results?
>
> Thanks.
Re: pageNumber variable does not seem to work correctly [message #814732 is a reply to message #814710] Tue, 06 March 2012 20:35 Go to previous messageGo to next message
A N is currently offline A NFriend
Messages: 15
Registered: December 2011
Junior Member
Jason,

Do you know if there is any way around that besides using a fixed layout?

Thanks.
Re: pageNumber variable does not seem to work correctly [message #815481 is a reply to message #814732] Wed, 07 March 2012 18:16 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I do not.

Jason

On 3/6/2012 3:35 PM, A N wrote:
> Jason,
>
> Do you know if there is any way around that besides using a fixed layout?
>
> Thanks.
Previous Topic:creating one cell with dferent coluring percentage
Next Topic:localize dataset value
Goto Forum:
  


Current Time: Fri Apr 19 00:50:30 GMT 2024

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

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

Back to the top