Fixed : Sys.ArgumentNullException: Value cannot be null. Parameter name – when you click the Apply button to SQL Server Reporting Service in SharePoint 2010/SharePoint 2007

Today, when i opened my KPI Chart which was developed using SQL Server Reporting Service 2008 and was deployed to SharePoint 2010 sites, that’s all right. But when i change the parameters of the Chart and clicked the Apply button, I got below error messages:

Message: Sys.ArgumentNullException: Value cannot be null.
Parameter name: panelsCreated[9]
Line: 129
Char: 12
Code: 0
URI: http://myportal/ScriptResource.axd?d=B_bd2qFqfQeLHhOpfTdyfmrClkdXE0u-IviVr8U-2eh87-Acs-7GELMNWgx6ySpdOvxhXQgpUlPqxAqQahYCtFTntr0SprWknq0yKaFVaLgYmqSYXZXNo6F63XN_8MZoPMUevOt5l4xh1qyafwAw_uBLCf4V-cJuDKoE18QfEQ8i6ci30&t=5c2f384e

What happed? Everything is very good yesterday. I do not change anything to this sharepoint site. On my another SharePoint site, I tried to change the parameters and clicked the Apply button, there are no any error messages and i got the new chart.

I saw the source codes of these 2 SharePoint pages, I got the code of the Apply button:

<input name="ctl00$m$g_d129e8f5_8262_46b2_a5a7_6ce759656dc8$ctl00$ctl17$ApplyParameters" class="sqlrv-ApplyButton" id="ctl00_m_g_d129e8f5_8262_46b2_a5a7_6ce759656dc8_ctl00_ctl17_ApplyParameters" onclick="
if (typeof(__defaultFired) != 'undefined')
__defaultFired = false;
return $get('ctl00_m_g_d129e8f5_8262_46b2_a5a7_6ce759656dc8_ctl00_ctl17_ctl06').control.ValidateInputs();"
type="submit" value="Apply"/>





The two Apply button’s code are same.  But why one is good and another can’t run rightly?



I started to search related key words “Message: Sys.ArgumentNullException: Value cannot be null.Parameter name”, i found the answer on this page: http://www.jamesgoodfellow.com/blog/post/SysArgumentNullException-Value-cannot-be-null-Parameter-name-postBackElement.aspx .



Yes, in my SharePoint site web.config file, I set the <compilation debug="true"> for getting the error messages. I have set this SharePoint site to Debug model.



So, for fixing this bug, you should set the <compilation debug="false"> in your web.config file.



That’s how i fixed this bug, hope this could help you.