Wednesday, April 2, 2014

How to add Computed column to TableModel at runtime ?




Hello All,




Could you please share suggestion/idea how can I add computed/derived column to an existing TableModel ?



I've 7 column in the existing TableModel. Now I've to add 8th column and it'll be based on Col2, Col3 & Col5.



Value of Col8 should be in following logic.




public TableModel GetDerivedTable(ResultSet rs)



{



TableModel model = GetTable(rs); // I've done this




//Now have to modify here




If(Col2==true && Col5==true)



Then{Col8 = 1}



Else IF((Col2==true && Col5==false) || (Col2==false && Col5==true))



Then{Col8 = 0}



Else IF(Col2==false && Col5==false)



Then{Col8=-1}




return model;



}




Any suggestion please...







No comments:

Post a Comment