如何将字段从主报表传递到表格元素? [英] How to pass fields from main report to table element?

查看:55
本文介绍了如何将字段从主报表传递到表格元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

直到现在,我都使用列标题的详细信息区域来生成表格.现在,我想在iReport(4.0.2)中使用表格元素.

Until now i used the column-header an detail band to generate tables. Now i want to use the table element in iReport (4.0.2).

我这样尝试过:但这对我没有用.我想是因为我想传递一个字段而不是一个参数.使用这种方法,我得到一个表,但只有1行(需要为17).

But it didn't worked for me. I think because I want to pass a field and not a parameter. With this method, I get an table, but only with 1 row (need to be 17).

我正在使用JRMapCollectionDataSource.

I'am using JRMapCollectionDataSource.

如何在表格中显示我的整个值集?

How can I show my whole set of values in the table?

推荐答案

在表的数据集中设置参数时,可以映射字段以传递给该参数.

When you set up a parameter in the dataset for the table, you can then map a field to pass to that parameter.

例如,在主查询中,我选择了WIDGET和THINGAMABOB字段.

As an example, in my main query I select fields WIDGET and THINGAMABOB.

在数据集查询中,我添加了一个名为WIDGET的参数和一个名为THINGAMABOB的参数.编辑表的表数据源时,请转到参数",然后单击添加".对于数据集参数名称,选择刚添加到数据集中的参数.对于值表达式,选择字段",然后选择要映射到该参数的字段(在这种情况下,来自主查询的字段WIDGET将映射到数据集中的WIDGET参数).然后,您可以在表中使用这些参数,就像它们是字段一样,它们将使用主报表中的字段值.

In my dataset query, I add a parameter called WIDGET and a parameter called THINGAMABOB. When you edit table datasource for the table, go to Parameters, and click add. For the Dataset parameter name, select the parameter that you just added to the dataset. For the value expression, select "Fields" and then select the field you want mapped to that parameter (in this case, the field WIDGET from the main query would be mapped to the WIDGET parameter in the dataset). You can then use those Parameters within the table as though they were fields, and they will use the field values from the main report.

如果您将表格放在明细栏中,那么它将为每个字段值(WIDGET和THINGAMABOB)运行该表格,您将看到是否将这些字段放入主报表的明细栏中.

If you've put the table in the detail band, it will now run that table for each field value (WIDGET and THINGAMABOB) that you would see if you were to put those fields into the detail band of the main report.

这篇关于如何将字段从主报表传递到表格元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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