rene.marquez Posted June 26, 2019 Share Posted June 26, 2019 I want to put a default text to a field type date that comes null Link to comment Share on other sites More sharing options...
Solution C-Box Posted June 27, 2019 Solution Share Posted June 27, 2019 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})[/code]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})[/code]Another way could also be a static scriptlet method within a small java proggi that handles your logic on a central point:YourScriptletClass.getDateOrText($F{YourDateField})[/code]so like always: Many ways leading to Rome :-)hth + regardsC-Box Link to comment Share on other sites More sharing options...
rene.marquez Posted June 28, 2019 Author Share Posted June 28, 2019 thanks,!! I have solved my problem ... lml ...lml Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now