How to set the cell style as text

Aug 23, 2010 at 7:10 AM
the cell value default as number.
How to set the
cell style as text???
Aug 27, 2010 at 8:54 PM

If I remember correctly you have to specifically set the celltype to be String.

Sep 9, 2010 at 1:24 PM

You can try this:

sheet1.GetRow(0).CreateCell(0, CellType.STRING).SetCellValue(111);


or this, to set default format in the specific column:

CellStyle cellStyle = workbook.CreateCellStyle();

cellStyle.DataFormat = HSSFDataFormat.GetBuiltinFormat("@");

sheet1.SetDefaultColumnStyle(0, cellStyle);


I hope helped ;)