Problem Description:
When creating an Ad Hoc date or timestamp filter in the Ad Hoc designer, you enter a date or timestamp, you see the following error:
! Invalid timestamp. Use relative date keywords or correct timestamp format.
! Invalid date. Use relative date keywords or correct date format.
Either you had entered a date in incorrect format, or there is an error in the configuration. We are addressing the latter possibility here.
Solution:
If you had changed the configuration file jasperserver_config.properties files to support a certain date or timestamp format and it is not behaving as expecting. You might have made a mistake in the configuration. Note that in the configurations above the comments block, y represents 1 digit. After the comments, y represents 2 digits. Check and be sure that you have entered the correct number of y's for the year format. For example,
For a 2-digit year case:
date.format=MM/dd/yy datetime.format=MM/dd/yy HH:mm:ss time.format=HH:mm:ss calendar.date.format=mm/dd/y calendar.datetime.format=mm/dd/y HH:mm:ss calendar.time.format=HH:mm:ss validation.date.pattern=/^\\d{2}\/\\d{2}\/\\d{2}$/ validation.datetime.pattern=/^\\d{2}\/\\d{2}\/\\d{2}\\s\\d{2}:\\d{2}:\\d{2}$/ validation.time.pattern=/^\\d{2}:\\d{2}:\\d{2}$/
For a 4-digit year case:
date.format=MM/dd/yyyy datetime.format=MM/dd/yyyy HH:mm:ss time.format=HH:mm:ss calendar.date.format=mm/dd/yy calendar.datetime.format=mm/dd/yy HH:mm:ss calendar.time.format=HH:mm:ss validation.date.pattern=/^\\d{2}\/\\d{2}\/\\d{4}$/ validation.datetime.pattern=/^\\d{2}\/\\d{2}\/\\d{4}\\s\\d{2}:\\d{2}:\\d{2}$/ validation.time.pattern=/^\\d{2}:\\d{2}:\\d{2}$/
Recommended Comments
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