8

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

3
  • Why "Obviously"? What did you try and what didn't work? I think you don't need this dependency for JasperReports 6.x
    – Tunaki
    Nov 13, 2015 at 14:39
  • 1
    Well, you are right the dependency is not obvious. The jar contains report functions. If I don't use them I wouldn't need the jar. But I use NOT(EQUALS...) and getting errors like: 40. The method EQUALS(String, null) is undefined for the type sickInjuriesClosePerson_1447424887453_582349 value = NOT(EQUALS(((java.lang.String)field_occupation.getValue()), null)); It will compile in studio but not in maven Nov 13, 2015 at 14:56
  • Please update your post with the real problem you have. Post your error, what specifically doesn't compile in Maven...
    – Tunaki
    Nov 13, 2015 at 15:06

2 Answers 2

5
  1. Add the repository

    <repository>
        <id>jr-ce-releases</id>
        <url>https://jaspersoft.jfrog.io/artifactory/jr-ce-releases</url>
    </repository>
    
  2. Add dependency to your project

        <dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports-functions</artifactId>
            <version>6.6.0</version>
        </dependency>
    
0

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

1
  • 2
    I just checked the content of the Jar file. It really contains the package file with some factory and util classes. But it's missing "standard" subpackage with functions like "LogicalFunctions", "MathFunctions" and "TextFunctions". So you are not right here Nov 13, 2015 at 15:26

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.