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

Bug 198270

Summary: Copying an aggregate does not make a copy, only a reference
Product: z_Archived Reporter: Jane Tatchell <jtatchel>
Component: BIRTAssignee: Yuejie Chen <yuejie.chen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: lzhu, rkanguri, wenfeng.fwd, xxue, zqian
Version: 2.2.0Keywords: plan
Target Milestone: 2.2.1   
Hardware: PC   
OS: Windows XP   
Whiteboard: Non-Auto
Bug Depends on: 200477    
Bug Blocks:    

Description Jane Tatchell CLA 2007-07-30 10:15:39 EDT
In a table with groups or multiple columns, create an aggregate in a footer or a header.
Copy the aggregate to another cell in a footer or a header.
Make changes to the new aggregate appropriate to its new location.

Expected result:
The changes appear in only the new copy of the aggregate.

Actual result:
The changes appear in both aggregates because the new aggregate is not a copy, but a reference to the same aggregate as the original.
Comment 1 Zhiqiang Qian CLA 2007-07-31 23:27:04 EDT
This needs a whole refactor or current UI copy/past behavior, and need careful design case by case.
Comment 2 Wenfeng Li CLA 2007-08-01 19:51:06 EDT
please describe the partial fix in 2.2.1 and defer the major refactor to 2.3.0.
Comment 3 Wenfeng Li CLA 2007-08-16 23:22:17 EDT
schedule this to 2.2.1 for the partial fix only.  This issue has been reported by many users.  

Can we ask user if they want to create a new databinding column if they start to edit the data binding column that is shared by more than one report item/cell?  Is there a way to scan the report item expression to see if that data binding item is used by more than one report item?

the prompt to the user could be

This data expression is used by more than one report item and cell, do we you want to change the expression for all places or create a new expression for this report  item?

Taking this approach, we do NOT need to change the semantic of copy/paste as shallow copy only.
Comment 4 Zhiqiang Qian CLA 2007-08-16 23:58:47 EDT
The partial fix has already done. I think we can do this, CC Lin to see if Dte can provide utility method to perform this check.
Comment 5 Zhiqiang Qian CLA 2007-08-20 22:35:07 EDT
When double click the dataitem, we will use utility method from Dte to check if this binding is referenced by multiple report items, if so , pop up a dialog to prompt if user want to create a new binding. the new binding should copying the settings of original binding except the name. If user choose "no", it keeps current behavior, also user can cancel the dialog for doing nothing.
Comment 6 Wenfeng Li CLA 2007-08-20 22:39:55 EDT
(In reply to comment #5)
> When double click the dataitem, we will use utility method from Dte to check if
> this binding is referenced by multiple report items, if so , pop up a dialog to
> prompt if user want to create a new binding. the new binding should copying the
> settings of original binding except the name. If user choose "no", it keeps
> current behavior, also user can cancel the dialog for doing nothing.
> 

WHen user just want to see the current binding, they will also double click on the data item, correct?  if so, can we defer the message until UI actually need to save  a new expression?  And when saving, comparing the new expression with the old expression, if it differs, ask user if they want to create a new one since the old one was shared by multiple report item or script.
Comment 7 Zhiqiang Qian CLA 2007-08-20 23:06:08 EDT
ok, we can do this check only when user clicks "OK" button. If the binding differs, then pop up the prompting dialog.
Comment 8 Yuejie Chen CLA 2007-08-27 04:38:39 EDT
Ask user to save data binding or create a new data binding when saving a edited data binding which is used in more than one report item.  Fixed.