poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marco Balcon <m.bal...@i-contact.it>
Subject force cell type to string
Date Thu, 05 Feb 2009 10:28:14 GMT
Hi all,

I use apache poi 3.5 beta 1 in order to generate an empty excel
(only the first row with column name are created).

The user download this file and populate row with data.

I need to generate empty cell with cell type string in order to avoid
automatic conversion if user input a date into format dd.mm.yyyy (for
example "12.05.1953" is converted 12.37.33)

I think the problem is that the cells have type numeric even if I force
the cell type. This is my code.

String text = "";
cell = row.createCell(col);
cell.setCellType(HSSFCell.CELL_TYPE_STRING);
cell.setCellValue(new HSSFRichTextString(text));

What is the correct way in order to avoid this automatic conversion when
user input data into Excel?

Thank's in advance.

Marco Balcon



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


Mime
View raw message