显然
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>6.1.1</version>
</dependency>
取决于jasperreports-functions,但我无法在任何存储库中找到它。我在Tibco Jasper Studio中看到了jar文件,我找到了http://community.jaspersoft.com/project/jasperreports-library/releases链接来下载库,但是我们在企业环境中使用maven,所以我希望maven存储库能够自动下载工件。
更新
我的问题是我可以在Tibco Jasper studio中编译和运行模板,但我无法使用java api编译模板
JasperCompileManager.compileReportToFile(src, dest);
我在表达式中使用print中的函数:
NOT(EQUALS($F{title}, null))
在java中编译时遇到错误:
Caused by: net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
1. The method EQUALS(String, null) is undefined for the type sickInjuriesClosePerson_1447428912021_94804
value = NOT(EQUALS(((java.lang.String)field_title.getValue()), null)); //$JR_EXPR_ID=9$
<---->
2. The method EQUALS(String, null) is undefined for the type sickInjuriesClosePerson_1447428912021_94804
value = NOT(EQUALS(((java.lang.String)field_firstName.getValue()), null)); //$JR_EXPR_ID=11$
<---->
此时我确定是因为我在类路径上缺少jasperreports-functions-6.1.1.jar。该文件存在于jaspersoft @ studio
中答案 0 :(得分:6)
我从http://community.jaspersoft.com/comment/822451#comment-822451
得到答案这些罐子可在https://jaspersoft.artifactoryonline.com/jaspersoft/jr-ce-releases/
获得答案 1 :(得分:3)
添加存储库
<repository>
<id>jr-ce-releases</id>
<url>http://jaspersoft.artifactoryonline.com/jaspersoft/jr-ce-releases</url>
</repository>
为项目添加依赖项
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports-functions</artifactId>
<version>6.6.0</version>
</dependency>
答案 2 :(得分:0)
依赖关系net.sf.jasperreports应包含所有JsasperReporsts 6.1.1函数,或者从以下位置简单地下载jar: http://mvnrepository.com/artifact/net.sf.jasperreports/jasperreports/6.1.1