tags:

views:

24

answers:

1

Is it possible to convert jxl LabelCell to jxl NumberCell somehow?

+1  A: 

If you have a labelCell, you can try the following snippet to create a NumberCell:

NumberCell numberCell = new Number(labelCell.getColumn(), 
                                   labelCell.getRow(), 
                                   Double.parseDouble(labelCell.getContents()));
dogbane
I still get java.lang.ClassCastException: jxl.read.biff.LabelSSTRecord cannot be cast to jxl.NumberCell
jaana
Did you use my code? I'm not doing any casting. I'm creating a new NumberCell using properties from the LabelCell.
dogbane