Thursday, April 19, 2012

Error running custom CRM reports

If you are getting the following errors running a custom CRM report:

Error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled. Details: Error parsing near ' <html> Do you want to continue running scripts on this page?

Or

System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception.
System.ComponentModel.Win32Exception: The target principal name is incorrect

Usually this happens if the SPNs of the CRM web service are not set properly and SRS server is unable to get a Service Ticket from the Ticket Granting Server.

To solve it, register the following SPNs:

  • setspn -a http/<CrmApplicationServerName> <CrmAppPoolServiceUserAccount> (E.g. setspn -a http/devcrmserver domain\crmappservice)
  • setspn -a http/<CrmApplicationServer FQDN> <CrmAppPoolServiceUserAccount> (E.g. setspn -a http/ devcrmserver.domainname.com domain\crmappservice)

NOTE: If you have multiple CRM Application servers, you would need to do this for each server.

NOTE: If after you make this change, your users start complaining they can no longer log into CRM, make the following changes on your CRM server ApplicationHost.config file:

1. Open the ApplicationHost.config file in a text editor.
By default, this file is located at %windir%\system32\inetsrv\config\ (Crm server).
For all folders under the Default Web Site location path, set the value of the WindowsAuthentication element and the useAppPoolCredentials attribute to true.

For example:
<system.webServer>
<security>
<authentication>
<windowsAuthentication enabled="true" useAppPoolCredentials="true" />
</authentication>
</security>
</system.webServer>

Try run any of customized reports again, they should work like other any out-of-the-box reports.

2. Run an iisreset

You can find more information here:
1. http://social.microsoft.com/Forums/en/crm/thread/f1c7384f-0eb0-4bf2-a175-bc7fa30e204b
2. http://blog.sonomapartners.com/2007/04/kerberos_and_de.html

Wednesday, April 11, 2012

CRM Report Error: Guid should contain 32 digits with 4 dashes

You receive the following errors when you run a Microsoft Dynamics CRM report in the SRS Report Manager or SRS Report Server:

An error has occurred during report processing (rsProcessingAborted)  Cannot create a connection to data source ‘CRM.’ (rsErrorOpeningConnection)  Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

This error occurs in Microsoft Dynamics CRM 2011 because the Microsoft Dynamics CRM Reporting Extensions requires the user's SystemUserId value as the Log in name and the user's OrganizationId value as the password.

When a report runs inside Microsoft Dynamics CRM, these values are passed automatically. These values must be entered manually when the report is run directly from SQL Server Reporting Services.

Obtain the SystemUserId and OrganizationId from the database and manually enter the values using the following steps:

  • Connect to the SQL server machine that contains the Microsoft Dynamics CRM databases as a user that has admin rights to SQL Server.
  • Click Start, click All Programs, click Microsoft SQL Server, and then click SQL Server Management Studio.
  • Click New Query.
  • Click File, click New, and then click Database Engine Query.
  • Select your <organization>_MSCRM from the dropdown list.
  • Execute the following query:
    • Select FullName, SystemUserId, OrganizationId 
    • From FilteredSystemUser
    • Order by FullName
  •  Locate the user that will run the report.
  • Enter the SystemUserId value into the Login Name box on the report.
  • Enter the OrganizationId value into the password field on the report.
  • Run the report.
Reference:http://support.microsoft.com/kb/2006869