I am getting error in iReport when during subreport compilation:
Errors compiling E:\workspace_new\kidslake\src\main\resources\admissionForm_sub_1.jasper!
Compilation exceptions: com.jaspersoft.ireport.designer.compiler.ErrorsCollector@28f84e61
net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
1. The method getFullName() is undefined for the type Object
value = ((java.lang.Object)field_director.getValue()).getFullName(); //$JR_EXPR_ID=17$
2. The method getFullName() is undefined for the type Object
value = ((java.lang.Object)field_director.getOldValue()).getFullName(); //$JR_EXPR_ID=17$
3. The method getFullName() is undefined for the type Object
value = ((java.lang.Object)field_director.getValue()).getFullName(); //$JR_EXPR_ID=17$
3 errors
at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:204)
at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:512)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
My bean class is like
class Mainclass{
private List<AdmissionForm> admissionForm;
//getter
//setter
}
class AdmissionForm{
private Director director;
//getter
//setter
}
class Director{
private String fullName;
//getter
//setter
}
I am passing JRBeanCollectionDataSource
as list of MainClass
in my main report
I defined subreport and pass field like
new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{admissionFormList})
I define to access director fullname property in my subreport
$F{director}.getFullName()
but when i compile main report or subreport getting the error above.
Help me to resolve my issue
You can do one of the following:
director
report field to Director
(full/qualified class name). Apparently the current field type is java.lang.Object
director.fullName
and use the field directly instead of $F{director}.getFullName()