从apache poi的3.2.final升级到3.11 beta版本会出现一些错误

时间:2015-06-23 09:20:20

标签: java excel apache apache-poi

我正在尝试从org.apache.poi 3.2升级到org.apache.poi 3.11 beta版。这样做会发出以下错误

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project xyzxyz: Compilation failure
[ERROR] xxxx.java:[648,34] method setRegion in class xyzz cannot be applied to given types;
[ERROR] required: org.apache.poi.hssf.util.CellRangeAddress
[ERROR] found: org.apache.poi.ss.util.CellRangeAddress
[ERROR] reason: actual argument org.apache.poi.ss.util.CellRangeAddress cannot be converted to org.apache.poi.hssf.util.CellRangeAddress by method invocation conversion

下面是代码的一部分,它给出了编译错误。

method(xyzz excelBean){
HSSFSheet workSheet = excelBean.getWorkSheet();
CellRangeAddress region = new CellRangeAddress(rownum, rownum
                + rowSpan - 1, colNum,
                (colSpan - 1 + colNum));
workSheet.addMergedRegion(region);
excelBean.setRegion(region);
}

究竟是什么问题以及如何解决?

0 个答案:

没有答案