Hello Nick,
Thanks for your advices, it works fine now with the following. I get inside
my cell date in a good format.
Franck
_________________________________________________________________
try {
//ouverture du fichier Excel
FileOutputStream fileOut;
POIFSFileSystem fs = new POIFSFileSystem(new
FileInputStream("INVOICE_THIERRY.xls"));
// creation workbook, sheet et Row 1
HSSFWorkbook wb = new HSSFWorkbook(fs);
HSSFSheet sheet = wb.getSheetAt(0);
HSSFRow row2 = sheet.getRow(1);
DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd");
HSSFDataFormat df = wb.createDataFormat();
HSSFCellStyle cs = wb.createCellStyle();
//System.out.println("index of format: " +
df.getFormat("yyyy/MM/dd"));
cs.setDataFormat(df.getFormat("d-mmm-yy"));
HSSFCell cellDateM = row2.getCell(5);
System.out.println("cell date value string = " +
cellDateM.getStringCellValue());
try {
Date theDate = dateformat.parse(cellDateM.getStringCellValue());
System.out.println("theDate = " + dateformat.format(theDate));
cellDateM.setCellValue(theDate);
cellDateM.setCellStyle(cs);
} catch (ParseException e) {
e.printStackTrace();
}
--
View this message in context:
http://apache-poi.1045710.n5.nabble.com/HSSFFormulaEvaluator-DATEVALUE-is-not-evaluated-tp4658681p4661480.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]