从表数据模型生成动态 jasper 报告
我正在尝试使用 tabledatamodel 生成 jasper 报告,因为
JRDataSource dataSource = new JRTableModelDataSource(model);
JasperPrint jp = DynamicJasperHelper.generateJasperPrint(dr, new ClassicLayoutManager(), dataSource);
JasperViewer.viewReport(jp);
当我运行此代码时,我会收到以下错误,如果有人可以帮助我解决这个问题。
线程“main”中的异常 java.lang.NoSuchMethodError: ar.com.fdvs.dj.domain.DynamicJasperDesign.setPrintOrder(B)V 在 ar.com.fdvs.dj.core.DJJRDesignHelper.getNewDesign(DJJRDesignHelper.java:69) 在 ar.com.fdvs.dj.core.DynamicJasperHelper.generateJasperDesign(DynamicJasperHelper.java:207) 在 ar.com.fdvs.dj.core.DynamicJasperHelper.generateJasperReport(DynamicJasperHelper.java:535) 在 ar.com.fdvs.dj.core.DynamicJasperHelper.generateJasperReport(DynamicJasperHelper.java:518) 在 ar.com.fdvs.dj.core.DynamicJasperHelper.generateJasperPrint(DynamicJasperHelper.java:283) 在 ar.com.fdvs.dj.core.DynamicJasperHelper.generateJasperPrint(DynamicJasperHelper.java:236)
I am trying to generate a jasper report using a tabledatamodel, as
JRDataSource dataSource = new JRTableModelDataSource(model);
JasperPrint jp = DynamicJasperHelper.generateJasperPrint(dr, new ClassicLayoutManager(), dataSource);
JasperViewer.viewReport(jp);
when I run this code I get following error, if anyone can help me to come-up with this problem.
Exception in thread "main" java.lang.NoSuchMethodError: ar.com.fdvs.dj.domain.DynamicJasperDesign.setPrintOrder(B)V
at ar.com.fdvs.dj.core.DJJRDesignHelper.getNewDesign(DJJRDesignHelper.java:69)
at ar.com.fdvs.dj.core.DynamicJasperHelper.generateJasperDesign(DynamicJasperHelper.java:207)
at ar.com.fdvs.dj.core.DynamicJasperHelper.generateJasperReport(DynamicJasperHelper.java:535)
at ar.com.fdvs.dj.core.DynamicJasperHelper.generateJasperReport(DynamicJasperHelper.java:518)
at ar.com.fdvs.dj.core.DynamicJasperHelper.generateJasperPrint(DynamicJasperHelper.java:283)
at ar.com.fdvs.dj.core.DynamicJasperHelper.generateJasperPrint(DynamicJasperHelper.java:236)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这和你使用的jasper reports版本有关系,降级试试。 此处报告了该问题
This has something to do with the jasper reports version you are using, try downgrading. The issue was reported here
该问题主要是因为jar文件不匹配。这取决于您与 DynamicJasper 一起使用的 Jasper 版本。在 DynamicJasper 的下载页面上,您将找到有关兼容性版本的信息,这里是摘要:
使用 有关未来更新,请参阅 http://dynamicjasper.com/download/ 用于版本兼容性。
The issue is mainly because of jar file mismatches. It depends on which Jasper version you are using with DynamicJasper. On DynamicJasper's download page you will find information about compatibility versions here is summary:
For future updates refer http://dynamicjasper.com/download/ for version compatibility.