Pass parameters to SSRS

5281
5281 used Ask the Experts™
on
I have SSRS 2008 report, application pass parameters in URL (some State name) to SSRS report, the URL as below.  The report itself runs well,  but report cannot be displayed on server, error:

"Default value or value provided for the report parameter 'State' is not a valid value"

I found if I removed some States from URL, it would display report.  I.e., some states work, some states don't work.

http://servername/ReportServer?/ApplicationName/DepartmentStore&State=AL&State=AK&State=AR&State=CA&State=CO&State=CT&State=DE&State=DC&State=FL&State=GA&State=HI&State=FL&rc:Parameters=FALSE
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Top Expert 2014

Commented:
Have you established which states are causing the problem? If you have, try just passing one of the problem states and see if it works.

Author

Commented:
It doesn't work if I just pass one of the problem states.
Most Valuable Expert 2012
Top Expert 2014

Commented:
An example problem state?
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

Author

Commented:
To me the problem states don't have anything in common.  I really have no idea what would be the problem.  I used the trim() function to trim the State string.  

I saw an Microsoft article, could it be something like that? https://support.microsoft.com/kb/970058#appliesto

But I don't know how to work around with this problem.  Please advise.

Author

Commented:
I am thinking to pass parameters (those states) through the code, instead of URL.  Do yo have a sample code in VB.net.  Thanks.
Most Valuable Expert 2012
Top Expert 2014

Commented:

Author

Commented:
The SSRS report is in PDF format, the examples are passing parameters from ReportViewer Control to SSRS.  I don't think I have a ReportViewer control in the asp.net application.

Author

Commented:
How to pass parameters from asp.net project to SSRS pdf format?  I think it is my question.
Most Valuable Expert 2012
Top Expert 2014

Commented:
I think for server report, you may have to rely on URL to pass parameters. You can pass parameters to local report with the other method I linked above.

Author

Commented:
If the only way to pass parameters for server report is through URL , I don't understand why I have the error message for some State, but not others.

"Default value or value provided for the report parameter 'State' is not a valid value"
Most Valuable Expert 2012
Top Expert 2014

Commented:
Is the parameter configured to be multivalue?

Author

Commented:
There are two datasets, the report only use the first dataset, the parameter is set to "Allow multiple values", the parameter is set "Get values from a query" from the 2nd dataset.  Is that right?
Most Valuable Expert 2012
Top Expert 2014

Commented:
Parameter seems to be right but not sure about the 2nd dataset.

Author

Commented:
The 2nd dataset is used for testing purpose, so the parameter dropdownbox on report can list items.
Most Valuable Expert 2012
Top Expert 2014
Commented:
And that dataset contains all the states that you are passing?

Author

Commented:
2nd dataset contains all the states I am passing.

Author

Commented:
Should I remove 2nd dataset and test?
Most Valuable Expert 2012
Top Expert 2014

Commented:
Yeah worth a try.

Author

Commented:
The problem is that there are some space after the name of State in database, so it doesn't match the URL.  I trimmed it in query.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial