Hello all,
I neet to set cell type to "Date" but getting "Custom" in generated
xls(right click on cell>Format Cells>Numbers Tab>Category section). It is
formatted correctly as Date but type is not selected as Date.
If I am opening same xlsx in Open Office the cell data format is "Date" but
if I am opening in MS EXCEL 2010 it is "Custom".
I tried several times different approaches to make it work in Excel 2010
but no luck. Here is my code examples:
*CellStyle dateCellStyle = wb.createCellStyle();
//
dateCellStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("dd-mmm-yyyy"));
//does not work
//
dateCellStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("Date")); //does
not work
//
dateCellStyle.setDataFormat(wb.createDataFormat().getFormat("dd-mmm-yyyy"));
//does not work
dateCellStyle.setDataFormat(wb.createDataFormat().getFormat("dd-mmm-yyyy"));
//does not work*
Could anyone help me please? Thanks.
--
View this message in context:
http://apache-poi.1045710.n5.nabble.com/Set-cell-type-to-Date-tp5537937p5537937.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]