如何将字段从主报表传递到表格元素?

编程入门 行业动态 更新时间:2024-10-24 18:17:23
本文介绍了如何将字段从主报表传递到表格元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

直到现在,我都使用列标题的详细信息区域来生成表格.现在,我想在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).

我这样尝试过: iReport:将参数从主报表查询传递到表或列表的数据集查询

但这对我没有用.我想是因为我想传递一个字段而不是一个参数.使用这种方法,我得到一个表,但只有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.

更多推荐

如何将字段从主报表传递到表格元素?

本文发布于:2023-10-30 11:58:42,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1542785.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字段   如何将   报表   表格   元素

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!