Christian Lercher wrote
> Ideally, I would like to call something like:
> 
>     sheet.setDefaultColumnCellType(Cell.CELL_TYPE_STRING);

The following code will set the default style of the first column to text:

     DataFormat fmt = workbook.createDataFormat();
     CellStyle textStyle = workbook.createCellStyle();
     textStyle.setDataFormat(fmt.getFormat("@"));
     worksheet.setDefaultColumnStyle(0, textStyle);



--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/Setting-the-cell-type-to-text-for-an-entire-column-xls-tp4552613p5712764.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]

Reply via email to