如何将参数从主报表传递到子报表 [英] how to pass a parameter from main report to subreport

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

问题描述





Iam c#和Crystal Reports。



我必须从main传递参数向子报告报告。



主报告中传递的参数在子报告中是相同的。



因此,在显示报告时,我必须传递相同的值,我将传递给主报告将

传递给子报告。



我用过



Iam c# and Crystal Reports.

I have to pass parameter from main report to subreport.

The parameter which have been passed in main report is same in subreport.

So while displaying the report i have to pass same value which iam passing to main report should
be passed to subreport.

I have used

cryRpt1 = cryRpt.OpenSubreport("rptPLSub1"");
cryRpt1.SetParameterValue("@FromDt"", string.Format("{0:yyyy-MM-dd}";, dtpToDate.Value), "rptPLSub1");





b这也给出了错误



请帮助



问候

Nirmala



but this also giving error

Pls help

Regards
Nirmala

推荐答案

1.从主报告右键单击子报表对象(您必须从主报表中传递值)

2.click选项更改子报表链接您将获得一个弹出窗口,其中包含主报表参数列表和命令文件显示可用字段列表,

3.从中您可以选择并移动所需的一个到要链接到的字段列表

4.然后在左下角下拉列表中选择子报告参数名称。

5.取消选中根据此字段选择子报表中的数据复选框(这用于显示与传递字段值相匹配的子报表数据)



现在你只需要在主报告中设置参数值,你也可以使用子报告..
1.From main report Right click on sub report object(to which you have to pass value from main report)
2.click the option "Change Subreport Links" you will get a popup which have a list of main report params and command fileds displayed "Availlable fields" list,
3.from that you can select and move the required one to "Field(s) to link to" list
4.and then select subreport parameter name in the left bottom drop down list.
5.And un check the "Select data in subreport based on this field" checkbox(this is for displaying subreport data that matches the passing field's value)

Now you have to set value for parameter in main report only and you can use the sub report too..


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

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