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

Bug 331743

Summary: copy elements
Product: z_Archived Reporter: Pico <mpicom>
Component: BIRTAssignee: Birt-Report-inbox <Birt-Report-inbox>
Status: RESOLVED WORKSFORME QA Contact: Xiaoying Gu <bluesoldier>
Severity: major    
Priority: P3 CC: bluesoldier, mpicom, ywang
Version: 2.6.0   
Target Milestone: 3.7.0   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Pico CLA 2010-12-03 02:55:50 EST
Hi,

I have a library with datasets and grids that use that datasets.
I need to copy a grid of the library to a model.
I try with :

DesignElementHandle copieHandle=new GridHandle(design.getModule(),(DesignElement)eih.copy());

and 

ElementCopy copia = CopyUtil.copy(eih);
								CopyUtil.paste(copia, cell, cell.getContent( ).getSlotID());

Where "eih" are de Gridhandle of the library.

In my model I have other datasets with the same name of the datasets in library because i want to use these datasets in the copie-grid. But it is not possible because with copy de datasets in the grid are linked to the library (Library.DatasetName).
Example: if in library dataset reference (binding)is D1 when I copy the grid dataset reference change to library.D1 and i need it remains D1.
 

Could I copy a grid of a library without datasets linked to the library ?


Thanks in advance.
Comment 1 Yueqian Wang CLA 2011-04-13 23:08:03 EDT
I tried the CopyUtil. It works OK. The point is the way you get the handler.
Please open the library file directly rather than getting its handle from the design file by namespace. Then you can use the second way you metioned to copy the grid in the library into the design file without datasets linked to the library.