简体   繁体   English

在 Visual Studio 中预览 SSRS 报告时,如何指定参数值?

[英]How can I specify values for parameters, when previewing a SSRS report in Visual Studio?

I have a SSRS report project (created by someone else) opened in Visual Studio, and don't know how to preview it.我在 Visual Studio 中打开了一个 SSRS 报表项​​目(由其他人创建),但不知道如何预览它。

在此处输入图像描述

In the dataset (.rsd file) of the report, it has a SQL script with two parameters: ConID and PayNo.在报表的数据集(.rsd 文件)中,它有一个带有两个参数的 SQL 脚本:ConID 和 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".因此,当我单击左上角的“预览”(“设计器”右侧)时,出现错误“ConID 参数缺少值”。 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".我打开第一个参数的“参数属性”,右键单击屏幕截图左上角的“合同编号”,它显示其名称为“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.但我不知道“标签”在这里是什么意思。

在此处输入图像描述

Best way to get your report working is to take the script and run it directly in SQL without the parameters;让您的报告工作的最佳方法是获取脚本并直接在 SQL 中运行它而不使用参数; ConID and PayNo. ConID 和 PayNo。 In your unfiltered results, pick a ConID and PayNo value combination to run in your SSRS report.在未过滤的结果中,选择要在 SSRS 报告中运行的 ConID 和 PayNo 值组合。

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.从未过滤的结果集中输入任何 ConID 和 PayNo 组合。

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.完成测试后,请确保恢复到这些设置。

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

相关问题 我可以在没有visual studio的情况下将报告部署到报表服务器(SSRS)吗? - can I deploy a report to a report server (SSRS) without visual studio? 如何在SSRS报告中插入值? - how can i interchage the values in SSRS report? 如何在Visual Studio 2010中将文档结构图添加到RDLC(又名SSRS)报告中? - How can I add a Document Map to an RDLC (aka SSRS) report in Visual Studio 2010? 如何指定要在SSRS报告向导中使用的存储过程? - How can I specify a Stored Procedure to be used in the SSRS Report Wizard? 我可以仅在参数更改时将自动刷新添加到 SSRS 报告吗? - Can I add autorefresh to SSRS report only when parameters change? SSRS(Visual Studio):使用日期/时间参数时报表不返回任何行 - SSRS (Visual Studio): Report returns no rows when Date/Time parameters used SSRS:如何从自定义程序集中访问报表参数? - SSRS: How can I accessing report parameters from custom assembly? 尝试在Visual Studio中根据输入参数生成SSRS报告 - Trying to generate SSRS report based on input parameters in visual studio 在SharePoint中预览时,SSRS报告不显示条形码,但与条形码一起导出 - SSRS Report not displaying barcode when previewing in SharePoint, but exports with barcode 如何获得SSRS报告中矩阵中的值以重复? - How can I get the values in the Matrix on my SSRS report to repeat?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM