Jump to content
JasperReports Library 7.0 is now available ×

adding date problem


atanupanda

Recommended Posts

Hi

 

 

Actually I can convert string to date datatype.

 

I have a problem with adding some date values. Here below what i have tried.

 

I have created a variable 'parse' with class type java.text.SimpleDateFormat and variable expression new SimpleDateFormat("HH:mm a MMM dd, yy") .

 

Then i created a variable 'dat' with class type java.util.Date and varible expression $V{parse}.parse($F{LAST_COMPUTED}) where $F{LAST_COMPUTED} is a field value (it's a string as example '12:30 am Jan 2nd, 07').

Now i can get this string as a date type varible in $V{dat}.

 

Now i want to add/subtruct some day/month/year/week or hour/minute/second with this $V{dat} varible and want to store in another varible .

The adding value may be 1 hour,2 hour, 1 weeks, 2 weeks, 3 months, 4 months in this way.

That i can't do in iReport.Please help me on that. Actually in java, using calender class(using add() and set() method) i can do it. But i want to calculate it in iReport(i am using Ver. 1.3.0).

 

Also in iReport I created another variavle 'calender'with class type java.util.Calendar and value expression Calendar.getInstance(). I know that it shows the current datetime value.. Actually i thought that using calender i can do it . But i am in vein.

If any one can't under stand my requirement please reply.

Please help me to short out this problem in iReport.

 

Thanks in advance.

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