fwhorton Posted February 19, 2007 Share Posted February 19, 2007 Hello All: I am trying to create a report (environment: Oracle, Hibernate, Spring, iReport). Maybe this is in creating a report 101 but I did not see it. Sorry to write so much but I wanted to be clear. I am selecting from the "project" table and trying create a java.lang.Long field "manager.peopleId" which "manager" is a foriegn key to the "peopleId" field within the "people" table and get a Null property value for 'manager' java.lang.IllegalArgumentException: Null property value for 'manager' when I try to print the field but the report compiles. So I change "manager.peopleId" field expression to: ($F{manager.peopleId}==null ? (new Long(0)) : (new Long(1))) And I still get a Null property value for 'manager' java.lang.IllegalArgumentException: Null property value for 'manager' when I try to print the field but the report compiles. So I delete the "manager.peopleId" field and create a "manager" field with class type com.thesdg.capitalvision.data.org.People, change expression class to java.lang.String, and change the field expression to: ($F{manager}!=null ?$F{manager}.getPersonFirstName() + " " + $F{manager}.getPersonLastName() :"") Now I receive the following Check Expresion Error: Sourced file: inline evaluation of: ``(((com.thesdg.capitalvision.data.org.People)field_manager.getValue())!=null ?(( . . . '' : Class: com.thesdg.capitalvision.data.org.People not found in namespacecom .thesdg .capitalvision .data .org .People Line: 1 I cannot compile the file with the error: Errors compiling C:Documents and SettingsFred WhortonMy DocumentsWorkBenchcapvisWebRootreportsProjectContract.jasper. net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:1. com.thesdg.capitalvision.data.org.People cannot be resolved to a type value = (java.lang.Long)((((com.thesdg.capitalvision.data.org.People)field_manager.getValue())!=null But the report now displays the information... Any help is greatly appreciated. fw. Link to comment Share on other sites More sharing options...
fwhorton Posted February 20, 2007 Author Share Posted February 20, 2007 I figured it out... I created an field "manager" with class type java.lang.Object. Then I created a method toString() within the hibernate class to return the information I was looking for. ($F{manager}!=null ? $F{manager}.toString() :"") 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