SSRS passing Report Parameters

牧云@^-^@ 提交于 2020-01-04 04:38:09

问题


I am having a difficult day trying to decode the underlying issue with this one

I have a form that the user enters information. That information is passed through URL to SSRS

I am getting the error

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". 

The query is this

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

My Report Parameters look like this

The url is long and nasty but looks valid
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

Notice that

&ReportType=RE&StoreNum=25159

is in the query string

When I run the report from the query editor in the SSRS BIDS environment, a result set is returned.

So I am at a loss for this error


回答1:


Check that your "report parameters" have been associated with your dataset as "dataset parameters":



来源:https://stackoverflow.com/questions/13650508/ssrs-passing-report-parameters

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!