简体   繁体   中英

Edit cells with number values using JXL

 sheetToEdit.addCell(new Label(j, i, s[i]));

In the above line, Label takes only the string values. But I want to add the cells in the rows with the number (double) values.

Is there any other method in JXL by which I can add cells with number values.

Use Number instead of Label for cells containing numeric values. So you might want to instantiate ...

Number(int c, int r, double val, CellFormat st)

Where c is column, r row, val is the double value you are interested in setting and st (which is optional, you only have to use the first three parameters) is obviously the cell formatting.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM