I'm creating an MVC application which uses the Reporting Web service (2010) for programatically managing reports and data sources.
About a month or so ago when I first implemented this functionality, I was able to upload reports (.rdl files) first and later upload its data source. I was then able to view the report using a report viewer control in a web page.
However, since a week or so, this flow has broken, i.e. if I upload the report first and then the data source, the report doesn't render in the report viewer control. It gives the following error.
The report server cannot process the report or shared dataset.
The shared data source 'AW' for the report server or SharePoint site is not valid.
Browse to the server or site and select a shared data source.
The data source is a shared data source which is defined in the rdl file as follows.
<DataSources>
<DataSource Name="AW">
<DataSourceReference>AW</DataSourceReference>
</DataSource>
</DataSources>
If I reverse the flow, i.e. upload the data source first and then the report, it starts working! But I'm 100% sure, the other flow used to work when I first implemented it.
I'm stumped as to why the original flow has stopped working. Both the report and the data source are uploaded to a specific folder.
Can someone please shed some light on this. Does the original flow make sense? I mean is it supposed to work, or was I imagining stuff?
btw, the data source uploaded is in the following format
<?xml version="1.0" encoding="utf-8"?>
<DataSourceDefinition xmlns="http://schemas.microsoft.com/sqlserver/reporting/2006/03/reportdatasource">
<Extension>SQLAZURE</Extension>
<ConnectString>Data Source=xxx;Initial Catalog=AdventureWorks2012</ConnectString>
<UseOriginalConnectString>false</UseOriginalConnectString>
<OriginalConnectStringExpressionBased>false</OriginalConnectStringExpressionBased>
<CredentialRetrieval>Store</CredentialRetrieval>
<WindowsCredentials>false</WindowsCredentials>
<ImpersonateUser>false</ImpersonateUser>
<UserName>user</UserName>
<Password>pass</Password>
<Enabled>True</Enabled>
</DataSourceDefinition>
and I use the ReportingService2010.CreateCatalogItem method for creating both the report and the data source.
Any help is highly appreciated.
rsDataSourceReferenceNotPublishedwarning. I repeat, its a warning, not an error. So by design, it seems this should be okay. Maybe I'm missing a step somewhere. But then I wonder how and why was it working previously. - Vishal Shah