Log In Name and Password required by Report Server

You can view the CRM reports in Reporting Services by browsing to http://YourReportingServer/ReportServer/. There you should select your organization, select 4.0 and select a report. At that moment you might be asked for a Log In Name and a Password as seen in the image.

This behavior appears when you have installed the SRS Data Connector because your deployment contains a separate server for SQL. The user name and password which are requested are not your windows credentials. Instead, the user name is your userid and the password is the id of the organization you're working with. You can find these values in SQL by using the following SQL query.

SELECT firstname, lastname, systemuserid, organizationid FROM systemuserbase

If you are programming against the webservice of reporting service, then you can use the following C# code to get a correct DataSourceCredential. This code uses the DataSourceName which is "CRM" for CRM reports. You can find this by looking at the DataSource settings in Visual Studio when changing a CRM report.

//Initialize CRM WebService
CrmAuthenticationToken token = new CrmAuthenticationToken();
token.AuthenticationType = 0;
token.OrganizationName = "OrgName";
CrmService.CrmService service = new CrmService.CrmService();
service.CrmAuthenticationTokenValue = token;
service.UseDefaultCredentials = true;

//Get Credentials
WhoAmIRequest req = new WhoAmIRequest();
WhoAmIResponse whoami = (WhoAmIResponse)_service.Execute(req);
string userName = whoami.UserId.ToString();
string password = whoami.OrganizationId.ToString();

//Create DataSourceCredentials for SRS
DataSourceCredentials dsc = new DataSourceCredentials();
dsc.DataSourceName = "CRM";
dsc.Password = _password;
dsc.UserName = _userName;

My fellow MVP Jim Steger sent me this note:
I enjoyed your posts about SRS. One thing you might want to note is that you can get around the username/password thing by ‘publishing the report for external use’. That will change the data source auth to interactive and make it like a normal report that can be used instead of through the proxy. Obviously that may not be what someone wants, since they could run into double-hop scenarios, but I thought might be worth reminding people. Especially since the command is not available from the report grid and only when you edit the report record.


Matt Wittemann said...

Ronald: You are a CRM god!

Ronald Lemmen said...

Says mister Matt himself :)