I'm trying to pull the selected date value from filter in Jasper Server but getting the error running report.
So, If someone had experienced this kind of issue, please help
It works fine with java.lang.String or java.util.Collection Java Class when it a dropdown or multiselect.
Uploading some screenshots, so if someone has an idea, it would be great.
Thanks in andvance,
so the first thing I've figured is that the parameter class should be: net.sf.jasperreports.types.date.TimestampRange
After that I get a value display like: net.sf.jasperreports.types.date.FixedTimestamp@c77faa
How to convert this to TimeStamp format?
This post may help you.
The link doesn't work, I get an Unauthorized message on the page.
Figured it out,
1. Create new parameter with the same name as inputControl under AdHoc (ex. open_date_1)
2. Set the class of the parameter net.sf.jasperreports.types.date.TimestampRange
3. Drag and drop eariler created parameter to report canvas, douple click to open Expression Editor and add at the end .getStart() function (ex. $P(open_date_1).getStart())
4. Select the field of the parameter, on the right open tam TextField and add needed TimeStamp pattern (ex. dd.MM.yyyy HH:mm)
If you created a between filter (ex. open_date_start and open_date_end), then you'll have two parameters (ex. open_date_1 and open_date_2).
Do the same thing as described earlier and you will display the selected values from filter like:
Selected start date: $P(open_date_1).getStart()
Selected end date: $P(open_date_2).getStart()
Hope that it would help somebody,