poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vishwa Kumba <vish_for...@yahoo.com>
Subject Apache POI - Excel Custom Date Formats
Date Fri, 01 Feb 2008 11:48:49 GMT
Gernating an Excel SpreadSheet..

I am unable to set the date format to a Cell in Excel 
to dd.mmm.yyyy. Are custom date formats supported in
Apache POI? The foll. piece of code seems to work only
when the input DATE_FORMAT is one of the built-in
formats mentioned in the docs, else it is displayed as
a numeric value.

HSSFCell cell = getCell(workSheet, row, col);
cell.setCellValue((Date) value);
HSSFCellStyle cellStyle = workBook.createCellStyle(); 
      
cellStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat(DATE_FORMAT));
               
cell.setCellStyle(cellStyle);

Can Someone tell me or guide me in the right
direction?


thanks,
Vishwa


      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

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


Mime
View raw message