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 |
A N 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 |
|
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 #798463 is a reply to message #798395] |
Tue, 14 February 2012 18:20 |
|
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 |
A N 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 |
|
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 331 times)
|
|
|
Re: pageNumber variable does not seem to work correctly [message #798517 is a reply to message #798485] |
Tue, 14 February 2012 19:36 |
|
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 321 times)
|
|
|
Re: pageNumber variable does not seem to work correctly [message #798520 is a reply to message #798485] |
Tue, 14 February 2012 19:36 |
|
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 369 times)
|
|
| |
Re: pageNumber variable does not seem to work correctly [message #798535 is a reply to message #798527] |
Tue, 14 February 2012 20:13 |
|
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 |
|
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 #813991 is a reply to message #813834] |
Mon, 05 March 2012 22:57 |
|
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 #814710 is a reply to message #814696] |
Tue, 06 March 2012 19:52 |
|
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.
|
|
| | |
Goto Forum:
Current Time: Sat May 04 09:26:47 GMT 2024
Powered by FUDForum. Page generated in 0.05315 seconds
|