Commit c7679e06 by guojuxing

excel合并单元格修复

parent c9540508
...@@ -222,8 +222,8 @@ public class ExcelUtils { ...@@ -222,8 +222,8 @@ public class ExcelUtils {
n++; n++;
continue; continue;
} }
if (n != 1) { if (n == 0 && sonHeader.size() == 1) {
//如果n = 1,就是一个单元格,合并操作会报错 //一个单元格,合并操作会报错
//创建第一行大标题 //创建第一行大标题
sheet.addMergedRegion(new CellRangeAddress(0, 0, n, (n + sonHeader.size() - 1))); sheet.addMergedRegion(new CellRangeAddress(0, 0, n, (n + sonHeader.size() - 1)));
} }
......
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