0
votes

Sometimes it is necessary to republish the CRM reports by going to C:\Program Files\Microsoft Dynamics CRM\Tools\ on the server and running PublishReports.exe (http://community.dynamics.com/crm/b/crmguyriddle/archive/2008/06/26/re-publish-crm-reports-in-srs.aspx).

Is there an CRM 2011 SDK method to do this from code (C#)? I want to do this from an application running on a remote machine.

1
Why do you need to call PublishReports.exe from C# code on a remote server? It is very unusual to run PublishReports.exe unless SSRS gets corrupted or is moved/rebuilt.Nicknow
@Nicknow Automation of maintenance.pkr

1 Answers

1
votes

There is no CRM SDK method to do what PublishReports.exe does. PublishReports.exe calls methods from the CRM setup DLLs (not part of the SDK and are not available to the CRM server code itself.)

In short, what PublishReports.exe does is exactly what the CRM Org Setup process does to get the reports to SQL RS - first, it creates the shared data sources and then it reads the report information from the Org DB (using SQL) and calls the SSRS webservice to publish the reports.

You can look at the public methods (ConfigureReports and OrganizationPublishReportsScaleGroup in Microsoft.Crm.Setup.Server.Utility (located in the same directory as PublishReports.exe) but this is completely undocumented and unsupported. I'm not sure it would work.