Jump to content

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


hervefranck1

Recommended Posts

I have this expression to display a date : 

($F{debut}== null ? " " :  DATEFORMAT($F{debut},"dd/MM/yyyy HH:MM"))

The problem is when the value of the date is null , there is an error message:

"Java.lang.string cannot be cast to java.util.date" 

Even if i fill a message in my first condition, the same error appears.  

 

 

Link to comment
Share on other sites

  • 1 month later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Check the return type of the variable/parameter you are defining the expression on...you may be returning a string here but the variable or parameter type is Date.  The return type needs to match the variable/parameter type to cast correctly.  

 

Thanks.

Link to comment
Share on other sites

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