将字段值传递给子报表或列表

pass field value to subreport or list

我正在使用 jasperreport 6.5.1,我想在每个页面中显示员工详细信息和访问地址列表。 我有 2 个表 employee {id, name, firstName...}visited_addresses{id, name, id_emp...}

我首先尝试使用 jasper sub_report 元素,但我没有找到如何传递我想获取其访问地址的员工的 ID

然后我尝试使用列表元素,但我遇到了同样的问题。 如何将 id 字段传递到我的 sub_report 或我的列表?

可以在主报表中select查询员工 ID,然后将其作为参数添加到子报表中。

解决方案说明here - iReport 的版本应该没有区别。

基本上它说:

Click on sub report. in the properties section got to parameters. and add the parameters which you want communicate through main report to subreport.