SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to connect the SharePoint 2010 Chart Web Part to SharePoint list. It's all good but anonymous can't see the chart and I get this error:

Object reference not set to an instance of an object. System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Office.Server.WebControls.Chart.RenderChartControl(Control chartToRender, HtmlTextWriter writer) at Microsoft.Office.Server.WebControls.Chart.Render(HtmlTextWriter writer) at Microsoft.Office.Server.WebControls.ChartWebPart.Render(HtmlTextWriter writer)

share|improve this question
up vote 1 down vote accepted

This is a bug and it's solved in SP2010 SP1 (didn't test it though). Here is the link to the kb article which describes all the changes in the xslx file: Row 234 describes the issue you're referring to.

share|improve this answer

I'm not that familiar with the Chart web part but from checking it out my guess is that it have the same issues with anonymous user as client object model based web parts (like Silverlight based web parts) have.
The problem is that by default SharePoint restrict the GetItems method of SPLIst for anonymous users.
You should check out Waldek Mastykarz's post about this issue, but to summarize his great solution, use the following PowerShell code (dont forget to replace http://sharepoint with your site url):

$wa = Get-SPWebApplication -Identity "http://sharepoint"
$wa.ClientCallableSettings.AnonymousRestrictedTypes.Remove([Microsoft.SharePoint.SPList], "GetItems")
share|improve this answer
Thanks, I'm gonna try this – Hameds Apr 30 '11 at 9:12

If the problem is that autenticated users see the chart, but anonymous don't, the problem is probably a permissions-issue. Make sure that no files you use needs restricted access.

If you don't figure it out, do as @Disciple suggested, attach a debugger.

share|improve this answer

Not enough info to answer. What other info is in SharePoint Logs? Try to attach debugger or use logging. Most likely smth is not initialized before accessing.

UPD: Are all resources used be the page published?

UPD2: MichaelF has a point. Have you tired using smth like:

 // Code goes here


share|improve this answer
I didn't find any usefull data about this on Sharepoint Logs – Hameds Apr 27 '11 at 14:52
How to attach debugger? – Hameds Apr 29 '11 at 16:53
System.Diagnostics.Debugger.Break(); – AlexSSE Apr 30 '11 at 11:01
Do you need to use elevated permissions with this? I know we do that for certain web parts in our environment to get data that normally would be restricted. – MichaelF May 3 '11 at 17:30
I dont think he can add the SPSecurity becuase he is using an OOTB web part... – Johnny Tordgeman May 4 '11 at 18:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.