ReadOnlyReportParameterException thrown in SSRS 2008

We use a Visual Studio 2010 to develop code that access our SSRS reports. I was merrily creating an array of parameters to send to SSRS. The “params” parameter sent to the CreateReport method is that array, and there were three parameters to it, the third being called ScottsParameter:

    CreateReport("ScottsParameter", params);

When I got to the part of my code where the ReportExecutionService did its magic to use this array of parameters:

    ReportExecutionService rs= new ReportExecutionService();
    rs.SetExecutionParameters(parameters, "en-us");

And I got this error:

The report parameter ‘ScottsParameter’ is read-only and cannot be modified.
—> Microsoft.ReportingServices.Diagnostics.Utilities.ReadOnlyReportParameterException: The report parameter ‘ScottsParameter’ is read-only and cannot be modified.”

I received this because I tried to assign a value to a parameter marked on the report as “Internal”, and you can see the parameter visibility if you open the “Report Data” sidebar in Visual Studio, open the “Parameters” folder, and double click on the parameter.  In the “General” tab is a section called “Select Parameter Visibility”.

SSRS Visibility

SSRS Visibility

I was able to resolve the error by not sending that third parameter, and I could get away with doing that because the parameter was a set value and didn’t need to be sent.

Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: