Jump to content
JasperReports Library 7.0 is now available ×

Simple operation/expression in IReport


2004 IR Help

Recommended Posts

By: Nishant Miglani - nishantm

Simple operation/expression in IReport

2004-03-24 08:12

Hi,

 

I need to perform a (hopefully) simple operation.

 

I have a field named "dueDate" which is a java.util.Date object. I have another field named "maxDelayDays" which is a java.lang.Integer object.

 

Now, I need a third field which is a sum of the two named "latestDueDate", and an instance of java.util.Date.

 

How do I do this in IReport?

 

Thanks

 

 

 

 

By: Gregory A. Swarthout - gswarthout

RE: Simple operation/expression in IReport

2004-03-24 08:47

new Date((long)($F{dueDate}.getTime() + ($F{maxDelayDays).intValue() * 1000 * 60 * 60 * 24)))

 

 

 

 

By: Nishant Miglani - nishantm

RE: Simple operation/expression in IReport

2004-03-24 09:07

Thanks Gregory.

 

Now, do I set this as part of the "Textfield expression" or the "Print when expression" of the field?

 

 

 

 

By: Gregory A. Swarthout - gswarthout

RE: Simple operation/expression in IReport

2004-03-24 10:22

That depends on how you want to use it. If it is going to be displayed as another field in the detail, make it a variable and then refer to it in a textfield expression.

 

 

 

 

By: Nishant Miglani - nishantm

RE: Simple operation/expression in IReport

2004-03-25 10:18

Thanks Gregory!

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