从 iReport 导入 JasperReport 到 Java 应用程序时出现异常
我正在尝试将一个中等复杂的报告导入到我的 java 应用程序中。该报告包括子查询、样式模板 (jrtx) 和图像。 iReport 中的一切工作正常,但当我尝试在应用程序中运行报表时,出现以下错误:
exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is net.sf.jasperreports.engine.JRRuntimeException: Error parsing template XML
root cause
net.sf.jasperreports.engine.JRRuntimeException: Error parsing template XML
root cause
org.xml.sax.SAXParseException: Element type "paragraph" must be declared.
我正在使用 iReport 版本 4.0.2(启用 4.0.1 兼容模式)来开发报表和 net.sf。 jasperreports 4.0.1 在我的应用程序上运行报告。注意:iReport 版本与 jasperReport 版本匹配。
I'm trying to import a moderately complex report into my java application. The report includes subqueries, a style template (jrtx) and images. Everything works great in iReport but when I try to run the report in the application it gives me the following error:
exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is net.sf.jasperreports.engine.JRRuntimeException: Error parsing template XML
root cause
net.sf.jasperreports.engine.JRRuntimeException: Error parsing template XML
root cause
org.xml.sax.SAXParseException: Element type "paragraph" must be declared.
I'm using iReport version 4.0.2 (with 4.0.1 compatiblity mode on) to develop the reports and net.sf.jasperreports 4.0.1 to run the reports on my application. NOTE: iReport versions match up to jasperReport versions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
显然,iReport的4.0.1兼容模式并不能100%工作。 iReport 4.0.2 在弄乱某些属性时插入一个标签。 JasperReport 4.0.1 中不存在
标记。如果我在报告中嵌入任何段落样式而不是样式模板,我会在编译时发现这一点。模板是在运行时考虑的。我像这样转换了我的模板:
不幸的是,在像这样更改模板后,iReport 4.0.2 无法正确解释模板。 :-(。更好的解决方案可能是将 iReport 降级到正确的版本。
Apparently, iReport's 4.0.1 compatiblity mode does not work 100%. iReport 4.0.2 inserts a tag when messing with certain properties. The
<paragraph>
tag doesn't exist in JasperReport 4.0.1. I would have caught this at compile time if I had embedded any paragraph styles in the report rather than the style template. Templates are considered at run-time.I converted my templates like this:
Unfortunately, iReport 4.0.2 doesn't interpret the template correctly after changing the template like this. :-(. A better solution might be to downgrade iReport to the proper version.