关于java生成Excel文件时合并单元格出现的问题
在用java生成Excel中合并单元格时代码如下:(截取出去Warning的部分)
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 10; j++) {
ws.addCell(new Label(j, i, "标题", center));
}
}
ws.mergeCells(0, 0, 10, 3);// 合并单元格
for (int i = 0; i < 11; i++) {
if (i < 7) {
ws.addCell(new Label(i, 4, "", center));
} else {
ws.addCell(new Label(i, 4, "学位办公室制", center));
}
}
ws.mergeCells(7, 4, 10, 4);
但是会有这样的Warning:
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range A1-K4 contains more than one data cell. Setting the other cells to blank.
Warning: Range H5-K5 contains more than one data cell. Setting the other cells to blank.
Warning: Range H5-K5 contains more than one data cell. Setting the other cells to blank.
Warning: Range H5-K5 contains more than one data cell. Setting the other cells to blank.
求解!!!