debby.st.chui Posted January 27, 2015 Share Posted January 27, 2015 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 More sharing options...
brianbek Posted January 27, 2015 Share Posted January 27, 2015 HiTry "java.lang.Long.parseLong($P{field}, 10)"/Brian Link to comment Share on other sites More sharing options...
Sheng.Maud Posted March 20, 2015 Share Posted March 20, 2015 use the scriptlets 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