2005 IR Help Posted August 27, 2006 Share Posted August 27, 2006 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 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