在用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.
求解!!!
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.
求解!!!
解决方案 »
- 急问!! 重定向后,如何取回原来的session?
- 请教Hibernate、JDBC和存储过程的性能问题,三者如何取舍
- 关于检索list
- Exception in thread "main" java.lang.NoSuchMethodError: main 怎么回事?
- About liferay's question!!
- jacob控制table问题
- 2.0无状态会话bean到底和有状态的有什么区别?
- 诚心请教版主,各位大侠:在corba环境下delphi和ejb这样互操作行不行?
- 如何进行大量数据需要统计的数据库设计
- 关于spring-data测试文件中注入接口失败
- struts1中,填充的ActionForm怎么可以过滤安全字符?
- 高手请进,ssh整合,在运行时候出现下面错误。注:jaxr-api.jar 已加上
解释下这句:ws.mergeCells(0, 0, 10, 3);
我好给你检查下。
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 10; j++) {
ws.addCell(new Label(j, i, "标题", center));
}
}
i从0到3,j从0到9.一共也才4*10=40
但是我刚才试了下。。为什么我在空白Excel里面合并两个单元格的时候也会出现那个警告
怎么在合并之后把覆盖的单元格置成blank