SQL SERVER 2008 R2 SQL SERVER REPORTING SERVICES Report Builder 3.0 Visual Studio 2010 ASP.NET/C#
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.
Most users consume the report in the ASP.NET application using a ReportViewer control.
<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">
</rsweb:ReportViewer>
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.
When I run the report from within the ASP.NET application, there are two issues. First, I get a script error:
Line: 157 Error: Sys.ArgumentNullException: Value cannot be null. Parameter name: panelsCreated1
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.
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.
REPORT PARAMETERS FROM REPORT BUILDER (works correctly)
REPORT PARAMETERS FROM ASP.NET APPLICATION (doesn't work correctly)
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:
SELECT Null AS ID, '<All>' AS Name
UNION
Select Distinct ID, Name
from lutRequestStatusSecondary
Where FKRequestTypeID=1
AND Deleted=0
AND FKStatusID=@StatusID
Order by Name