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 13:07  |
Eclipse User |
|
|
|
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 12:50   |
Eclipse User |
|
|
|
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 #798485 is a reply to message #798463] |
Tue, 14 February 2012 13:56   |
Eclipse User |
|
|
|
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 14:36   |
Eclipse User |
|
|
|
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 398 times)
|
|
|
Re: pageNumber variable does not seem to work correctly [message #798517 is a reply to message #798485] |
Tue, 14 February 2012 14:36   |
Eclipse User |
|
|
|
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 393 times)
|
|
|
Re: pageNumber variable does not seem to work correctly [message #798520 is a reply to message #798485] |
Tue, 14 February 2012 14:36   |
Eclipse User |
|
|
|
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 424 times)
|
|
| | | | | | | | | | | |
Goto Forum:
Current Time: Sun Jul 06 23:21:10 EDT 2025
Powered by FUDForum. Page generated in 0.27523 seconds
|