CRM 2016 On premises
I have previously created a SSRS report using SQL server as a data source, uploaded it into CRM and accessed it vis a workflow.
I have now created a SSRS report using fetch XML and uploaded it into CRM. on the SQL server , I can log into reporting services as Domain Admin and can run the report, likewise in CRM, logged in as Domain Admin I cam run the report from the report page. … so far so good.
Using the same code for a workflow to generate a PDF of the report, I keep getting an error 'user was not found'
I have checked the code of the workflow that generates a PDF from a report ( report using SQL data Source ) and apart from the report name, the code is sound.
I'm presuming it is something to do with the Data Source being accessed from a workflow
1. signed into CRM as Domain/Admin I can manually run the report
2. signed into Reporting services as Domain/Admin I can run the report
3. the CRM process was generated under Domain/Admin and executes as owner of the workflow ( Domain/Admin) and scope is Organization
When the workflow is executed I get the following error in reporting services
processing!ReportServer_0-1!12e8!01/04/2020-18:08:12:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: , Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Cannot create a connection to data source 'CRMXML'. ---> Microsoft.Crm.Reporting.DataExtensionShim.Common.ReportExecutionException:
Microsoft.Crm.CrmException: An unexpected error occurred.
Microsoft.Crm.CrmConfigObjectNotFoundException: User Was Not Found ---> Microsoft.Crm.Reporting.DataExtensionShim.Common.ReportExecutionException: An unexpected error occurred. ---> Microsoft.Crm.Reporting.DataExtensionShim.Common.ReportExecutionException: User Was Not Found
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at Microsoft.Crm.Reporting.DataExtension.Common.ExceptionManager.HandleUnsafeException(Action body)
at Microsoft.Crm.Reporting.DataExtensionShim.Common.ICrmDbConnectionExtension.Open(String userSid)
at Microsoft.ReportingServices.Diagnostics.DataExtensionConnectionBase.<>c__DisplayClass5.<OpenConnection>b__4()
--- End of inner exception stack trace ---;
processing!ReportServer_0-1!12e8!01/04/2020-18:08:12:: e ERROR: Data source 'CRMXML': An error has occurred. Details: Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Cannot create a connection to data source 'CRMXML'. ---> Microsoft.Crm.Reporting.DataExtensionShim.Common.ReportExecutionException:
Microsoft.Crm.CrmException: An unexpected error occurred.
Microsoft.Crm.CrmConfigObjectNotFoundException: User Was Not Found ---> Microsoft.Crm.Reporting.DataExtensionShim.Common.ReportExecutionException: An unexpected error occurred. ---> Microsoft.Crm.Reporting.DataExtensionShim.Common.ReportExecutionException: User Was Not Found
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at Microsoft.Crm.Reporting.DataExtension.Common.ExceptionManager.HandleUnsafeException(Action body)
at Microsoft.Crm.Reporting.DataExtensionShim.Common.ICrmDbConnectionExtension.Open(String userSid)
at Microsoft.ReportingServices.Diagnostics.DataExtensionConnectionBase.<>c__DisplayClass5.<OpenConnection>b__4()
--- End of inner exception stack trace ---
at Microsoft.ReportingServices.Diagnostics.DataExtensionConnectionBase.<>c__DisplayClass5.<OpenConnection>b__4()
at Microsoft.ReportingServices.Diagnostics.Utilities.DefaultActivitiesFactory.CreateSyncActivityAndReportResult(RSActivityType activityType, Action action)
at Microsoft.ReportingServices.Diagnostics.DataExtensionConnectionBase.<>c__DisplayClass2.<OpenDataSourceExtensionConnection>b__0()
at Microsoft.ReportingServices.Diagnostics.DataExtensionConnectionBase.HandleImpersonation(IProcessingDataSource dataSource, DataSourceInfo dataSourceInfo, String datasetName, IDbConnection connection, Action afterImpersonationAction)
at Microsoft.ReportingServices.Diagnostics.DataExtensionConnectionBase.OpenDataSourceExtensionConnection(IProcessingDataSource dataSourceObj, String connectString, DataSourceInfo dataSourceInfo, String datasetName)
at Microsoft.ReportingServices.OnDemandProcessing.RuntimeDataSource.<>c__DisplayClass1.<OpenConnection>b__0()
at Microsoft.ReportingServices.Diagnostics.Utilities.DefaultActivitiesFactory.CreateSyncActivityAndReportResult(RSActivityType activityType, Action action)
at Microsoft.ReportingServices.OnDemandProcessing.RuntimeDataSource.OpenConnection(DataSource dataSourceObj, DataSet dataSetObj, OnDemandProcessingContext pc, DataProcessingMetrics metrics)
at Microsoft.ReportingServices.OnDemandProcessing.RuntimeDataSource.OpenInitialConnectionAndTransaction()
at Microsoft.ReportingServices.OnDemandProcessing.RuntimeDataSource.InitializeDataSource(ExecutedQuery existingQuery)
at Microsoft.ReportingServices.OnDemandProcessing.RuntimeAtomicDataSource.Process(Boolean fromOdp)
processing!ReportServer_0-1!12e8!01/04/2020-18:08:12:: e ERROR: An exception has occurred in data source 'CRMXML'. Details: Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Cannot create a connection to data source 'CRMXML'. ---> Microsoft.Crm.Reporting.DataExtensionShim.Common.ReportExecutionException:
Microsoft.Crm.CrmException: An unexpected error occurred.
Microsoft.Crm.CrmConfigObjectNotFoundException: User Was Not Found ---> Microsoft.Crm.Reporting.DataExtensionShim.Common.ReportExecutionException: An unexpected error occurred. ---> Microsoft.Crm.Reporting.DataExtensionShim.Common.ReportExecutionException: User Was Not Found
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at Microsoft.Crm.Reporting.DataExtension.Common.ExceptionManager.HandleUnsafeException(Action body)
at Microsoft.Crm.Reporting.DataExtensionShim.Common.ICrmDbConnectionExtension.Open(String userSid)
at Microsoft.ReportingServices.Diagnostics.DataExtensionConnectionBase.<>c__DisplayClass5.<OpenConnection>b__4()
--- End of inner exception stack trace ---
at Microsoft.ReportingServices.Diagnostics.DataExtensionConnectionBase.<>c__DisplayClass5.<OpenConnection>b__4()
at Microsoft.ReportingServices.Diagnostics.Utilities.DefaultActivitiesFactory.CreateSyncActivityAndReportResult(RSActivityType activityType, Action action)
at Microsoft.ReportingServices.Diagnostics.DataExtensionConnectionBase.<>c__DisplayClass2.<OpenDataSourceExtensionConnection>b__0()
at Microsoft.ReportingServices.Diagnostics.DataExtensionConnectionBase.HandleImpersonation(IProcessingDataSource dataSource, DataSourceInfo dataSourceInfo, String datasetName, IDbConnection connection, Action afterImpersonationAction)
at Microsoft.ReportingServices.Diagnostics.DataExtensionConnectionBase.OpenDataSourceExtensionConnection(IProcessingDataSource dataSourceObj, String connectString, DataSourceInfo dataSourceInfo, String datasetName)
at Microsoft.ReportingServices.OnDemandProcessing.RuntimeDataSource.<>c__DisplayClass1.<OpenConnection>b__0()
at Microsoft.ReportingServices.Diagnostics.Utilities.DefaultActivitiesFactory.CreateSyncActivityAndReportResult(RSActivityType activityType, Action action)
at Microsoft.ReportingServices.OnDemandProcessing.RuntimeDataSource.OpenConnection(DataSource dataSourceObj, DataSet dataSetObj, OnDemandProcessingContext pc, DataProcessingMetrics metrics)
at Microsoft.ReportingServices.OnDemandProcessing.RuntimeDataSource.OpenInitialConnectionAndTransaction()
at Microsoft.ReportingServices.OnDemandProcessing.RuntimeDataSource.InitializeDataSource(ExecutedQuery existingQuery)
at Microsoft.ReportingServices.OnDemandProcessing.RuntimeAtomicDataSource.Process(Boolean fromOdp)
processing!ReportServer_0-1!12e8!01/04/2020-18:08:12:: i INFO: DataPrefetch abort handler called for Report with ID=. Aborting data sources ...
processing!ReportServer_0-1!12e8!01/04/2020-18:08:12:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: [AbnormalTermination:ReportProcessing], Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: An error has occurred during report processing. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Cannot create a connection to data source 'CRMXML'. ---> Microsoft.Crm.Reporting.DataExtensionShim.Common.ReportExecutionException:
Microsoft.Crm.CrmException: An unexpected error occurred.
Microsoft.Crm.CrmConfigObjectNotFoundException: User Was Not Found ---> Microsoft.Crm.Reporting.DataExtensionShim.Common.ReportExecutionException: An unexpected error occurred. ---> Microsoft.Crm.Reporting.DataExtensionShim.Common.ReportExecutionException: User Was Not Found
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at Microsoft.Crm.Reporting.DataExtension.Common.ExceptionManager.HandleUnsafeException(Action body)
at Microsoft.Crm.Reporting.DataExtensionShim.Common.ICrmDbConnectionExtension.Open(String userSid)
at Microsoft.ReportingServices.Diagnostics.DataExtensionConnectionBase.<>c__DisplayClass5.<OpenConnection>b__4()
--- End of inner exception stack trace ---
at Microsoft.ReportingServices.Diagnostics.DataExtensionConnectionBase.<>c__DisplayClass5.<OpenConnection>b__4()
at Microsoft.ReportingServices.Diagnostics.Utilities.DefaultActivitiesFactory.CreateSyncActivityAndReportResult(RSActivityType activityType, Action action)
at Microsoft.ReportingServices.Diagnostics.DataExtensionConnectionBase.<>c__DisplayClass2.<OpenDataSourceExtensionConnection>b__0()
at Microsoft.ReportingServices.Diagnostics.DataExtensionConnectionBase.HandleImpersonation(IProcessingDataSource dataSource, DataSourceInfo dataSourceInfo, String datasetName, IDbConnection connection, Action afterImpersonationAction)
at Microsoft.ReportingServices.Diagnostics.DataExtensionConnectionBase.OpenDataSourceExtensionConnection(IProcessingDataSource dataSourceObj, String connectString, DataSourceInfo dataSourceInfo, String datasetName)
at Microsoft.ReportingServices.OnDemandProcessing.RuntimeDataSource.<>c__DisplayClass1.<OpenConnection>b__0()
at Microsoft.ReportingServices.Diagnostics.Utilities.DefaultActivitiesFactory.CreateSyncActivityAndReportResult(RSActivityType activityType, Action action)
at Microsoft.ReportingServices.OnDemandProcessing.RuntimeDataSource.OpenConnection(DataSource dataSourceObj, DataSet dataSetObj, OnDemandProcessingContext pc, DataProcessingMetrics metrics)
at Microsoft.ReportingServices.OnDemandProcessing.RuntimeDataSource.OpenInitialConnectionAndTransaction()
at Microsoft.ReportingServices.OnDemandProcessing.RuntimeDataSource.InitializeDataSource(ExecutedQuery existingQuery)
at Microsoft.ReportingServices.OnDemandProcessing.RuntimeAtomicDataSource.Process(Boolean fromOdp)
at Microsoft.ReportingServices.OnDemandProcessing.RuntimeAtomicDataS
library!ReportServer_0-1!12e8!01/04/2020-18:08:12:: w WARN: Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: An error has occurred during report processing. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Cannot create a connection to data source 'CRMXML'. ---> Microsoft.Crm.Reporting.DataExtensionShim.Common.ReportExecutionException:
Microsoft.Crm.CrmException: An unexpected error occurred.
Microsoft.Crm.CrmConfigObjectNotFoundException: User Was Not Found ---> Microsoft.Crm.Reporting.DataExtensionShim.Common.ReportExecutionException: An unexpected error occurred. ---> Microsoft.Crm.Reporting.DataExtensionShim.Common.ReportExecutionException: User Was Not Found
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at Microsoft.Crm.Reporting.DataExtension.Common.ExceptionManager.HandleUnsafeException(Action body)
at Microsoft.Crm.Reporting.DataExtensionShim.Common.ICrmDbConnectionExtension.Open(String userSid)
at Microsoft.ReportingServices.Diagnostics.DataExtensionConnectionBase.<>c__DisplayClass5.<OpenConnection>b__4()
--- End of inner exception stack trace ---
at Microsoft.ReportingServices.Diagnostics.DataExtensionConnectionBase.<>c__DisplayClass5.<OpenConnection>b__4()
at Microsoft.ReportingServices.Diagnostics.Utilities.DefaultActivitiesFactory.CreateSyncActivityAndReportResult(RSActivityType activityType, Action action)
at Microsoft.ReportingServices.Diagnostics.DataExtensionConnectionBase.<>c__DisplayClass2.<OpenDataSourceExtensionConnection>b__0()
at Microsoft.ReportingServices.Diagnostics.DataExtensionConnectionBase.HandleImpersonation(IProcessingDataSource dataSource, DataSourceInfo dataSourceInfo, String datasetName, IDbConnection connection, Action afterImpersonationAction)
at Microsoft.ReportingServices.Diagnostics.DataExtensionConnectionBase.OpenDataSourceExtensionConnection(IProcessingDataSource dataSourceObj, String connectString, DataSourceInfo dataSourceInfo, String datasetName)
at Microsoft.ReportingServices.OnDemandProcessing.RuntimeDataSource.<>c__DisplayClass1.<OpenConnection>b__0()
at Microsoft.ReportingServices.Diagnostics.Utilities.DefaultActivitiesFactory.CreateSyncActivityAndReportResult(RSActivityType activityType, Action action)
at Microsoft.ReportingServices.OnDemandProcessing.RuntimeDataSource.OpenConnection(DataSource dataSourceObj, DataSet dataSetObj, OnDemandProcessingContext pc, DataProcessingMetrics metrics)
at Microsoft.ReportingServices.OnDemandProcessing.RuntimeDataSource.OpenInitialConnectionAndTransaction()
at Microsoft.ReportingServices.OnDemandProcessing.RuntimeDataSource.InitializeDataSource(ExecutedQuery existingQuery)
at Microsoft.ReportingServices.OnDemandProcessing.RuntimeAtomicDataSource.Process(Boolean fromOdp)
at Microsoft.ReportingServices.OnDemandProcessing.RuntimeAtomicDataSource.ProcessConcurrent(Object threadSet)
--- End of inner exception stack trace ---
at Microsoft.ReportingService