Jump to content
We've recently updated our Privacy Statement, available here ×

import of static methods


nostro

Recommended Posts

Hi

 

I want to import a static method doit(Timestamp time) from the class com.core.report.Util to be use in a report. So I added this to the report:

 

<import value="com.core.report.Util" />

 

and used it within a textField like:

Util.doit($F{time})

 

But iReport doesn't compile and throws an exception:

 

net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: 1. Only a type can be imported. com.core.report.Util resolves to a package import com.core.report.Util; <--------------------------------------------------------------------------------------> 2. Util cannot be resolved value = (java.lang.String)(Util.doit(((java.sql.Timestamp)field_time.getValue())));

 

 

I also set the classpath in iReports and played around with the compiler options.

 

However, if I use that in my own application it works fine.

Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...