简体   繁体   English

带参数的SSRS共享数据集

[英]SSRS Shared DataSet with Parameter

I have an SSRS Project that will have 5 reports (*.rdl files). 我有一个SSRS项目,将有5个报告(* .rdl文件)。 All reports will output the same data, the only difference being "ClientName" in the WHERE Clause. 所有报告都将输出相同的数据,唯一的区别是WHERE子句中的“ClientName”。

So I created a Shared Dataset in my project. 所以我在项目中创建了一个共享数据集。 Inside that shared dataset, I added a parameter @ClientName. 在共享数据集中,我添加了一个参数@ClientName。

In my report (*.rdl file), I added a dataset that referenced my shared dataset. 在我的报告(* .rdl文件)中,我添加了一个引用我的共享数据集的数据集。 How do I make this dataset sent a hard coded value for "Client Name" to the shared dataset so it doesn't prompt the user to enter one? 如何使此数据集将“客户端名称”的硬编码值发送到共享数据集,以便它不会提示用户输入?

Add a parameter to your rdl as well, turn the parameter visibility off and set the default value to the static client name (ie default="Fred"). 同时向rdl添加参数,关闭参数可见性并将默认值设置为静态客户端名称(即default =“Fred”)。 When the SSRS report runs, it should pass the local parameter with the default value to the shared dataset without the end user having to select or enter a value. 当SSRS报告运行时,它应该将具有默认值的local参数传递给共享数据集,而最终用户不必选择或输入值。

If you want to hard code the value, you can add it as the Parameter Value in the Dataset's Parameter tab. 如果要对值进行硬编码,可以在“数据集”的“参数”选项卡中将其添加为“ 参数值 ”。

在此输入图像描述

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

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