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

days function does not work when integrate with web java code


wangmin2001

Recommended Posts

HI, I am using jasper5.6.1 in win7,jdk1.7, I use days function in studio to calculate date diff between min_date and max_date, such as :

days($V{min_date},$V{max_date})

it works fine in studio, but when I called it from web java application, it always return me following error:

net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression :
    Source text : DAYS($V{min_date},$V{max_date})

I also encountered another IF experession error,

 

I doubt it's java issue, and I check my report language setting, it's "JAVA".

if I cannnot use system function, I have to pass all calculated varibles from outside application, it's too complex.

could you give me some suggesiton? thanks!

 

 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

I have to add my update info:

I  I changed report language to groovy from java, and add groovy class into classpath, now it return me :

net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression :
    Source text : ABS($F{QUANTITY})

it seems that I canno use any build-in fuctions in japer studio, inlcude:  IF-else, ABS, Days.

I found it's becuase there is no jasper mathfuction class. I search all folder, found there have classes at sample folder, I add them, then pass!

conclusion: I do not know why jasper do no package mathfunction into jasper lib, but, if you want to use it, you have to include it mannualy.

 

 

 

 

 

Link to comment
Share on other sites

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...