子报告导致无限循环 [英] Subreport causing infinite loop

查看:111
本文介绍了子报告导致无限循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含子报表的报告,然后是该子报告中的子报告。一路走来,jasper报道陷入无限循环。

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.

我查看了传递给它的对象总数,它是报告的一个对象,其中包含第一个对象的arraylist子报表。然后,在第一个子报表内部传递给它的每个对象都有一个额外的arraylist,第一个中有6个对象,第二个中有20个对象,然后传递给第二个子报表。

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.

它似乎一直在访问第一个子报表中的两个对象。就像它只是无限循环遍历它们,然后使它无限循环遍历每个中的arraylist。

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.

我在java中查看了我的代码,没有任何内容似乎是错的。我已经搞砸了子报表本身的大量设置以及链接到它们的子报表对象,但没有任何工作。知道会发生什么吗?

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?

推荐答案

从试错中我发现问题是由于第二个子报告中的细节带。关于在那里使用字段的东西导致无限循环。我把它放在列标题带中并修复它。

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.

这篇关于子报告导致无限循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆