Hello,
I have an issue when trying to export a list of contact records in a associated view to a dynamic excel spreadsheet. However it works fine when you export the view to a static spreadsheet.
I have checked to see if there are any fields with identical display names and tried creating a new view with just one out of the box column but i still get the same error. Any type of advice is greatly appreciated.
Cheers.
Below you will find the trace error log and a screenshot of the error thrown:
[2020-02-06 10:32:10.972] Process: w3wp |Organization:a1b61a5c-9c9c-e411-ab0b-005056a832a7 |Thread: 38 |Category: ObjectModel |User: 6d996d00-d8e6-4574-a631-c1005fdc6a07 |Level: Error |ReqId: f6b7bb9a-528f-4758-b378-a3937a9813db | CrmTableAdapter.RetrieveData ilOffset = 0x0
>QueryApi call, ListMember.RetrieveByObject, not valid for export to excel (XLSX)
[2020-02-06 10:32:11.066] Process: w3wp |Organization:a1b61a5c-9c9c-e411-ab0b-005056a832a7 |Thread: 38 |Category: Exception |User: 6d996d00-d8e6-4574-a631-c1005fdc6a07 |Level: Error |ReqId: f6b7bb9a-528f-4758-b378-a3937a9813db | CrmException..ctor ilOffset = 0xA
at CrmException..ctor(String formattedErrorMessage, Int32 errorCode, Object[] arguments) ilOffset = 0xA
at DataRetriever.GetInstance(QueryApiInformation queryApiInformation, EntityExpression entityExpression, ExecutionContext context) ilOffset = 0x498
at CrmTableAdapter.RetrieveData() ilOffset = 0x0
at CrmTableAdapter.GenerateRows() ilOffset = 0x58
at CrmTableAdapter.get_Rows() ilOffset = 0xA
at ExcelGenerator..ctor(ISpreadsheet spreadsheet) ilOffset = 0x14
at ExcelService.GenerateXlsx(CrmTableAdapter crmTableAdapter) ilOffset = 0x6
at ExcelService.ExportDynamicToExcel(EntityReference view, String fetchXml, String layoutXml, ExportDynamicToExcelType exportType, String postData, Boolean isRefresh, String queryApi, InputArgumentCollection queryParameters, ExecutionContext executionContext) ilOffset = 0x9F
at RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) ilOffset = 0xFFFFFFFF
at RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) ilOffset = 0x16
at RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) ilOffset = 0x6C
at MethodBase.Invoke(Object obj, Object[] parameters) ilOffset = 0x0
at LogicalMethodInfo.Invoke(Object target, Object[] values) ilOffset = 0x3F
at InternalOperationPlugin.Execute(IServiceProvider serviceProvider) ilOffset = 0x43
at V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context) ilOffset = 0x0
at VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context) ilOffset = 0x65
at Pipeline.Execute(PipelineExecutionContext context) ilOffset = 0x6C
at MessageProcessor.Execute(PipelineExecutionContext context) ilOffset = 0x1CB
at InternalMessageDispatcher.Execute(PipelineExecutionContext context) ilOffset = 0xE4
at ExternalMessageDispatcher.ExecuteInternal(IInProcessOrganizationServiceFactory serviceFactory, IPlatformMessageDispatcherFactory dispatcherFactory, String messageName, String requestName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, ParameterCollection fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId, Guid transactionContextId, Int32 invocationSource, Nullable`1 requestId, Version endpointVersion) ilOffset = 0x16E
at OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, UserAuth userAuth, Guid targetUserId, OrganizationContext context, Boolean returnResponse, Boolean checkAdminMode) ilOffset = 0x0
at OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode) ilOffset = 0x23
at OrganizationSdkServiceInternal.Execute(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode) ilOffset = 0x0
at InprocessServiceProxy.ExecuteCore(OrganizationRequest request) ilOffset = 0x34
at PlatformCommand.XrmExecuteInternal() ilOffset = 0xBC
at ExportDynamicToExcelCommand.Execute() ilOffset = 0x0
at ExportLiveTemplatePage.ConfigurePageForDynamicXlsx(String gridXml, String fetchXml, String layoutXml, Guid viewId, ViewType viewType, ExportDynamicToExcelType exportType) ilOffset = 0xBF
at ExportLiveTemplatePage.ConfigurePage() ilOffset = 0x42D
at AppUIPage.OnPreRender(EventArgs e) ilOffset = 0xD
at Control.PreRenderRecursiveInternal() ilOffset = 0x54
at Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ilOffset = 0x6D3
at Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ilOffset = 0x3C
at Page.ProcessRequest() ilOffset = 0x14
at Page.ProcessRequest(HttpContext context) ilOffset = 0x38
at CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() ilOffset = 0x18D
at HttpApplication.ExecuteStepImpl(IExecutionStep step) ilOffset = 0x64
at HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) ilOffset = 0x15
at ApplicationStepManager.ResumeSteps(Exception error) ilOffset = 0xF6
at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) ilOffset = 0x5C
at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) ilOffset = 0x15B
at HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr) ilOffset = 0x32
at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType) ilOffset = 0x4B
>Crm Exception: Message: Failed to generate excel., ErrorCode: -2147088185
[2020-02-06 10:32:11.066] Process: w3wp |Organization:a1b61a5c-9c9c-e411-ab0b-005056a832a7 |Thread: 38 |Category: Platform.Sdk |User: 6d996d00-d8e6-4574-a631-c1005fdc6a07 |Level: Error |ReqId: f6b7bb9a-528f-4758-b378-a3937a9813db | VersionedPluginProxyStepBase.Execute ilOffset = 0x65
>Web Service Plug-in failed in SdkMessageProcessingStepId: {8AD3883A-92E9-4D4C-837E-74A85A9628C7}; EntityName: none; Stage: 30; MessageName: ExportDynamicToExcel; AssemblyName: Microsoft.Crm.Extensibility.InternalOperationPlugin, Microsoft.Crm.ObjectModel, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35; ClassName: Microsoft.Crm.Extensibility.InternalOperationPlugin; Exception: Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at System.Web.Services.Protocols.LogicalMethodInfo.Invoke(Object target, Object[] values)
at Microsoft.Crm.Extensibility.InternalOperationPlugin.Execute(IServiceProvider serviceProvider)
at Microsoft.Crm.Extensibility.V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
Inner Exception: Microsoft.Crm.CrmException: Failed to generate excel.
at Microsoft.Crm.ObjectModel.DataRetriever.GetInstance(QueryApiInformation queryApiInformation, EntityExpression entityExpression, ExecutionContext context)
at Microsoft.Crm.ObjectModel.CrmTableAdapter.RetrieveData()
at Microsoft.Crm.ObjectModel.CrmTableAdapter.GenerateRows()
at Microsoft.Crm.ObjectModel.CrmTableAdapter.get_Rows()
at Microsoft.Xrm.Office.ExcelGenerator..ctor(ISpreadsheet spreadsheet)
at Microsoft.Crm.ObjectModel.ExcelService.GenerateXlsx(CrmTableAdapter crmTableAdapter)
at Microsoft.Crm.ObjectModel.ExcelService.ExportDynamicToExcel(EntityReference view, String fetchXml, String layoutXml, ExportDynamicToExcelType exportType, String postData, Boolean isRefresh, String queryApi, InputArgumentCollection queryParameters, ExecutionContext executionContext)
.
[2020-02-06 10:32:11.066] Process: w3wp |Organization:a1b61a5c-9c9c-e411-ab0b-005056a832a7 |Thread: 38 |Category: Exception |User: 6d996d00-d8e6-4574-a631-c1005fdc6a07 |Level: Error |ReqId: f6b7bb9a-528f-4758-b378-a3937a9813db | CrmException..ctor ilOffset = 0xA
at CrmException..ctor(String message, Exception innerException, Int32 errorCode) ilOffset = 0xA
at RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) ilOffset = 0xFFFFFFFF
at RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) ilOffset = 0xF4
at RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) ilOffset = 0x1C8
at Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) ilOffset = 0xAF
at Activator.CreateInstance(Type type, Object[] args) ilOffset = 0x0
at VersionedPluginProxyStepBase.WrapExceptionToThrow(CrmException exception) ilOffset = 0x63
at VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context) ilOffset = 0x65
at Pipeline.Execute(PipelineExecutionContext context) ilOffset = 0x6C
at MessageProcessor.Execute(PipelineExecutionContext context) ilOffset = 0x1CB
at InternalMessageDispatcher.Execute(PipelineExecutionContext context) ilOffset = 0xE4
at ExternalMessageDispatcher.ExecuteInternal(IInProcessOrganizationServiceFactory serviceFactory, IPlatformMessageDispatcherFactory dispatcherFactory, String messageName, String requestName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, ParameterCollection fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId, Guid transactionContextId, Int32 invocationSource, Nullable`1 requestId, Version endpointVersion) ilOffset = 0x16E
at OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, UserAuth userAuth, Guid targetUserId, OrganizationContext context, Boolean returnResponse, Boolean checkAdminMode) ilOffset = 0x0
at OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode) ilOffset = 0x23
at OrganizationSdkServiceInternal.Execute(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode) ilOffset = 0x0
at InprocessServiceProxy.ExecuteCore(OrganizationRequest request) ilOffset = 0x34
at PlatformCommand.XrmExecuteInternal() ilOffset = 0xBC
at ExportDynamicToExcelCommand.Execute() ilOffset = 0x0
at ExportLiveTemplatePage.ConfigurePageForDynamicXlsx(String gridXml, String fetchXml, String layoutXml, Guid viewId, ViewType viewType, ExportDynamicToExcelType exportType) ilOffset = 0xBF
at ExportLiveTemplatePage.ConfigurePage() ilOffset = 0x42D
at AppUIPage.OnPreRender(EventArgs e) ilOffset = 0xD
at Control.PreRenderRecursiveInternal() ilOffset = 0x54
at Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ilOffset = 0x6D3
at Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ilOffset = 0x3C
at Page.ProcessRequest() ilOffset = 0x14
at Page.ProcessRequest(HttpContext context) ilOffset = 0x38
at CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() ilOffset = 0x18D
at HttpApplication.ExecuteStepImpl(IExecutionStep step) ilOffset = 0x64
at HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) ilOffset = 0x15
at ApplicationStepManager.ResumeSteps(Exception error) ilOffset = 0xF6
at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) ilOffset = 0x5C
at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) ilOffset = 0x15B
at HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr) ilOffset = 0x32
at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType) ilOffset = 0x4B
>Crm Exception: Message: Failed to generate excel., ErrorCode: -2147088185, InnerException: Microsoft.Crm.CrmException: Failed to generate excel.
at Microsoft.Crm.ObjectModel.DataRetriever.GetInstance(QueryApiInformation queryApiInformation, EntityExpression entityExpression, ExecutionContext context)
at Microsoft.Crm.ObjectModel.CrmTableAdapter.RetrieveData()
at Microsoft.Crm.ObjectModel.CrmTableAdapter.GenerateRows()
at Microsoft.Crm.ObjectModel.CrmTableAdapter.get_Rows()
at Microsoft.Xrm.Office.ExcelGenerator..ctor(ISpreadsheet spreadsheet)
at Microsoft.Crm.ObjectModel.ExcelService.GenerateXlsx(CrmTableAdapter crmTableAdapter)
at Microsoft.Crm.ObjectModel.ExcelService.ExportDynamicToExcel(EntityReference view, String fetchXml, String layoutXml, ExportDynamicToExcelType exportType, String postData, Boolean isRefresh, String queryApi, InputArgumentCollection queryParameters, ExecutionContext executionContext)
[2020-02-06 10:32:11.066] Process: w3wp |Organization:a1b61a5c-9c9c-e411-ab0b-005056a832a7 |Thread: 38 |Category: Platform |User: 6d996d00-d8e6-4574-a631-c1005fdc6a07 |Level: Error |ReqId: f6b7bb9a-528f-4758-b378-a3937a9813db | MessageProcessor.Execute ilOffset = 0x1CB
>MessageProcessor fail to process message 'ExportDynamicToExcel' for 'none'.
[2020-02-06 10:32:11.066] Process: w3wp |Organization:00000000-0000-0000-0000-000000000000 |Thread: 38 |Category: Exception |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: f6b7bb9a-528f-4758-b378-a3937a9813db | PlatformCommand.CreateCrmExceptionFromServiceFault ilOffset = 0x1B
at PlatformCommand.CreateCrmExceptionFromServiceFault(FaultException`1 fe) ilOffset = 0x1B
at PlatformCommand.XrmExecuteInternal() ilOffset = 0xBC
at ExportDynamicToExcelCommand.Execute() ilOffset = 0x0
at ExportLiveTemplatePage.ConfigurePageForDynamicXlsx(String gridXml, String fetchXml, String layoutXml, Guid viewId, ViewType viewType, ExportDynamicToExcelType exportType) ilOffset = 0xBF
at ExportLiveTemplatePage.ConfigurePage() ilOffset = 0x42D
at AppUIPage.OnPreRender(EventArgs e) ilOffset = 0xD
at Control.PreRenderRecursiveInternal() ilOffset = 0x54
at Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ilOffset = 0x6D3
at Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ilOffset = 0x3C
at Page.ProcessRequest() ilOffset = 0x14
at Page.ProcessRequest(HttpContext context) ilOffset = 0x38
at CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() ilOffset = 0x18D
at HttpApplication.ExecuteStepImpl(IExecutionStep step) ilOffset = 0x64
at HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) ilOffset = 0x15
at ApplicationStepManager.ResumeSteps(Exception error) ilOffset = 0xF6
at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) ilOffset = 0x5C
at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) ilOffset = 0x15B
at HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr) ilOffset = 0x32
at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType) ilOffset = 0x4B
>Crm Exception: Message: Failed to generate excel., ErrorCode: -2147088185
[2020-02-06 10:32:11.190] Process: w3wp |Organization:a1b61a5c-9c9c-e411-ab0b-005056a832a7 |Thread: 38 |Category: Application |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: f6b7bb9a-528f-4758-b378-a3937a9813db | ErrorInformation.LogError ilOffset = 0x21
>MSCRM Error Report:
--------------------------------------------------------------------------------------------------------
Error: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Error Number: 0x800608C7
Error Message: Failed to generate excel.
Error Details: Failed to generate excel.
Source File: Not available
Line Number: Not available
Request URL: https://.../_grid/print/export_live.aspx
Stack Trace Info: [CrmException: Failed to generate excel.]
at Microsoft.Crm.Application.Platform.ServiceCommands.PlatformCommand.XrmExecuteInternal()
at Microsoft.Crm.Application.Platform.ServiceCommands.ExportDynamicToExcelCommand.Execute()
at Microsoft.Crm.Controls.ExportLiveTemplatePage.ConfigurePageForDynamicXlsx(String gridXml, String fetchXml, String layoutXml, Guid viewId, ViewType viewType, ExportDynamicToExcelType exportType)
at Microsoft.Crm.Controls.ExportLiveTemplatePage.ConfigurePage()
at Microsoft.Crm.Application.Controls.AppUIPage.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
[HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown.]
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
[2020-02-06 10:32:11.190] Process: w3wp |Organization:00000000-0000-0000-0000-000000000000 |Thread: 38 |Category: Platform |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: f6b7bb9a-528f-4758-b378-a3937a9813db | ExceptionConverter.ToSingleFaultUnTyped ilOffset = 0x35
>UNEXPECTED: no fault?
[2020-02-06 10:32:11.206] Process: w3wp |Organization:00000000-0000-0000-0000-000000000000 |Thread: 38 |Category: Platform |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: f6b7bb9a-528f-4758-b378-a3937a9813db | ExceptionConverter.ConvertMessageAndErrorCode ilOffset = 0x222
>System.Web.HttpUnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #7C2DA7CD: System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> Microsoft.Crm.CrmException: Failed to generate excel.
> at Microsoft.Crm.Application.Platform.ServiceCommands.PlatformCommand.XrmExecuteInternal()
> at Microsoft.Crm.Application.Platform.ServiceCommands.ExportDynamicToExcelCommand.Execute()
> at Microsoft.Crm.Controls.ExportLiveTemplatePage.ConfigurePageForDynamicXlsx(String gridXml, String fetchXml, String layoutXml, Guid viewId, ViewType viewType, ExportDynamicToExcelType exportType)
> at Microsoft.Crm.Controls.ExportLiveTemplatePage.ConfigurePage()
> at Microsoft.Crm.Application.Controls.AppUIPage.OnPreRender(EventArgs e)
> at System.Web.UI.Control.PreRenderRecursiveInternal()
> at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
> at System.Web.UI.Page.HandleError(Exception e)
> at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
> at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
> at System.Web.UI.Page.ProcessRequest()
> at System.Web.UI.Page.ProcessRequest(HttpContext context)
> at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
> at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
> at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)