Built-in Date and Time Functions not working

0

Hi all!

I am trying to get the difference between two DateTime objects for me to get a Person's age. I tried using YEARS() but then I encounter this problem.

. The method YEARS(DateTime, DateTime) is undefined for the type Overage32List32Report_1437995612351_291145
                value = YEARS(((org.joda.time.DateTime)field_birthdate.getValue()),((org.joda.time.DateTime)parameter_AsOfDate.getValue())); //$JR_EXPR_ID=20$
 
According to the DateTimeFunctions.java, my arguments should be accepted.
 
// ===================== YEARS function ===================== //
/**
* Returns the number of years between two dates.
*/
@Function("YEARS")
@FunctionParameters({
@FunctionParameter("startDate"),
@FunctionParameter("endDate")})
public Integer YEARS(Object startDate, Object endDate){
I already tried adding to build my project with jasper report 6.0.0 but it is still not working.
Kindly help guys T______________T
(sorry if i dont know how to put on a frame the codes)
sabmoonie's picture
Joined: Jul 3 2015 - 3:02am
Last seen: 2 years 7 months ago

1 Answer:

0

I was able to kinda fix this problem but not by using Jaspersoft. As I've read on other posts, it was said that this method is really currently not working on Jaspersoft. 

What I did on Eclipse was I created an object to hold the necessary data including the computation of Person's age.

 

sabmoonie's picture
Joined: Jul 3 2015 - 3:02am
Last seen: 2 years 7 months ago
Feedback
randomness