java jxl excel导出报错 Warning: Cannot merge cells
来源:互联网 发布:李孝利 长相 知乎 编辑:程序博客网 时间:2024/05/01 05:38
用jxl导出excel时报错Warning: Cannot merge cells - top left and bottom right incorrectly specified.
部分版本的excel由于这个错误导致导出表格样式错误.
以下是错误日志源码:
/** * Merges the specified cells. Any clashes or intersections between * merged cells are resolved when the spreadsheet is written out * * @param col1 the column number of the top left cell * @param row1 the row number of the top left cell * @param col2 the column number of the bottom right cell * @param row2 the row number of the bottom right cell * @return the Range object representing the merged cells * @exception jxl.write..WriteException * @exception jxl.write.biff.RowsExceededException */public Range mergeCells(int col1, int row1, int col2, int row2) throws WriteException, RowsExceededException{ // First check that the cells make sense if (col2 < col1 || row2 < row1) { logger.warn("Cannot merge cells - top left and bottom right "+ "incorrectly specified"); } // Make sure the spreadsheet is up to size if (col2 >= numColumns || row2 >= numRows) { addCell(new Blank(col2, row2)); } SheetRangeImpl range = new SheetRangeImpl(this, col1, row1, col2, row2); mergedCells.add(range); return range;}
所以如果是单行合并单元格,那么row2的值应该和row1的值一致,而非0;
阅读全文
0 0
- java jxl excel导出报错 Warning: Cannot merge cells
- 用jxl导出excel报错:java.lang.NoClassDefFoundError: jxl/format
- Java jxl导出excel
- java jxl导出EXCEL
- java jxl 导出Excel
- java jxl导出excel
- jxl按照模板导出数据到excel报错问题
- java jxl导出excel文件
- java jxl导出excel小结
- java jxl插件导出excel
- java jxl导出excel小结
- JAVA导入导出EXCEL(JXL)
- jxl 合并EXCEL 报错
- java导入导出excel操作(jxl)
- java导入导出excel操作(jxl)
- java导入导出excel操作(jxl)
- java导入导出excel操作(jxl)
- java jsp JXL调用模版导出Excel
- 常用的快速Web原型图设计工具
- 大数分类
- Java中的StringTokenizer类的使用方法
- ORA-01017: invalid username/password; logon denied
- CSDN博客文章插入图片
- java jxl excel导出报错 Warning: Cannot merge cells
- ListView和GridView根据item数量自适应高度的工具类封装
- Java 内存分配全面浅析
- Springboot
- Linux的配置文件为啥放在/etc?
- zabbix_server安装与配置
- 润乾V5 报表集成项目后工具栏不显示
- Java的转义字符
- wpf mvvm datagrid DataGridTemplateColumn的绑定无效的可能原因之一!