I have an interesting problem with subreports.
For my application, I have a master report, with 7 subreports, all of which
are optional. Of the 7 subreports, 3 can be arrays of data, where the
subreport is called multiple times.
For example, I am doing an HR application, and generating reports for
employees. For a given employee, this person may have no dependents, or any
number of them. The master report corresponds to the employee and one of the
subreports corresponds to dependents. If I create a report showing all data,
then everything comes out fine. If I create a custom report that shows only
a subreport that only displays once, like an employees salary, then
everything displays correctly. If I do a combination like salary and
dependents, then everything shows up fine. But if I try to do a report using
only a subreport that can get executed multiple times, like dependents, then
the report will not compile.
My catalina.out file states that the following exception:
net.sf.jasperreports.engine.JRException: Report design not valid :
1. Field not found : depData
where depData is my JRBeanArrayDataSource for that subreport. I do not
understand why it works for each report where the Object used to make the
JRBeanArrayDataSource is of size 1, but anything larger than size 1 crashes.
can anyone understand my problem?
did anyone actually read all that?