简体   繁体   English

SSRS 2008-动态参数可在Visual Studio中使用,但在报表服务器上没有可用的值

[英]SSRS 2008 - Dynamic parameter works in Visual Studio, but has no available values on the Report Server

The short version: My report has a param that sets the default of another param (both are dropdown, non-multiple-valued) using a dataset. 简短的版本:我的报表具有一个参数,该参数使用数据集设置另一个参数的默认值(均为下拉菜单,非多值)。 This works as expected in Visual Studio, but on the Report Server the second param is blank (doesn't have any available values). 这可以在Visual Studio中按预期工作,但是在报表服务器上,第二个参数为空(没有任何可用值)。


The long version: I wrote a report that has two parameters: 长版:我写了一个包含两个参数的报告:

  • @run_type : A drop down (single select) with hard-coded available values: @run_type :带有硬编码的可用值的下拉列表(单选):
    • Most Recent 365 最新365
    • None 没有
    • Fiscal Year to Date 迄今为止的会计年度
  • @Run : A drop down (single select) with available values from the GetRuns dataset @Run :一个下拉菜单(单选),其中包含GetRuns数据集中的可用值

The two applicable datasets are: 两个适用的数据集是:

  • GetRuns : Returns a list of "runs" to populate the available values for the @Run parameter. GetRuns :返回“运行”列表,以填充@Run参数的可用值。 This is also a shared dataset, but the other report that use it are working fine. 这也是一个共享数据集,但是使用该数据集的其他报表也可以正常工作。
  • get_run_type : Uses the values selected in the @run_type parameter to return the default value for the @Run parameter. get_run_type :使用@run_type参数中选择的值返回@Run参数的默认值。

So basically the report is supposed to automatically run as soon as it opens because the... 因此基本上,该报告应该在打开后立即自动运行,因为...

  1. The GetRuns dataset sets the @Run parameter's available values GetRuns数据集设置@Run参数的可用值
  2. @run_type 's default is set to "Most Recent 365" @run_type的默认设置为“最新365”
  3. which tells the get_run_type dataset to return the most recent run of that type, to set it as 它告诉get_run_type数据集返回该类型的最新运行,并将其设置为
  4. @Run parameter's default value @Run参数的默认值

The Problem/Question: The @Run parameter has no available values. 问题/问题: @Run参数没有可用值。 Why would it work perfectly in Visual Studio but not on the server? 为什么它可以在Visual Studio中完美运行,但不能在服务器上运行?

Sometimes parameters are not updated when publishing reports (this would include available value references). 有时,发布报表时不会更新参数(这将包括可用的值引用)。 If you had published the report before adding the available values reference to the parameter, it would continue to show up blank. 如果在将可用值引用添加到参数之前发布了该报告,它将继续显示为空白。

Delete the report from the server and publish it again. 从服务器中删除该报告,然后再次发布。

So I just realized that I actually did make a change to the shared dataset that was populating the available values for the @Run parameter. 因此,我意识到我确实确实对共享数据集进行了更改,该数据集填充了@Run参数的可用值。 Stupid mistake. 愚蠢的错误。 I fixed that and it works fine now. 我已修复该问题,现在可以正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM