How to display the current date in a field?

0
By: timtas - timtassonis
How to display the current date in a field?
2004-09-21 01:45
I'd like to display the current date (e.g. 21/09/04) in a field on the output, but found no way to do this, apart from having this value read from a database, or passing it as a parameter to the report. Is there no internal way to do this?







By: Gregory A. Swarthout - gswarthout
RE: How to display the current date in a fiel
2004-09-21 08:14
new SimpleDateFormat("dd/MM/yy").format(new Date())




By: timtas - timtassonis
RE: How to display the current date in a fiel
2004-09-22 01:24
Thanks a lot, but I don't know where to put this in iReport.

Do I have to create a field of type java.lang.String and perhaps put
new SimpleDateFormat("dd/MM/yy").format(new Date())

in the field description?






By: timtas - timtassonis
RE: How to display the current date in a fiel
2004-09-22 02:03
Sorry, found out myself now:

I have to define a variable and put
new SimpleDateFormat("dd/MM/yy").format(new Date())

in the Variable Expression. Works fine now.
2004 IR Help's picture
Joined: Aug 17 2006 - 3:49am
Last seen: 13 years 1 month ago

0 Answers:

No answers yet
Feedback