HSSFDataFormat的数据格式:
*设置单元格格式为文本格式*/
HSSFCellStyle textStyle = workBook.createCellStyle();
HSSFDataFormat format = workBook.createDataFormat();
textStyle.setDataFormat(format.getFormat("@"));
cell.setCellStyle(textStyle);//设置单元格格式为"文本"
cell.setCellType(HSSFCell.CELL_TYPE_STRING);
/**设置整列的单元格格式**/
CellStyle textStyle = wb.createCellStyle();
DataFormat format = wb.createDataFormat();
textStyle.setDataFormat(format.getFormat("@"));
//colNum 第几列
sheet.setDefaultColumnStyle(colNum, textStyle);