cancel
Showing results for 
Search instead for 
Did you mean: 

how to copy one table elements to another table.

Former Member
0 Kudos

Hi All,

I have to got two tables , where I have instantiated one table and setting the elements to null by assigning to an array. I have another table which has got the same structure which contains 100 elements, now I need to copy the same structure by instantiating the second table. please reply at the very earliest.

regards

jalandhar

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

I forgot one thing, the attributes and their types of both Source and Target nodes must be identical in this case too.

Regards,

Prabhakaran

Former Member
0 Kudos

Hi Jalandhar,

You can also use wdCopyservice.copySubtree() , in that case, then type cast the present node to the type IWDNode. Here is a sample coding,

IWDNode sourceNode = (IWDNode)wdContext.nodeSource();

IWDNode targetNode = (IWDNode)wdContext.nodeTarget();

WDCopyService.copySubtree(sourceNode,targetNode);

all the elements from Source node will be copied to Target node.

Regards,

Prabhakaran.

Former Member
0 Kudos

HI,

The simplest way is by using WDCopyService as follows

IPrivate<View>.I<SourceNode>Node sourceNode=wdContext.node<SourceNode>();

IPrivate<View>.I<TargetNode>Node targetNode=wdContext.node<TargetNode>();

WDCopyService.copyElements(sourceNode,targetNode);

Here both node's structure and elements should be same.

Another method is using for loop, by iterating through source node elements and putting those values to target node

Regards

Fahad Hamsa