Sunday, October 2, 2016

$ ( Currency Sign ) Missing in Excel POI

If you are writing to a cell and find that currency sign is missing this could be because of the following reason.

Setting cell style is not enough

CellStyle dollarStyle=workbook.createCellStyle();
DataFormat df = workbook.createDataFormat();

dollarStyle.setDataFormat((short)8);


You also need to set the cell style to NUMERIC

cell.setCellType(Cell.CELL_TYPE_NUMERIC);


No comments: