Dynamics CRM – Issue with publishing reports for external use – System.Web.Services.Protocols.SoapException: One or more data source credentials required to run the report have not been specified.

We have quite a few reports in Microsoft dynamics CRM 4.0 which are normally run from within CRM 4.0 without any issue. Some of the reports are added to SQL Reporting Server utilising dynamics CRM but are accessed externally from an ASP.NET application outside CRM boundary.

The ASP.NET application prepares a request including parameter required to fetch report with selective results in Excel format.

These reports were working on staging server but, however, as soon as I deployed them on live server I started getting the following error:

“System.Web.Services.Protocols.SoapException: One or more data source credentials required to run the report have not been specified.”

Later I found out that the issue had nothing to do with ASP.NET application but rather running reports that have been published for external use.

It took me a while to gather the pieces of information on Google and finally I manager to resolve the issue without the need of pulling my hair apart.

In order to figure out the cause of the issue, follow these steps

  1. Navigate to SRS report manager URL (http://<report server name>/reports)
  2. Run the report
  3. If you are prompted for credentials then this is the issue. You should never be prompted with credentials

Solution

Any report that is published using CRM is put into the CRM 4.0 root folder. Each reports inherits the datasource available in the root folder with the name of “MSCRM_DataSource” and have the option (“Credentials supplied by the user running the report”) selected as shown in the image below

Reports run without any issue when running from within CRM but fail to execute when executed from ASP.NET application.

The workaround I managed to run the report was to override the report datasource properties as follows:

  1. Navigate to SRS report manager URL (http://<report server name>/reports)
  2. Select report properties which is executed externally
  3. Select Data Sources link on the left hand side under Properties tab and enter the details as shown below:
  4. Execute the report from ASP.NET application and it should run fine

This is the way report, published through CRM, work. In my case it didn’t work even if I supplied the domain administrator’s credentials. So I followed more traditional approach with Windows integrated security and not from CRM.

It worked for me, tests were successful. I hope this helps someone who come across similar if not the same issue!

Advertisements
This entry was posted in .NET C#, Microsoft Dynamics CRM, SQL Server and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s