java直接没错,在java中没有得到这样的方法错误

I am getting the following error as shown below

java.lang.NoSuchMethodError: org.apache.poi.hssf.usermodel.HSSFSheet.addMergedRegion(Lorg/apache/poi/hssf/util/Region;)I

at net.sf.jasperreports.engine.export.JRXlsExporter.createMergeRegion(JRXlsExporter.java:440)

at net.sf.jasperreports.engine.export.JRXlsExporter.initCreateCell(JRXlsExporter.java:419)

at net.sf.jasperreports.engine.export.JRXlsExporter.createTextCell(JRXlsExporter.java:381)

at net.sf.jasperreports.engine.export.JRXlsExporter.exportText(JRXlsExporter.java:314)

at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportPage(JRXlsAbstractExporter.java:381)

i am using the below poi jars as shown in the class path and also jasperreports 1.2.5 jar please advise i have upgraded poi jars from 2.5 to 3 so please advise do i need to upgrade jasperreports-1.2.5.jar also to be in synch with the latest poi jars

although i have done some analysis and found this url http://community.jaspersoft.com/questions/531433/save-excel-jasperviewer

which suggest with poi up gradation i should upgrade my jasper jars also

for jasper reports i have not upgraded i am using jasper reports 1.2.5 jar should i upgrade that also , folks please advise

解决方案

java.lang.NoSuchMethodError is typical error when not using correct version of libraries.

Jasper report uses multiple libraries which can be found in its distribution (in folder lib), they should all be included in classpath

If you are using Jasper reports 1.2.5 this is its release Jasper report v 1.2.5. You will find correct libraries to include in your classpath in folder lib.

However there is no doubt that is better to upgrade to latest version (when posted this answer 6.2.0), specially if you need to export to xlxs, ooxml, XSSF, this it not supported in 1.2.5.

Note: jasper report has change is file format definition from DTD to XSD schema in newer version so you may need to change your headers in .jrxml (or use old .jrxml compiler)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值