1.如果循环导入一个字符串,需要重新createRow和createCell;
Row row = sheet.getRow(i) ;
if(row == null){
row = sheet.createRow(i);
}
return row;
Cell cell = row.getCell(index);
if(cell == null){
cell = row.createCell(index);
}
return cell ;
2.如果Excel cell里面需要填写文本格式
CellStyle style = getCell(row ,0).getCellStyle();
style.setDataFormat(workbook.createDataFormat().getFormat("TEXT"));
getCell(row ,0).setCellStyle(style);
(未完待续)