rjtech 发表于 2016-12-5 18:40:45

c# 如何给报表的参数赋值

请问c# 如何给报表的参数赋值,,还有获取报表名字有时候无法获取会是因为哪些原因呢?设置了这个默认值。获取到的却是""

Lenka.Guo 发表于 2016-12-6 09:41:42

您好为参数赋值参考代码,用索引来对应到报表参数:
GrapeCity.ActiveReports.PageReport rpt = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(@"RdlReport1.rdlx"));
rpt.Report.ReportParameters.DefaultValue.Values.Add("temp");

rjtech 发表于 2016-12-7 14:37:57

Lenka.Guo 发表于 2016-12-6 09:41
您好为参数赋值参考代码,用索引来对应到报表参数:
GrapeCity.ActiveReports.PageReport rpt = new Gr ...

好的 谢谢

Lenka.Guo 发表于 2016-12-7 15:38:18

:loap1:

rjtech 发表于 2016-12-7 15:59:40

Lenka.Guo 发表于 2016-12-6 09:41
您好为参数赋值参考代码,用索引来对应到报表参数:
GrapeCity.ActiveReports.PageReport rpt = new Gr ...

您好表示没有找到对应的值赋值,,这样如何操作

Lenka.Guo 发表于 2016-12-7 16:41:33

rjtech 发表于 2016-12-7 15:59
您好表示没有找到对应的值赋值,,这样如何操作

在LocateDataSource中使用   args.Report.Parameters["Parametername"].CurrentValue = "temp"; 为参数赋值

rjtech 发表于 2016-12-7 17:25:22

Lenka.Guo 发表于 2016-12-7 16:41
在LocateDataSource中使用   args.Report.Parameters["Parametername"].CurrentValue = "temp"; 为参数 ...

可以了 谢谢

Lenka.Guo 发表于 2016-12-7 17:47:42

rjtech 发表于 2016-12-7 17:25
可以了 谢谢

:loap1:
页: [1]
查看完整版本: c# 如何给报表的参数赋值