poi设置excel默认格式为⽂本
/**设置单元格格式为⽂本格式*/
HSSFCellStyle textStyle = ateCellStyle();
HSSFDataFormat format = ateDataFormat();
textStyle.Format("@"));
textstylecell.setCellStyle(textStyle);//设置单元格格式为"⽂本"
cell.setCellType(HSSFCell.CELL_TYPE_STRING);
-------
CellStyle textStyle = wb.createCellStyle();
DataFormat format = wb.createDataFormat();
textStyle.Format("@"));
sheet.setDefaultColumnStyle(colNum, textStyle);
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论