Question

We started getting the 'Object reference not set to an instance of an object' error when accessing any reports in our SQL Server 2005 Reporting Services. alt text

If we go to the report designer and debug it, it works.

I haven't worked much with reporting services, and I don't really know where to start looking. How can I track down the problem?

EDIT

These reports have been working for months. They just suddenly started showing this error.

EDIT 2

Found this in event viewer:

Event Type:    Warning
Event Source:   ASP.NET 2.0.50727.0
Event Category: Web Event 
Event ID:   1309
Date:       6/11/2009
Time:       10:01:06 AM
User:       N/A
Computer:   CHONGA
Description:
Event code: 3005 
Event message: An unhandled exception has occurred. 
Event time: 6/11/2009 10:01:06 AM 
Event time (UTC): 6/11/2009 2:01:06 PM 
Event ID: 42be336a7b014eab84402a885be04fc2 
Event sequence: 437 
Event occurrence: 28 
Event detail code: 0 

Application information: 
    Application domain: /LM/W3SVC/10/root/Reports-7-128891533489230722 
    Trust level: RosettaMgr 
    Application Virtual Path: /Reports 
    Application Path: C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportManager\ 
    Machine name: CHONGA

Process information: 
    Process ID: 4948 
    Process name: w3wp.exe 
    Account name: NT AUTHORITY\NETWORK SERVICE 

Exception information: 
    Exception type: NullReferenceException 
    Exception message: Object reference not set to an instance of an object. 

Request information: 
    Request URL: http://chonga/Reports/Reserved.ReportViewerWebControl.axd?OpType=StyleSheet&Version=2005.090.1399.00 
    Request path: /Reports/Reserved.ReportViewerWebControl.axd 
    User host address: 127.0.0.1 
    User: CHONGA\Administrator 
    Is authenticated: True 
    Authentication Type: Negotiate 
    Thread account name: NT AUTHORITY\NETWORK SERVICE 

Thread information: 
    Thread ID: 1 
    Thread account name: NT AUTHORITY\NETWORK SERVICE 
    Is impersonating: True 
    Stack trace:    at Microsoft.Reporting.WebForms.WebRequestHelper.GetExceptionForMoreInformationNode(XmlNode moreInfo, XmlNamespaceManager namespaces)
   at Microsoft.Reporting.WebForms.WebRequestHelper.ExceptionFromWebResponse(Exception e)
   at Microsoft.Reporting.WebForms.ServerReport.ServerUrlRequest(Boolean isAbortable, String url, Stream outputStream, String& mimeType, String& fileNameExtension)
   at Microsoft.Reporting.WebForms.ServerReport.GetStyleSheet(String styleSheetName)
   at Microsoft.Reporting.WebForms.ReportServerStyleSheetOperation.PerformOperation(NameValueCollection urlQuery, HttpResponse response)
   at Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Was it helpful?

OTHER TIPS

This may sound like a generic response, but are you certain the compiled version of the report is the same as the IDE-debug version? Generally this error means that you haven't instantiated the object you're trying to use. Make sure the object has been not only declared, but actually has the data you're trying to show.

This will most likely be becuase the Data Source for your reports has been overwritten or the credentials have been removed/are no longer valid.

Either redeploy the Data Source or manually enter the correct details on the Report Server for the relevant Data Source.

You should also try going into the web interface and deleting the data source(s) directly from the server. Then redeploy your project. Sometimes, when deploying from Visual Studio, it won't recreate the data source because it is already there. When you redeploy, the data source will be recreated.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top