!192 解决excel报表 设计和导出的样式不一样

Merge pull request !192 from Foming/cherry-pick-1737017951
This commit is contained in:
Foming
2025-01-16 09:00:35 +00:00
committed by Gitee

View File

@@ -49,11 +49,12 @@ public class XlsSheetUtil {
Map<Integer, List<JSONObject>> cellMap = cellGroup(cells_json);
//循环每一行
// 样式创建放到循环外层防止样式过多超出excel最大样式限制
CellStyle style = wb.createCellStyle();
// CellStyle style = wb.createCellStyle();
for (Integer r : cellMap.keySet()) {
Row row = sheet.createRow(r);
//循环每一列
for (JSONObject col : cellMap.get(r)) {
CellStyle style = wb.createCellStyle();
createCell(wb, sheet, row, col,style);
}
}