Jump to content
Changes to the Jaspersoft community edition download ×

How do I use a date/time input control with visualize.js (6.0.1)


Go to solution Solved by tyson.decker,

Recommended Posts

I have a report that has a date/time input control, when I try to run the report using visualise.js I get an input control error. 

input.controls.validation.error : Input controls validation failure ["Specify a valid value for type Timestamp."]

The value I pass follows the format 'year-month-day hours-minutes-seconds' (ex. '2015-03-20 23:59:59'). so my parameter looks like this

var jasperParams = {    ...    endDate:['2015-03-20 23:59:59'],    ...}

I tried passing in a timestamp and got the same problem. 

If I change the input control to type Date it works fine, but I need it to be type date/time.

Am I using the right format? I have only experienced this issue after upgrading from Jasper Reports Server 5.6 to Jasper Reports Server 6.0.1 so I assume I am using the correct format because it worked in version 5.6

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Checking the jasperserver_config.properties file, the datetime.format is yyyy-MM-dd HH:mm:ss and it hasn't changed since i upgraded

Furthermore, validation.datetime.pattern=/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}$/ which correctly matches the format i'm using. 

If anybody can help i'd really appreciate it.

 
Link to comment
Share on other sites

  • Solution

I was able to solve this by looking in the result from calling v.inputControls()

The validation object on the input control shows the pattern is "yyyy-MM-dd'T'HH:mm:ss"

changing my parameter from endDate:['2015-03-20 23:59:59'] to endDate:['2015-03-20T23:59:59'] solved the problem.

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