sql-server - SSRS 传递报告参数

标签 sql-server reporting-services reportingservices-2005

我在尝试解决这个问题的根本问题时遇到了困难

我有一个用户输入信息的表单。该信息通过 URL 传递到 SSRS

我收到了错误

An error has occurred during report processing. (rsProcessingAborted)
Query execution failed for data set 'Report'. (rsErrorExecutingCommand)
Must declare the scalar variable "@ReportType". Must declare the scalar variable "@StoreNum". Must declare the scalar variable "@ReportType". Must declare the scalar variable "@StoreNum". 

查询是这样的

IF @ReportType = 'RE'
BEGIN
 exec  proc_Report_RETaxInvoices_InterActive @StoreNum, @StartDate, @EndDate, @TaxId, @BusinessName, @Attention, @LocatedIn, @Street, @AdditionalAddress, @City, @State, @PostalCode
END
ELSE IF @ReportType = 'RY'
BEGIN
 exec proc_Report_ARTaxInvoices_InterActive @StoreNum, @StartDate, @EndDate, @TaxId, @BusinessName, @Attention, @LocatedIn, @Street, @AdditionalAddress, @City, @State, @PostalCode
END

我的报告参数如下所示 enter image description here 网址又长又脏,但看起来很有效

http://<SECRET>/ReportServer/Pages/ReportViewer.aspx?%2fSubway%2fAccounting%2fAccounting%2fTax+Report+Interactive&rs:Command=Render&rc:Parameters=false&ReportType=RE&StoreNum=25159&StartDate=11%2F1%2F2012&EndDate=11%2F1%2F2012&TaxId=1&BusinessName=1&Attention=1&LocatedIn=1&Street=1&AdditionalAddress=1&City=1&State=1&PostalCode=1

注意

&ReportType=RE&StoreNum=25159

在查询字符串中

当我从 SSRS BIDS 环境中的查询编辑器运行报告时,会返回一个结果集。

所以我对这个错误不知所措

最佳答案

检查您的“报告参数”是否已作为“数据集参数”与您的数据集相关联:

enter image description here

关于sql-server - SSRS 传递报告参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13650508/

相关文章:

SQL Server : trigger how to read value for Insert, 更新、删除

sql - 如何返回元素属性值

asp.net - 为什么在 Web 应用程序中由 Reporting Services 2005 调用时,第二个 T-SQL 查询的运行速度比第一个快得多

reporting-services - 强制 SSRS 2008 使用 SSRS 2005 CSV 渲染

sql - 如何替换零并输入小数?

java - 如果我们保持空闲一段时间,连接到 Azure MSSQL DB 时,Spring Boot 应用程序中的数据库连接会关闭

reporting-services - SSRS 多值参数。检查是否选择了 "Select All"

c# - 生成 Reporting Services 2005 PDF 报告并将其存储在磁盘上

reporting-services - SSRS 2005 - 使用矩阵和列表打印报告每隔一页给出空白页

reportingservices-2005 - 如何使用动态网址将图像添加到 SSRS 报告中?