1
votes

I have uploaded a report and created a datasource in Reporting Services 2005. When I view the report through Report Manager, it runs successfully and displays correctly.

However, when I try to open this report in an ASP.net application which uses a ReportViewer control to view the report, it returns an exception:

Exception Details: Microsoft.Reporting.WebForms.ReportServerException: The data source 'ReportTesting' cannot be found. (rsDataSourceNotFound)

A warning is logged in Event Viewer on the ReportServer server:

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

**Exception information: 
    Exception type: ReportServerException 
    Exception message: The data source 'ReportTesting' cannot be found. (rsDataSourceNotFound)** 

I can't figure out why the report and datasource runs fine through ReportManager but won't when I run it via the RepotrViewer. There are other reports on the server (using different datasources) which are running fine.

Update: To confuse matters further - If I go untick 'Enable this data source' in ReportManager, the following is returned when I try to run the report in the ReportViewer control:

Exception Details: Microsoft.Reporting.WebForms.ReportServerException: The report server cannot process the report. A data source associated with the report has been disabled. (rsDataSourceDisabled)

If I retick the option to 'Enable this data source', it reverts to the original exception.

1
Don't know about SRSS but when using Reportviewer from asp.net webpage it looks like the name of the datasource isn't spelled correctly. How have you defined your datasource. Try it from code using the same name as used in your BI studio. - Luuk Krijnen
Luuk - thanks for the suggestion, but the data source does seem to be spelt correctly. As a test, I set the report up to use a datasource that was already on the server and working for other reports. It worked fine. Changed it back and it returns the exception again. Is there something that must be done to allow ReportServer to see the datasource? - Chris
Are you working in remote or local mode? Here's as small tutorial about how to setup reportviewer to work in remote mode. msdn.microsoft.com/en-us/library/ms251669(v=vs.80).aspx - Luuk Krijnen

1 Answers

0
votes

I finally discovered the cause / resolution!

I opened the .rdl file in a text editor and noticed that the Datasets were still pointing to the previous datasource.

<Query>
    <DataSourceName>[old datasource name]</DataSourceName>

I replaced all references to the previous datasource with the new datasource and it now runs successfully.