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

Bug 224242

Summary: BIRT group editor inserts unwanted key field
Product: z_Archived Reporter: Paul Rogers <progers>
Component: BIRTAssignee: Yuejie Chen <yuejie.chen>
Status: VERIFIED FIXED QA Contact: Tianli Zhang <tzhang>
Severity: normal    
Priority: P3 CC: wenfeng.fwd, zqian
Version: 2.2.2Keywords: plan
Target Milestone: 2.5.0 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard: Non-Auto

Description Paul Rogers CLA 2008-03-26 18:55:15 EDT
Create a BIRT report design with groups, say a Country/State/Customer report using the CUSTOMERS table in Classic Models sample database.

Create groups, but do them backwards: State (top), Country (lower).

Next, decide to reverse the order of the groups. There does not seem to be any UI to do this, so do it the hard way.

Edit the State (top) group and change the key to Country. Notice that the UI adds the [COUNTRY] field to the group header, even if the header already has fields.

This is a nuisance; I must remove the field after each edit, making more work.

The UI creates a key field when the group is first created. This is good and helpful. So, the issue here is simply that the UI always creates a key field when the group key changes, even if the header already contains contents. So, perhaps don't create the key field when changes occur. Or, perhaps only if the header is empty.

Now, for fun, change the top group back to STATE. Notice that the UI helpfully creates a new [STATE] field in the header even though the header already contains a [STATE] field. This is really not helpful. So, another possible check might be to not create fields that already exist.
Comment 1 Zhiqiang Qian CLA 2008-03-27 00:40:11 EDT
I think current behavior is what we agreed before. Please give some advice.
Comment 2 Rima Kanguri CLA 2008-04-14 19:00:49 EDT
To reverse the order of the groups try following - 
On the 'Groups' tab in the property editor, there is a 'Up', 'Down' button on the right below 'Add', 'Edit', 'Delete'. 


Comment 3 Paul Rogers CLA 2008-04-23 20:20:28 EDT
(In reply to comment #2)
> To reverse the order of the groups try following - 
> On the 'Groups' tab in the property editor, there is a 'Up', 'Down' button on
> the right below 'Add', 'Edit', 'Delete'. 
> 

This UI is very helpful. However, what I was trying to do is preserve the row layout while changing the key. The problem is that, even though I already had the row layout the way I wanted it (but had made a mistake on the key expression), the UI "helpfully" messed up my UI by adding another key field that I didn't need.

This is why I made the suggestion to add the key field ** only ** if the UI for that group is empty.

Comment 4 Rima Kanguri CLA 2009-04-23 18:14:29 EDT
I agree with Paul's suggestion that - 'UI should not always add key fields - when the group changes, UI should add the key field ** only ** if the 
group header cells are empty'




Comment 5 Zhiqiang Qian CLA 2009-05-11 00:04:27 EDT
Need change the behavior based on comment #4.
Comment 6 Yuejie Chen CLA 2009-05-19 01:55:12 EDT
Add data item into group header cell only when the cell is empty.
Fixed.
Comment 7 Tianli Zhang CLA 2009-05-19 22:31:09 EDT
Only when table group header is empty the key filed will be added, if it is not empty the new key filed will not be added. Verified in 2.5.0 v20090520-0630 build.