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

Date filter not working in Ad Hoc editor when absolute date is in MM/DD/YYYY format


dja248

Recommended Posts

We are seeing an issue with date filters in the Ad Hoc editor in Jasper Server 5.1.0.

 

We had a need to change the default date format to MM/dd/yyyy so we did that by modifying jasperserver_config.properties.

 

Now, when an absolute date is provided in a filter an Exception is thrown and the filter ends up not being applied.  This only happens if the date is an absolute date, ie: 07/22/2013.  Relative values like MONTH and YEAR work fine in the date filter.

 

Here is a sample stack trace.

 

Caused by: net.sf.jasperreports.types.date.InvalidDateRangeExpressionException:

Invalid date range expression: 10/01/2012

        at net.sf.jasperreports.types.date.RelativeDateRange.validateExpression(RelativeDateRange.java:82)

        at net.sf.jasperreports.types.date.RelativeDateRange.<init>(RelativeDateRange.java:68)

        at net.sf.jasperreports.types.date.DateRangeBuilder.toDateRange(DateRangeBuilder.java:223)

        at com.jaspersoft.jasperserver.api.common.util.rd.DateRangeFactory.getInstance(DateRangeFactory.java:72)

        at com.jaspersoft.jasperserver.api.common.util.rd.DateRangeFactory.getInstance(DateRangeFactory.java:58)

        at com.jaspersoft.jasperserver.api.common.util.rd.DateRangeFactory.getInstance(DateRangeFactory.java:42)

        at com.jaspersoft.commons.dataset.expr.ExpressionJSONConverter.getDateExpression(ExpressionJSONConverter.java:519)

        at com.jaspersoft.commons.dataset.expr.ExpressionJSONConverter.createExpressionObject(ExpressionJSONConverter.java:197)

        ... 105 more

 

Any thoughts on what may be going wrong?  Thanks!

 

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • 1 month later...

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