set date format

By: Tzanko - tsanstef
set date format
2002-09-25 08:11
hi,

another question.
I found out that I get a DateFormat error in the evaluate method of the object that Jasper creates.
Is there a way to set the DateFormat? And how.
My date format is dd/mm/yy (ex 25/09/02).
It used to work fine with my previous format but we changed the format in the DB istself.
Thank You


By: Teodor Danciu - teodord
RE: set date format
2002-09-26 07:22

Hi,

If I understand correctly, you have declared your
report field as java.util.Date, even if in the database
it is stored as VARCHAR or something, using
a particular date format.
And the engine fails to create a java.util.Date
object for your field because it does not recognize
the format of the data in the database.

If this is the case, I suggest you declare the field
as java.util.String and to convert it into
java.util.Date you can use a report variable in which
you can specify the format.

I hope this helps.
Teodor
2001 JI Open Discussion's picture
Joined: Aug 10 2006 - 3:26am
Last seen: 17 years 1 month ago

0 Answers:

No answers yet
Feedback