javajasper-reportsireport

Subreport causing infinite loop


I have a report with a subreport and then a subreport within that subreport. Somewhere along the way jasper reports is getting stuck in an infinite loop.

I've looked at the total number of objects I'm passing to it and it is 1 object to the report, which contains an arraylist of 2 objects for the first subreport. Then once inside the first subreport each of the objects passed to it has an additional arraylist with 6 objects in the first and 20 objects in the second, which are then passed to the second subreport.

It seems that it keeps accessing the two objects in the first subreport. Like it just infinitely loops through them, which then causes it to infinitely loop through the arraylist that is in each one.

I've looked through my code in java and nothing seems to be wrong. I've messed with tons of settings on the subreports themselves and the subreport object that links to them but nothing has worked. Any idea what could be going on?


Solution

  • Just from trial and error I've found out that the problem is caused by the detail band in the second subreport. Something about having the fields in there is causing an infinite loop. I put it in the column header band and it fixed it.