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

Casting field to real class


2005 IR Help

Recommended Posts

By: kmusa - kmusa

Casting field to real class

2004-11-16 09:00

How do I cast a field to its real class? Is there any example maybe? The docs say that it is possible, but i didn't find any example...

 

If I have a field named 'fieldOne' of type 'mypackage.TypeOne'.

The Jasper gets it as java.lang.Object.

I drag the text field to my report and set its expression to ((mypackage.TypeOne)$F{fieldOne}).getSomeFieldFromTypeOne().toString()

 

This results in ClassCastException... Could someone point me in the right direction or tell me this is not possible...

 

 

 

 

By: cristales - cristales

RE: Casting field to real class

2004-11-22 13:38

you must put the jar file (with your package) in the class path of the compiler of jasperreports. If your are using iReports the locations is iReportsxxlib.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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