I am trying to pass object in parameter and trying to access its value but i am getting casting exception, the language is groovy
Steps that i followed
1. passed the object in parameter
params.latestOrderInstance = latestOrderInstance
here 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
3. when i am trying to use the getter of that class it is giving me casting exception,I have tried syntax
I am trying to display this in the textField, i have also put its expressionclass as orderview
The exception i am getting is
Cannot 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 fine
Can anyone suggest what is wrong or how can i call getters of an object.