Jump to content
We've recently updated our Privacy Statement, available here ×

How to calculate the age?


ktrinad

Recommended Posts

By: Marcelo - mike81

How to calculate the age?

2003-11-10 08:27

Hi.

 

How to calculate the age of a person with iReport?

 

Is this possible?

 

 

 

 

By: Giulio Toffoli - gt78

RE: How to calculate the age?

2003-11-10 15:10

 

Go to menu tools->calculate age.

 

This function will be return a random number that can be used to play bingo.

 

Giulio

 

 

 

 

 

By: Marcelo - mike81

RE: How to calculate the age?

2003-11-11 09:05

Thank's for your answer, but, how to can i make to calculate the age since with a range of dates i have two fields (date1 and date2), or better even how to calculate the difference of days between a date and other?

 

thank's.

 

 

 

 

By: Giulio Toffoli - gt78

RE: How to calculate the age?

2003-11-12 15:06

 

This is a "castom" elaboration of data and can be done i.e. in this way:

 

write a class...

 

public Foo {

 

static Integer calculateDiff( java.sql.Date d1, java.sql.Date d2)

{

.... your java code to calculate difference....

 

 

return resultDiffDays;

}

 

}

 

 

You can use the class Foo in your expressions with a syntax like this:

 

Foo.calculateDiff( $P{Mydate1}, $P{MyDate2})

 

 

Enjoy

 

Giulio

 

 

 

 

By: Sachin Aggarwal - sk_aggarwal

RE: How to calculate the age?

2003-11-12 17:57

Giulio,

Just a small doubt, once such a class is written how can we include it in our design.

Sachin

 

 

 

 

By: Giulio Toffoli - gt78

RE: How to calculate the age?

2003-11-13 04:46

 

If the class is in the classpath, you have nothing to do.

 

Note that you maste reference your class with full package name...

i.e.

 

it.businesslogic.util.MyCustomFormatter.format($F{MyData});

 

Giulio

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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