title: Strange behaviour of SSRS parameters when comparing Report Builder and Report Viewer
body: <p>SQL SERVER 2008 R2
  SQL SERVER REPORTING SERVICES Report Builder 3.0
  Visual Studio 2010 ASP.NET/C#</p>
  
  <p>I design .rdl reports in Report Builder and deploy them on a SharePoint site.  The bulk of the data are retrieved from SQL Server via Stored Procedures, most of which take parameters.  The parameters are shown at the top of the report.</p>
  
  <p>Most users consume the report in the ASP.NET application using a ReportViewer control.</p>
  
  <pre><code>        &lt;rsweb:ReportViewer ID="rvResults" runat="server"  
              ProcessingMode="Remote"
              BackColor="#F5F6F7" ShowZoomControl="true" 
              ShowPrintButton="true" SizeToReportContent="true" ZoomMode="FullPage"
              ShowDocumentMapButton="true" ShowFindControls="true" ShowPageNavigationControls="true"
              ShowPromptAreaButton="False" InternalBorderColor="#ACBBD8"&gt;
          &lt;/rsweb:ReportViewer&gt;
  </code></pre>
  
  <p>When I run the report, either from within Report Builder or from SharePoint, everything works as expected.  The parameters are shown at the top (or side) of the report, and the user can enter values (which come mainly from drop-downs using datasets populated either by Stored Procedures or via embedded SQL).  Some drop-down lists are cascading - i.e. the value in list 2 is dependent on the value selected in list 1.</p>
  
  <p>When I run the report from within the ASP.NET application, there are two issues.  First, I get a script error:</p>
  
  <p>Line: 157
  Error: Sys.ArgumentNullException: Value cannot be null.
  Parameter name: panelsCreated<a href="https://i.stack.imgur.com/rObEO.jpg" rel="nofollow noreferrer">1</a></p>
  
  <p>I have set certain parameters in the report to be NULLABLE and to take default values of NULL, as the correct operation of the report requires it.</p>
  
  <p>Second, selecting a value from a drop-down list makes all the parameter values disabled, and makes the report unusable.  The two images below show this.</p>
  
  <p><strong>REPORT PARAMETERS FROM REPORT BUILDER (works correctly)</strong>
  <img src="https://i.stack.imgur.com/rObEO.jpg" alt="enter image description here"></p>
  
  <p><strong>REPORT PARAMETERS FROM ASP.NET APPLICATION (doesn't work correctly)</strong>
  <img src="https://i.stack.imgur.com/aZav6.jpg" alt="enter image description here"></p>
  
  <p>Careful readers might note that the value displayed in the Secondary Status ID control is different in both.  In the first, correct version, it shows , whereas in the second it shows .  The SQL used to populate the control is as follows:</p>
  
  <pre><code>SELECT Null AS ID, '&lt;All&gt;' AS Name
  UNION
  Select Distinct ID, Name
  from lutRequestStatusSecondary
  Where FKRequestTypeID=1
  AND Deleted=0
  AND FKStatusID=@StatusID
  Order by Name
  </code></pre>