How i can to convert a Date that is null to String



I want to put a default text to a field type date that comes null

rene.marquez's picture
Joined: Jun 26 2019 - 9:38am
Last seen: 2 months 3 weeks ago

thanks,!! I have solved my problem   ... lml ...lml

rene.marquez - 1 year 1 month ago

1 Answer:


Just use a simple IfThenElse Expression for your date field (e.g. here without text pattern for a java.util.Date Field, but  instead with a SimpleDateFormat for a plain StringField):

$F{YourDateField} == null ? "no date found": new SimpleDateFormat("dd.MM.yyyy").format($F{YourDateField})

If you have multiple date fields and you just want to define the static text once, you also could use an own parameter (without prompting) with a default expression for your default static text:

$F{YourDateField} == null ? $P{YourDefaultText4NullDates}: new SimpleDateFormat("dd.MM.yyyy").format($F{YourDateField})

Another way could also be a static scriptlet method within a small java proggi that handles your logic on a central point:


so like always: Many ways leading to Rome :-)

hth + regards


C-Box's picture
Joined: Jul 19 2006 - 5:58pm
Last seen: 2 weeks 6 days ago