Java 如何解决jasper报告中的uuid
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19809947/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to solve uuid in jasper report
提问by syaloom
I have some jasper report files, which I make them in iReport 3.7.5 version. It worked before, but after i decided to use iReport 5.0.0 version and made some changes into it, then it had a problem. I checked what the problem was and it said this Attribute 'uuid' is not allowed to appear in element 'jasperReport'
It made me confused because there're many attributes of uuid on my report files. I guess it was built while the old version transformed to a new ones. I tried to delete all of uuid components in xml design of report files, but it ruined both its format and design. So, what kind of solution that i must take to solve this? Thanks for any reply
我有一些碧玉报告文件,我在 iReport 3.7.5 版本中制作它们。以前可以用,但是在我决定使用 iReport 5.0.0 版本并对其进行了一些更改后,它出现了问题。我检查了问题是什么,它说这Attribute 'uuid' is not allowed to appear in element 'jasperReport'
让我很困惑,因为我的报告文件中有很多 uuid 属性。我猜它是在旧版本转换为新版本时构建的。我试图删除报告文件的 xml 设计中的所有 uuid 组件,但它破坏了它的格式和设计。那么,我必须采取什么样的解决方案来解决这个问题?感谢您的任何回复
回答by Cassio Seffrin
Try to update the jasperreports dependency, if you are using maven you can do it this way:
尝试更新 jasperreports 依赖项,如果您使用的是 maven,您可以这样做:
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>5.0.0</version>
</dependency>
Also we need to add the iText dependency to work fine.
我们还需要添加 iText 依赖项才能正常工作。
<dependency>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
<version>2.1.7</version>
</dependency>
The jar package in your app must to be the same version of the iReport. I think it will fix your problem.
应用中的jar包必须与iReport的版本相同。我认为它会解决你的问题。
Cheers! Cassio
干杯! 卡西欧
回答by CyborgNinja23
This worked for me: Change the compatibility of the JasperReport to 3.5.1 in Tools - Options - General - Compatibility. Now when you made a change in the designer the 'uuid' property is auto-generated in every field of the report, to remove it just save your report before open the XML view.
这对我有用:在工具 - 选项 - 常规 - 兼容性中将 JasperReport 的兼容性更改为 3.5.1。现在,当您在设计器中进行更改时,报告的每个字段中都会自动生成 'uuid' 属性,要删除它,只需在打开 XML 视图之前保存您的报告。