poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Burch <nick.bu...@alfresco.com>
Subject Re: Date formatting doesn't seem to work with POI 3.0.2 and Excel 2010
Date Thu, 26 Jul 2012 21:21:10 GMT
On Thu, 26 Jul 2012, David Sills wrote:
>                     HSSFCellStyle cellStyle =
> workbook.createCellStyle();
>
>                     HSSFDataFormat formatter =
> workbook.createDataFormat();
>
>                     short idx = formatter.getFormat(dateFormat);
>                     if (idx > -1)
>                     {
>                           cellStyle.setDataFormat(idx);
> //                         cell.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
>                           cell.setCellValue((Date) o);
>                     }

Aren't you missing the code to apply the cell style to the cell?

eg cell.setCellStyle(cellStyle) ?

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Mime
View raw message