dheeraj.madhu Posted August 12, 2013 Share Posted August 12, 2013 I am trying to convert a String value to long in jasper report and convert it to Date object. But i always end up getting a class cast exception from String to Long. java.lang.String cannot be cast to java.lang.Number I am trying following code <variable name="date" class="java.util.Date"> <variableExpression><![CDATA[new Date(Long.getLong($F{field}))]]></variableExpression> </variable>[/code] Long.getLong(String s) gives desired output in Java. But when we use same java expression it gives exception in jasper. Does jasper treats primitive java types differently? Link to comment Share on other sites More sharing options...
Solution dheeraj.madhu Posted August 12, 2013 Author Solution Share Posted August 12, 2013 Problem was somewhere else. Solved it. 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