Commit f6ba588a by zhiwj

门店

parent 02eda0fe
......@@ -120,19 +120,19 @@ public class ExcelUtils {
List<String> obj = dataList.get(i); // 遍历每个对象
XSSFRow row = sheet.createRow(i + dataLine); // 创建所需的行数
for (int j = 0; j < obj.size(); j++) {
XSSFCell cell = null; // 设置单元格的数据类型
XSSFCell cellTmp = null; // 设置单元格的数据类型
if (j == 0) {
cell = row.createCell(j, XSSFCell.CELL_TYPE_NUMERIC);
cell.setCellValue(i + 1);
cellTmp = row.createCell(j, XSSFCell.CELL_TYPE_NUMERIC);
cellTmp.setCellValue(i + 1);
} else {
cell = row.createCell(j, XSSFCell.CELL_TYPE_STRING);
cellTmp = row.createCell(j, XSSFCell.CELL_TYPE_STRING);
if (!"".equals(obj.get(j)) && obj.get(j) != null) {
cell.setCellValue(obj.get(j)); // 设置单元格的值
cellTmp.setCellValue(obj.get(j)); // 设置单元格的值
}
}
cell.setCellStyle(style); // 设置单元格样式
cellTmp.setCellStyle(style); // 设置单元格样式
if (j != 0) {
cell.setCellType(XSSFCell.CELL_TYPE_STRING);
cellTmp.setCellType(XSSFCell.CELL_TYPE_STRING);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment