将参数从Webform传递到Crystal报表 [英] passing parameter from webform to crystal report

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

问题描述

我必须将参数从Web表单传递到Crystal报告.怎么做?

请给我这个问题的代码.

谢谢

I have to pass parameters from a webform to crystal report. How is this done?

Please give me code for this problem.

Thanks

推荐答案

在水晶报表中,为要在运行时传递的参数创建参数字段".

然后在您的代码中,在其中创建报告实例,例如

In the crystal report, create Parameter Fields for the parameters you want to pass at runtime.

Then in your code, where you create the report instance like for example

TestReport myReport = new TestReport();



您可以使用SetParameterValue(string ParameterName,object ParameterValue,string SubReportName)方法传递参数.

例子:



you can pass the parameter in using the SetParameterValue(string ParameterName, object ParameterValue, string SubReportName) method.

Example :

myReport.SetParameterValue("MyParameter", 123, "MySubReport.rpt");


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

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