将JRBeancollection数据源传递给主报告和子报告 [英] Passing JRBeancollection datasourse to master report and subreport

查看:71
本文介绍了将JRBeancollection数据源传递给主报告和子报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将JRBeancollection数据源传递给主报告,并从主报告传递给子报告..我已将此子报告包括在主报告的摘要部分中. 请提及我要在ireport中执行的步骤,包括inbuld参数的设置方法.

I want to pass the JRBeancollection datadourse to main report and from main report to subreport.. I have included this subreport in summary section of master report.. please mention the steps i want to do in ireport including the inbuld parameters how to set.

推荐答案

最后我完成了.

实际上,数据源不在子报表中.因此,我更改了以下属性:什么时候所有部分都没有数据,没有数据...

Actually datasource was not going in subreport. So I have changed the property of when no data to all sections, no data...

然后,我在获取子报表记录的地方传递了collection变量.

Then I have passed the collection variable where I have fetched the subreport records.

通过使用parameters.put("shape_data_all", allShape_Caliberation);

然后,我在主报表中创建了一个参数.并将其类更改为java.Util.Collection.

Then I have created a parameter in main report. And changed its class to java.Util.Collection.

然后在subreport属性中,connection type=使用数据源表达式

Then in subreport property, connection type= Use a datasource expression

数据源表达式new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{shape_data_all})

然后在子报表中添加与我具有bean属性相同的字段.

Then added the fields in the subreport same as I am having the bean properties.

谢谢.

这篇关于将JRBeancollection数据源传递给主报告和子报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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