简体   繁体   中英

SSRS passing Report Parameters

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

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

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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