【问题标题】:SSRS passing hidden parameter from web.configSSRS 从 web.config 传递隐藏参数
【发布时间】:2020-12-04 09:20:12
【问题描述】:

我有一个处理显示数据表的报告,我使用 MvcReportViewerFluent 在页面上查看报告。

@(Html.MvcReportViewerFluent(Model.ReportPath)
.ReportParameters(Model.ReportParameter)
.Attributes(new { Height = 900, Width = "100%", style = "border: none" })
.ControlSettings(new ControlSettings() {ShowExportControls=true, AsyncRendering=true, ShowReportBody=true })
)

在报告中,有一个链接是由各种参数的串联构建的,包括隐藏类型的 baseUrl 参数,几天来,这个参数似乎没有填充,而是采用了默认值。 为了填充这个参数,我使用了 ReportParameters 属性,我将带有参数的字典传递给该属性。

model.ReportParameter = new Dictionary<string, object>();
model.ReportParameter.Add("BaseUrl", ConfigurationManager.AppSettings["UrlBase"].ToString());

请注意,除了这个参数之外,其他可以完美运行的参数都会显示在屏幕上。

我也尝试让这个参数可见,我发现它甚至没有被填充,奇怪的事实是在测试环境中它给出了同样的问题,然后在没有做任何改变的情况下自行解决。

【问题讨论】:

    标签: c# asp.net-mvc reporting-services


    【解决方案1】:

    不确定您所说的“隐藏类型的 baseUrl 参数”究竟是什么意思。为了将隐藏参数传递给 ssrs,您只需将其附加到查询字符串中,如下所示:

    [BaseurlofSSRS]?[myhiddenparamname]=[值]

    这应该可行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-11-24
      • 2013-06-04
      • 1970-01-01
      • 2021-10-04
      • 1970-01-01
      • 1970-01-01
      • 2010-10-21
      相关资源
      最近更新 更多