Jump to content

How to converte String to Long?


debby.st.chui

Recommended Posts

I have a String parameter "2012231211" and want to convert as Long data type for the SQL statement.

I had tried add a new parameter and set the default value expression as ($P{field}.matches("[0-9]+") ? new java.lang.Long($P{field}) : new java.lang.Long(0))

However, I got the following errors. "Error filling print... java.lang.String cannot be cast to java.lang.Long"

How can I convert the String to Long ? 

p.s I cannot set the parameter as Long data type. 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • 1 month later...

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