sinsand Posted April 3, 2014 Share Posted April 3, 2014 HI All,I am trying to pass object in parameter and trying to access its value but i am getting casting exception, the language is groovySteps that i followed1. passed the object in parameterparams.latestOrderInstance = latestOrderInstancehere latestOrderInstance is the variable name and the object is orderview.2. In the jrxml i have put the parameter name as latestOrderInstance and its class as orderview.<parameter name="latestOrderInstance" class="xx.xx.xx.xx.OrdersView" isForPrompting="false"/>i have also imported the class<import value="xx.xx.xx.xx.OrdersView"/>3. when i am trying to use the getter of that class it is giving me casting exception,I have tried syntaxa. ((xx.xx.xx.xx.OrdersView)$P{latestOrderInstance}).getId()I am trying to display this in the textField, i have also put its expressionclass as orderviewThe exception i am getting isCannot cast object 'xx.xx.xx.xx.OrdersView : 354' with class 'java.lang.String' to class 'xx.xx.xx.xx.OrdersView'.i have used scriptlet in some other report and they are using the same syntax and they are working fineCan anyone suggest what is wrong or how can i call getters of an object. Thanks,Sandeep 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