cancel
Showing results for 
Search instead for 
Did you mean: 

Arrange data in a table

Former Member
0 Kudos

hi,

ihave data in my table as:

col1 -col2- -col3-

A ........B.......C

A.........B.......D

E.........F.......G

E.........F.......H

But i want it this way:

col1 col2 col3

A........B.......C

....................D

E........F........G

.....................H

Common cols in adjacent rows shuld b invisible.

plz help..

Thank you.

regards,

ankita

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

hi,

For your requirement you can use TablrPopins (Cell Popin) for the col3.

thanks & regards,

Manoj

former_member485701
Active Participant
0 Kudos

Hi ankita,

Wht is the datasource of your table.

Is it from some model node or you are populating your self.

Can you please tell me?

Regards,

Praveen

Former Member
0 Kudos

hi praveen,

im binding my table to a model node.

when i enter the required field in my form and click the button it fetches me the data. bt i need to arrange the data (non repeatable rows ).

plz help.

regards,

ankita

former_member485701
Active Participant
0 Kudos

Ok fine . do following things in your code.

The node which you are using like "ModelNode".

o Create two more attributes for making your invisible column

o Now bind your those columns with these attributes

o now on the basis of the actual model value you need to populate these values

IWDNode node=wdcontext.nodeModelNode();

for (int i = 0; i < node.size(); i++) {

if(i!=0){

element=node.getElementAt(i-1);

}

String prevalue1=node.getElementAt(i).getattributeValue("colum1");

String prevalue2=node.getElementAt(i).getattributeValue("colum2");

String value1=node.getElementAt(i).getattributeValue("colum1");

String value2=node.getElementAt(i).getattributeValue("colum2");

if(prevalu1!=value1){

node.getElementAt(i).setAttibuteValue("newColumn1",value1);

}

if(prevalu2!=value2){

node.getElementAt(i).setAttibuteValue("newColumn2",value1);

}

}

Now if your values will be repeated it will not add it in the row.

REgards,

Praveen

former_member751941
Active Contributor
0 Kudos

Hi Ankita,

You can use this after populating the TableNode.

for(int i = 0;i<wdContext.nodeTableNode().size();i++)

{

for(int j = i1;j<wdContext.nodeTableNode().size()-1;j+)

{

if(wdContext.nodeTableNode().getTableNodeElementAt(i).getCol1().equals(wdContext.nodeTableNode().getTableNodeElementAt(j).getCol1()))

{

wdContext.nodeTableNode().getTableNodeElementAt(j).setCol1("");

}

if(wdContext.nodeTableNode().getTableNodeElementAt(i).getCol2().equals(wdContext.nodeTableNode().getTableNodeElementAt(j).getCol2()))

{

wdContext.nodeTableNode().getTableNodeElementAt(j).setCol2("");

}

if(wdContext.nodeTableNode().getTableNodeElementAt(i).getCol3().equals(wdContext.nodeTableNode().getTableNodeElementAt(j).getCol3()))

{

wdContext.nodeTableNode().getTableNodeElementAt(j).setCol3("");

}

}

}

Regards,

Mithu

Former Member
0 Kudos

Hi,

Have you tried grouped colums which is available from NW2004s

Regards

Ayyapparaj

Former Member
0 Kudos

hi,

thanx 4 the reply.

bt plz explain hw to use that.

im currently working on NW2007

Regards,

Ankita

Former Member
0 Kudos

Hi,

Pl go through this blog /people/bertram.ganz/blog/2007/09/28/teched-2007-cd254--developing-state-of-the-art-table-uis-in-web-dynpro-java--sap-netweaver-70

Regards

Ayyapparaj