Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 231591

Summary: [Improve Page Break Management] Visibility on Table/List Header not reevaluated on page break
Product: z_Archived Reporter: Jason Weathersby <jasonweathersby>
Component: BIRTAssignee: Wei Yan <wyan>
Status: VERIFIED WONTFIX QA Contact: mindan xu <mindan.xu>
Severity: normal    
Priority: P3 CC: bluesoldier, rlu, wyan, xwang
Version: 2.3.0Keywords: plan
Target Milestone: 2.5.0 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard: Obsolete

Description Jason Weathersby CLA 2008-05-12 11:52:34 EDT
Steps to reproduce.
1 - create a report that has a table or list that generates more than one page.
2 - In the beforeFactory put a variable like
pg =0;
3 - Add a visibility expression to the table/list header like:
if( pg == 0 ){
true;
}else{
false;
}

On the pageBreak event for the table/list add script like:
pg+=1;

Expected result
header does not show on first page but does show on all subsequent pages.

Actual result:
Header never shows.
Comment 1 Rick Lu CLA 2008-05-12 22:18:27 EDT
When does Engine evaluate this script?
Comment 2 Wei Yan CLA 2008-05-12 22:24:46 EDT
the table header/footer, group header/footer, page header /footer are all created only once.

BIRT needs define a execute model which supports such a feature.
Comment 3 Wei Yan CLA 2008-11-05 23:15:54 EST
the onRender should be evaluated for each table/group header. 
Comment 4 Wei Yan CLA 2009-04-27 23:30:10 EDT
defer to RC1 due to resource limitation.
Comment 5 Wei Yan CLA 2009-05-15 04:20:48 EDT
The onRender is invoked only once for each content. 

Invoke the onRender multiple times may cause serious sequence issues. For example assume there is a table TABLE which is divided into two pages.The page break is caused by the row ROW oversize the first page.

The layout sequence is:

layout TABLE
layout rows
layout the ROW. BIRT find there is no enough spaces in the current page, so BIRT display the ROW in the next page.

display the TABLE
display the ROW.

As we known that the onRender must be invoked before the layout as it may changes the element size (through setFont/setLineHeigh/setWidth/setHeigh etc). The onRender invoking sequence for this case is:

first page:
TABLE.onRender
ROW.onRender

second page:
TABLE.onRender
ROW.onRender

you will find that the ROW.onRender is invoked twice. It is strange for the user as the ROW is display only in the second page. To remove such issue, BIRT defines that the onRender is invoked only once for each item. The invoking sequence is the layout sequence. In the above case, the onRender is invoked as:

TABLE.onRender
..
ROW.onRender
...

The visibility is same with the onRender, it is invoked only once for each content.
Comment 6 mindan xu CLA 2009-05-17 22:22:14 EDT
Mark as Verified first.