在Visual Studio中预览SSRS报告时,如何指定参数的值?
我有一个在Visual Studio中打开的SSRS报告项目(由其他人创建),并且不知道如何预览它。
在报告的数据集(.RSD文件)中,它具有一个带有两个参数的SQL脚本:CONID和PAYNO。 因此,当我在左上角(右上为“设计师”)中单击“预览”时,我遇到了错误“ CONID参数缺少一个值”。如何为预览报告的两个参数指定值?
这是我的尝试,让我知道我是否朝着正确的方向前进。我打开了第一个参数的“参数属性”,并在屏幕截图的左上方右键单击“合同编号”,并显示其名称为“ conid”。
我正在寻找可以在此参数输入某个值的位置,因此我单击“可用值”,然后选择“指定值”,然后单击“添加”,它要求我键入在“标签”和“值”中。但是我不知道“标签”在这里意味着什么。
I have a SSRS report project (created by someone else) opened in Visual Studio, and don't know how to preview it.
In the dataset (.rsd file) of the report, it has a SQL script with two parameters: ConID and PayNo.
So when I click "Preview" in the top left corner (right to "Designer"), I got the error "The ConID parameter is missing a value". How can I specify values to the two parameters for previewing the report?
Here is my attempt, and let me know if I am in the right direction. I opened "Parameter Properties" of the first parameter, by right-clicking on "Contract Number" on the top left of the screenshot, and it shows its name is "ConID".
I am looking for where I can enter some value for this parameter, so I clicked "Available Values", then selected "Specify values", and then clicked "Add", and it asks me to type in "Label" and "Value". But I don't know what "Label" means here.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使报告工作的最佳方法是将脚本录制并直接在没有参数的情况下运行。 CORID和PAYNO。在您未经过滤的结果中,选择一个CORID和PAYNO值组合在SSRS报告中运行。
要进行测试,请将参数可见性更改为“可见”(第二屏幕截图),以便您可以在不离开预览模式的情况下调整参数值。现在,当您预览报告时,这两个参数框应该是空白的,并且在提供值之前,报告不会运行。从未经过滤的结果集中输入任何CORID和PAYNO组合。
如果您希望在运行报告时填充参数值,则可以在每个参数的相应“默认值”选项卡中输入它们。您不需要“可用值”选项卡中的任何内容。
注意 - 如果这是生产中的报告,那么它可能具有另一个报告传递的参数值,这说明了为什么将参数可见性设置为隐藏而没有默认值。完成测试后,请确保回到这些设置。
Best way to get your report working is to take the script and run it directly in SQL without the parameters; ConID and PayNo. In your unfiltered results, pick a ConID and PayNo value combination to run in your SSRS report.
For testing, change the parameters visibility to "Visible" (second to last screenshot) so you can adjust the parameter values without leaving Preview mode. Now when you preview the report, those two parameter boxes should be blank and the report won't run until you provide values them. Enter any ConID and PayNo combination from your unfiltered result set.
If you want the parameters values to be populated when you run the report, you can enter them in the respective "Default Values" tab for each of the parameters . You do not need anything in "Available Values" tab.
Note - if this was a report in production, then it probably has it's parameters values passed by another report, which explains why the parameter visibility was set to hidden with no default values. Make sure to revert back to those settings when you are done testing.