Jump to content
We've recently updated our Privacy Statement, available here ×

passing object in parameter issue


sinsand

Recommended Posts

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 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

<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 syntax

a. ((xx.xx.xx.xx.OrdersView)$P{latestOrderInstance}).getId()

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.

 

Thanks,

Sandeep

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...