c# - 使用 asp.net 将参数传递给 SSRS 报告过滤器下拉列表

标签 c# asp.net reporting-services ssrs-2012

我正在尝试使用 asp.net 将参数传递给 SSRS 报告过滤器下拉列表,但我无法将值发送到下拉列表。

请帮忙解决这个问题。 Want to pass this two value using C#

我想使用 C# 传递或设置这两个参数值

最佳答案

您不必向下拉列表发送值,
您必须首先在 asp.net C# 中制作级联下拉菜单,然后从那里获取值,然后传递给报告参数:

//get 'selected value' or 'text' as per your need
var market = ddMarket.SelectedItem.Text; 
var customer = ddCustomer.SelectedItem.Text; 
List<ReportParameter> params = new List<ReportParameter>();
reportParams.Add(new ReportParameter("rptParamMarket", market));
reportParams.Add(new ReportParameter("rptParamCust", customer));
ReportViewer1.ShowParameterPrompts = false;
ReportViewer1.ServerReport.SetParameters(params);
ReportViewer1.ServerReport.Refresh();

确保 "rptParamMarket""rptParamCust" 与报告中的参数名称匹配。

从本质上讲,这意味着您的报告将根据您从后面的代码传递给它的值来显示。

关于c# - 使用 asp.net 将参数传递给 SSRS 报告过滤器下拉列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44324893/

相关文章:

c# - 使用在 C# 中声明的虚拟异步任务并在 F# 中覆盖它

c# - 如何查询在 NHibernate 中存储为枚举的标志

asp.net - 如何禁用/覆盖内容页面控件 ID 的命名容器 ID 生成

reporting-services - 将日期作为参数传递给子报表/另一个报表以用作参数

sql - SSRS 给我一个错误,但在数据 View 中工作

reporting-services - 从SSRS导出时如何获取命名的Excel工作表

c# - 您如何在 VS 扩展中强制调用 ILineTransformSource.GetLineTransform 以更改线条装饰尺寸?

c# 将字符串作为代码执行

javascript - Asp.net JavaScript OnClick 不工作

c# - 打印到网络(共享)打印机 - Word Interop