i need to show a value in excel cell like in 12.3% in the cell.but it should be able convert into a number.by default it is considering as a text.But i want it as a number.
if any body overcome this problem.please let me know.
i need to show a value in excel cell like in 12.3% in the cell.but it should be able convert into a number.by default it is considering as a text.But i want it as a number.
if any body overcome this problem.please let me know.
You need to:
Something like:
cell.setCellValue(0.123); // set value as number
CellStyle style = workbook.createCellStyle();
style.setDataFormat(workbook.createDataFormat().getFormat("0.000%"));
cell.setCellStyle(style);
Take a look at user defined formats section of POI quick guide for more details. You may also want to go through the examples which show how to use different POI capabilities.