Bug 205386 - [Improve Page Break Management] totalPage always gives 0
Summary: [Improve Page Break Management] totalPage always gives 0
Status: REOPENED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.1.1   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: Future   Edit
Assignee: Wei Yan CLA
QA Contact: Xiaodan Wang CLA
URL:
Whiteboard:
Keywords: plan
: 205396 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-10-04 00:12 EDT by jiju CLA
Modified: 2009-05-15 14:07 EDT (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jiju CLA 2007-10-04 00:12:44 EDT
Hi,

When I use <VALUE-OF>totalPage</VALUE-OF> it always gives 0 as the result.
I cant use palette item as it makes alignment issues.
How can i use this function ?

Regards,
Jiju.
Comment 1 Gang Liu CLA 2007-10-08 21:59:39 EDT
*** Bug 205396 has been marked as a duplicate of this bug. ***
Comment 2 Gang Liu CLA 2007-10-11 05:04:37 EDT
We can support totalPage in PDF report, and support totalPage in html with "Web viewer" mode.
what's the format, html, pdf or others?
Comment 3 Hari Nair CLA 2007-10-12 04:59:29 EDT
when this will be available?
Comment 4 Bill Ford CLA 2008-11-18 12:05:18 EST
Please escalate this fix.  I desperately need to use "pageNumber!=TotalPage" as a visibility expression on a label on the Master Page.
Comment 5 Wei Yan CLA 2009-04-23 04:55:12 EDT

*** This bug has been marked as a duplicate of bug 235520 ***
Comment 6 Wenfeng Li CLA 2009-04-23 14:22:45 EDT
Reopen this bug.  If the totalPage is intended to be used in an expression to control visibility, it would be a different bug from showing the totalPage in a text.  

#235520 is about showing the correct totalpage.  Since BIRT engine does one pass content generation, TotalPage is not finalized until the entire report content is generated. When page N is being generated, totalPage is still a running total being cummulated.     The solution in #235520 is to keep a place holder that reference the total page variable.  So that when page N is rendered after the report generation is completed, final totalpage value would be plugged in page N's content.   

Not if the total page is used to control the visibility of a content, this solution will not work.  Actually, there is deadloop in a general case to use totalpage to control visibility, because the visibility of a content will impact the totalpage, but birt engine doesn't know the total page until it knows if certain content is visible.

Can you describe what you would like to achieve in the report design?  Is it the usage that certain label show not be shown on the last page of the report?

Comment 7 Bill Ford CLA 2009-04-23 15:05:10 EDT
In my case, I am putting OCR marks on a statement, which controls an automated stuffing machine.  I need to put a special mark on the first page and one on the last page.  

I have two labels, one of which I make visible when pageNumber==1 (first page), and the other of which I want to make visible when pageNumber==totalPage (last page). 
Comment 8 Wenfeng Li CLA 2009-04-23 15:59:41 EDT
(In reply to comment #7)
> In my case, I am putting OCR marks on a statement, which controls an automated
> stuffing machine.  I need to put a special mark on the first page and one on
> the last page.  
> I have two labels, one of which I make visible when pageNumber==1 (first page),
> and the other of which I want to make visible when pageNumber==totalPage (last
> page). 

Are you using a table or list to iterate thru the records for the statement?  If so, there could be a way to set a scripting variable to indicate the end of the report, and you can use it to control the visibility of the OCR label.

If you can attach your report design XML file, I will take a look if an alternative solution exists...