Jump to content
Changes to the Jaspersoft community edition download ×

Built in functions not working on 8.1.1


nicknxswart.nl

Recommended Posts

Hi!

I installed jasperserver 8.1.1 and migrated some reports. Only the discrover that the reports on the new server not work because the use build in functions like: DAYSINMONTH.

Any advice on how to fix this, is there a bug in server 8.1.1. or are jar files missing that should be in the default installation but are not there?

 

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Hello! It works fine for me in my basic install of 8.1.1. I created a report with one text field in the title that evaluates that function "DAYSINMONTH(new java.util.Date(03/01/2023))" and when I preview in Studio, it outputs 31. I then published to my JRS 8.1.1 and it also outputs 31 as expected. How are you running it? It IS possible you are missing a jar - we use JODA to calculate most of our time-based built-in functions. Do you have the joda-time-2.2.jar and joda-convert-1.3.1.jar jars in your lib directory? Are you running with JRS or are you using the library directly? I would make sure you have those jars. Good luck!

Link to comment
Share on other sites

I did a clean install on ubuntu 22.04 I have a java.sql.date. So I'm doing: DAYSINMONTH($F{EndDate}) and the EndDate is mapped to a field from a json file with the type java.sql.date. I have both the joda-convert-1.3.1.jar and the joda-time-2.2.jar file in the lib folder. Probably you did not do a linux install right? I will set up a new VPS and install again the latest version and let you know if I have the problem again. If so than the problem is within the linux installer.

 

Link to comment
Share on other sites

Alright just did a new linux installation, created a blank report with only your code and the error that I get:

2023-04-17T17:40:40,510 ERROR SecureExceptionHandlerImpl,pool-9-thread-3:125 - There was an error on the server. Try again or contact site administrators. (Error UID: 2de27cbd-da38-43ba-8204-c01b12afb788). Could not find matching constructor for: java.util.Date(BigDecimal) net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: DAYSINMONTH(new java.util.Date(03/01/2023))

So there is a problem in the linux installation.

The steps I did:

apt-get updatesudo apt install chromium-browserwget -O jasperserver.run "https:/"chmod +x jasperserver.runsudo ./jasperserver.runufw allow 8080cd /opt/jasperreports-server-cp-8.1.1 ./ctlscript.sh start[/code]

Then I call the report by the rest api with a json string cast to the data bundle

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