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.