Does anyone know what ‘Parameter Class’ a parameter within IReport must be when I transfer a Servoy (Javascript) datetime value through the parameter ‘parameters’ of runReport.
I’m know getting JasperReport type errors when accessing the datetime parameter.
Thanks, but I need a java.sql.Timestamp because I use the datetime parameter in the report SQL query. A java.util.Date throws an error when the report SQL runs…
Do you know a workaround in Servoy or in I-Report (JasperReport) ?
If I make the parameter type java.util.Date then I get following error within I-Report :
Caused by: java.lang.ClassCastException: java.util.Date cannot be cast to java.sql.Timestamp at saldi32balans_1283947499421_609992.evaluate(saldi32balans_1283947499421_609992:380) at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:182)
I’ll test the string option but I still need a java.util.Date for easy/nice displaying/printing of that date value itself…
@Thomas : Yes, I did use {} (typo in message) @Thomas : Your var date_range_start_as_timestamp = new java.sql.Timestamp(date_range_start.getTime()) looks very promising ! I’m gonna test it… The java.sql.Timestamp parameters work very good in the sql query and you can use that parameter without de ! (bang). Thanks a lot !
@Jeff : Thanks for the info. I tested this afternoon already with $P**!**{start_date} and when start_date is a String parameter (‘yyyy-MM-dd’) then
I’m currently couldn’t get the SQL query working with a date parameter for the jasperreport. It would be very nice if you could explain your parameter properties and Servoy functions if your solution is still running.
In iReport (v. 4.6.0) I tried the parameter settings of $P{DATE_FROM} and $P{DATE_TO} as java.sql.Timestamp, java.util.Date and java.lang.String. I also tried the date formatting hints in this topic, but I always get errors and the report does not generate.