cs_9 Posted September 30, 2020 Share Posted September 30, 2020 Hi,since updating to a new jasper version (docker: bitnami/jasperreports:7-debian-10) several Reports are not working any more.The Problem seems, that the following instruction (+90) is not being parsed properly any more:<parameter name="to" class="java.util.Date"><defaultValueExpression><![CDATA[($P{to} == null ? new Date() + 90 : $P{to})]]></defaultValueExpression></parameter>[/code]I am pretty new to jasperreports. I have tried several possible solutions with no success. Here a few error Messages i got:ERROR GenericExceptionMapper,http-nio-8080-exec-3:69 - Unexpected error occurs net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: ($P{to} == null ? new Date().plusDays(90) : $P{to})ERROR GenericExceptionMapper,http-nio-8080-exec-5:69 - Unexpected error occurs net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: ($P{to} == null ? new Date() + 90.days : $P{to})ERROR GenericExceptionMapper,http-nio-8080-exec-1:69 - Unexpected error occurs net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: ($P{to} == null ? new Date().set(year, month, date +90, hrs, min, sec) : $P{to})ERROR GenericExceptionMapper,http-nio-8080-exec-6:69 - Unexpected error occurs net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: ($P{to} == null ? new Date().add(0,0,90,0,0,0) : $P{to})ERROR GenericExceptionMapper,http-nio-8080-exec-10:69 - Unexpected error occurs net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: ($P{to} == null ? new Date().add(Calendar.DATE, 90) : $P{to})ERROR GenericExceptionMapper,http-nio-8080-exec-8:69 - Unexpected error occurs net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: ($P{to} == null ? new Date(Instant.now().plus(90,ChronoUnit.DAYS)) : $P{to})ERROR GenericExceptionMapper,http-nio-8080-exec-9:69 - Unexpected error occurs net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: ($P{to} == null ? new Date().addDays(5) : $P{to})[/code]I would appreciate if someone could help me how to fix the "+ 90" (days) issue, to make my report work again with the new jasperserver version.Thanks in advance! Link to comment Share on other sites More sharing options...
mlopez_1 Posted October 1, 2020 Share Posted October 1, 2020 You must set groovy language at Report Unit Mariano Link to comment Share on other sites More sharing options...
cs_9 Posted October 1, 2020 Author Share Posted October 1, 2020 Thank you for your help Mariano.Sadly i am very new to jasperserver and jasperstudio.As is understand it, it should automatically be able to parse groovy and javascript. (There is a related issue https://community.jaspersoft.com/jasperreports-server/issues/12581)I do not know where i would set groovy language at Report Unit.May you be so kind to elaborate.Thanks in advance. Link to comment Share on other sites More sharing options...
mlopez_1 Posted October 2, 2020 Share Posted October 2, 2020 Open a Report Unit and set Properties -> Report -> Language -> Groovy Link to comment Share on other sites More sharing options...
cs_9 Posted October 2, 2020 Author Share Posted October 2, 2020 I cant seem to find it. I use Jaspersoft Studio 6.14.0. When I open the properties for the report unit I get this window:i can switch to here (so it seems to be the "report unit" which you are talking about):the only place where i can find "language" is here in the query and it does not offer "groovy":also in the expression editor when i open the window to the deprecated (backwards compatibility) window, there seems to be a "groovy evaluator" active: Link to comment Share on other sites More sharing options...
mlopez_1 Posted October 2, 2020 Share Posted October 2, 2020 You have to open the Report Unit with Jaspersoft Studio for editing. Link to comment Share on other sites More sharing options...
cs_9 Posted October 2, 2020 Author Share Posted October 2, 2020 I'm sorry I don't catch on quicker.I don't know how to open it any other way than i already did.I can run the report unit or select properties in which case i get the window already shown abovethere is no help topic "report unit":can you maybe point me to any applying documentation, to help me out on "how to open a report unit in jasperstudio"? Thanks!PS: I do know how to open the report to edit. There is Design, Source and Preview tab. But that can't be what you mean... Link to comment Share on other sites More sharing options...
ralph_3 Posted October 5, 2020 Share Posted October 5, 2020 Start on the top of the outline at the bottom left of the window. Select "Show properties". The properties will come up on the bottom right of the window. The language is one of the properties. Link to comment Share on other sites More sharing options...
cs_9 Posted October 7, 2020 Author Share Posted October 7, 2020 Hey, i finally managed to get the properties window you were talking about...What information i was missing is... i had to click in the design view into the background of the form for the said properties window to show.I found out, it is already set to groovy. So what else may be the problem here? Link to comment Share on other sites More sharing options...
cs_9 Posted March 4, 2021 Author Share Posted March 4, 2021 The problem still persists.Does no one have any idea what i could do to fix it? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now