On Fri, 22 Jun 2007, Fallows, Andrew wrote:
Is there a way to force HSSF to treat cells as strings even if they contain numbers only? As I said, I tried using style.setDataFormat(wb.createDataFormat().getFormat("@"));, but that did not work. And according to the Javadoc for HSSFCell, getRichStringCellValue() throws an exception for numeric cells.
Can't you just call getNumericCellValue() on the cell, and format it however you want?
(If you stored the number in excel as a number (i.e. no ' prefix), it will be stored in the excel file as a floating point number, no matter how it's displayed on the screen.)
Nick --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
