问题
Obviously
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>6.1.1</version>
</dependency>
depends on jasperreports-functions, but I cannot find this in any repository. I see the jar file in Tibco Jasper Studio, I found http://community.jaspersoft.com/project/jasperreports-library/releases link to download the library, however we use maven in corporate environment, so I would appreciate maven repository to download the artifact automatically.
Update
My problem is that I can compile and run templates in Tibco Jasper studio, but I cannot compile the templates using java api
JasperCompileManager.compileReportToFile(src, dest);
I'm using functions in print when expression like:
NOT(EQUALS($F{title}, null))
and getting errors when compiling in java like:
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$
<---->
At this point I'm sure it's because I'm missing jasperreports-functions-6.1.1.jar on my classpath. This file is present in jaspersoft@studio
回答1:
Add the repository
<repository> <id>jr-ce-releases</id> <url>http://jaspersoft.artifactoryonline.com/jaspersoft/jr-ce-releases</url> </repository>
Add dependency to your project
<dependency> <groupId>net.sf.jasperreports</groupId> <artifactId>jasperreports-functions</artifactId> <version>6.6.0</version> </dependency>
回答2:
The dependency net.sf.jasperreports should contains all the JsasperReporsts 6.1.1 functions, or simple download the jar from: http://mvnrepository.com/artifact/net.sf.jasperreports/jasperreports/6.1.1
来源:https://stackoverflow.com/questions/33695160/repository-for-maven-jasperreports-functions-6-1-1