Jump to content
Changes to the Jaspersoft community edition download ×

Built-in Date and Time Functions not working


sabmoonie

Recommended Posts

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.
[/code]
// ===================== 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)
Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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.

 

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