iReport:将参数从主报表查询传递到表或列表的数据集查询 [英] iReport: Passing parameters from a main report query to a dataset query for a table or list

查看:649
本文介绍了iReport:将参数从主报表查询传递到表或列表的数据集查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我理解如何将参数从主报表传递到子报表,因为在子报表对象中有一个特定的字段。但是,我想将表或列表对象作为使用者(而不是子报表)执行相同的操作。是否可能?

I understand how to pass parameters from a main report to a subreport, since there's a specific field for this in the subreport object. However, I'd like to do the same thing with a table or list object as a consumer (rather than a subreport). Is it possible?

例如,假设我有一个'customerID'参数,我可以使用主报表查询填充,但我似乎无法传递此信息表的数据集的SQL查询的参数。

For example, say I have a parameter of 'customerID' that I can populate with a main report query, but I can't seem to pass this parameter to the table's dataset's SQL query.

我已经尝试过,并继续尝试各种参数,字段和变量组合,但无济于事。

I've tried, and continue to try, various combinations of parameters, fields, and variables, but to no avail.

这类事情是否需要子报表实现?

Does this sort of thing require a subreport implementation?

(如果重要且不明显,我' m使用JDBC)

(If it matters and isn't obvious, I'm using JDBC)

推荐答案

将参数从主报告传递到表或列出 iReport 3.6.7+中的数据源,您需要执行以下步骤:

To pass the parameters from main report to the table or list datasources in the iReport 3.6.7+, you need to do following steps:

1)在主报表中创建所需参数右键点击主报表的参数部分------>添加参数-------->设置属性(数据类型)新添加的参数到您想要的参数。

1) create required parameters in the main report by right clicking on the parameters section of main report------> add parameter-------->set the properties (data type) of newly added parameter to your desired one.

2)在表格/列表的数据源参数部分中创建等效参数,与步骤1完全相同。

2) create equivalent parameters in the table/List's data source's parameters section exactly as in step 1.

3),右键点击表点击编辑表数据集 ------> 选择参数选项卡 -----------> 点击添加 ----------> 选择参数 (您在步骤1的数据集参数部分中创建的)来自上部组合(即数据集参数名称)------>然后点击下方按钮(即)分配值表达式,即您在步骤1中添加的参数。

3) from report explorer, right click on the table and click on Edit Table DataSet ------> Select the parameters tab ----------->Click on add ---------->Choose the parameter (which you created in the dataset's parameter section in step 1) from upper combo (i.e. Dataset parameter name) ------> then click on lower button (i.e.) assign value expression i.e. the params which you added in step 1.

来源: http:// hamroblog-sristi。 blogspot.fr/2011/04/passing-parameters-from-main-report-to.html

这篇关于iReport:将参数从主报表查询传递到表或列表的数据集查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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