Joseph Caruana
Joseph Caruana

Reputation: 2271

Parameter Values - pass a value not in the list

I have a report connected to BI cube. In the report there is a parameter with the datasat from the cube as well. This parameter correctly appears as a multi-select drown down in the report viewer, and the values are correctly populated.

However, when I am calling the report using javascript and passing the report parameters as a post request, there is an interesting behaviour.

If in the parameter, I pass a value that is not included in the list, the report crashes with the following error: Default value or value provided for the report parameter 'Name' is not a valid value. (rsInvalidReportParameter)

Is there a way to make SSRS simply skip the invalid values rather than throw an error?

Upvotes: 0

Views: 2673

Answers (1)

djangojazz
djangojazz

Reputation: 13272

Without knowing more on what is 'acceptable' for the parameter value this question is nearly impossible to answer. In SSRS the first level of acceptance of a parameter is the type which is the common 'text' (string of equivalent in code), integer or DateTime. If you are passing a parameter to the report NOT in the format it wants it will bomb. That should be as designed.

If you limit your scope of 'available' values of a parameter by attaching the parameter to a dataset stating: "Get values from Dataset". If you give the parameter a value NOT in this collection it will also bomb. This would be the argument equivalent of selecting 6 when your choices are 1-5. And getting the standard .NET equivalent of 'argument is outside the bounds of the array.' That is also by design.

For debugging I would suggest trying to set the value in SSRS as the 'default' statically and if it can accept it then the issue is in the transfer and the type. If you can and then cannot from the web pass in via javascript or whatever method you choose it is the type being passed in. In such cases I have passed in a string and then transferred it's type in SSRS dynamically with a cast.

Upvotes: 4

Related Questions