[英]Set SSRS report variable from code
I building an SSIS report, and displaying it via a ReportViewer asp control. 我建立一个SSIS报告,并通过ReportViewer asp控件显示它。 I already know how to pass parameters via code: 我已经知道如何通过代码传递参数:
reportViewer1.ServerReport.SetParameters(parameters);
How can I do the same for the report's variables ? 我该如何对报表变量执行相同操作?
AFAIK this is not possible. AFAIK这是不可能的。
Note that variables aren't meant for input, they are meant for something else : 请注意,变量并非用于输入,而是用于其他目的 :
When you have a complex calculation that is used more than once in expressions in a report, you might want to create a variable. 如果报表中的表达式中有多次使用的复杂计算,则可能需要创建一个变量。
Of course, you can base that calculation on input parameters. 当然,您可以根据输入参数进行该计算。
If you find the need to set a value for a variable when viewing a report, you probably in fact need a parameter . 如果在查看报告时发现需要为变量设置值,则实际上可能需要一个parameter 。 Perhaps you're experiencing the XY problem ? 也许您遇到了XY问题 ?
It is Possible 有可能的
Refer the below link 请参考以下链接
Modifying report variables in Reporting service 2008 R2 在Reporting Service 2008 R2中修改报表变量
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.