How to pass fields from main report to table element?

佐手、 提交于 2020-01-03 17:12:20

问题


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).

I tried it this way: iReport: Passing parameters from a main report query to a dataset query for a table or list

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).

I'am using JRMapCollectionDataSource.

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


回答1:


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

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

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.

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.



来源:https://stackoverflow.com/questions/13345607/how-to-pass-fields-from-main-report-to-table-element

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!