We have a requirement to generate a quote and attach it to a note on a custom entity. What I'm trying to so is to generate a SSRS report as PDF and associate it with an attachment. When using the Report Execution endpoint, the RENDER method fails with all sort of errors. Does CRM allow for rendering a report from a plugin? if yes, are there any other security related settings that can be set to complete execution.
Org Details:
On-premise. SSRS Report is on a custom entity. Create d Plugin to execute on Post Op, Synchronous.
Making use of Andrii Butenko method to generate PDF from SSRS report.
http://a33ik.blogspot.com/2012/11/general-approaches-to-generation-of.html
First Error:
Sandbox SDK Listener - Access Denied.
Caller Information (Client/Host/Worker/Account): USPSICVSAS1481; w3wp.exe (11912); 4DA94491; execution time:00:02:00.2509570/USPSICVSAS1480; Microsoft.Crm.Sandbox.HostService.exe (4336); C0C8CD74; execution time:00:02:34.7576687; PluginProfiler.Plugins, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35:PluginProfiler.Plugins.ProfilerPlugin/USPSICVSAS1480; Microsoft.Crm.Sandbox.WorkerProcess.exe (3288); 0B23E2FF; execution time:00:00:34.5230664/-
Expected Account:-
Second Error: (complains about the Post op failing)
The Web Service plug-in failed in OrganizationId: a50a9976-ae1b-e511-80f1-005056af6e84; SdkMessageProcessingStepId: 4f52082a-614b-e511-80f7-005056af6e84; EntityName: gmc_sfquote; Stage: 40; MessageName: Update; AssemblyName: GM.DSF.Plugins.PostSFQuoteUpdate, DSFPlugins.GenQuote, Version=1.0.0.14, Culture=neutral, PublicKeyToken=ce7b6fa3db2d6d54; ClassName: GM.DSF.Plugins.PostSFQuoteUpdate; Exception: Unhandled Exception: System.Exception: Error generating report - Thread was being aborted.
at GM.DSF.Plugins.ReportGenerator.Render(String Report, FormatType formattype, ParameterValue[] parameters)
at GM.DSF.Plugins.PostSFQuoteUpdate.ExecutePostSFQuoteUpdate(LocalPluginContext localContext)
at GM.DSF.Plugins.Plugin.Execute(IServiceProvider serviceProvider)
at Microsoft.Crm.Extensibility.V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
Third Error ( about the core operation)
The Web Service plug-in failed in OrganizationId: a50a9976-ae1b-e511-80f1-005056af6e84; SdkMessageProcessingStepId: f1fbef1c-1227-e511-80f2-005056af6e84; EntityName: gmc_sfquote; Stage: 30; MessageName: Update; AssemblyName: Microsoft.Crm.Extensibility.InternalOperationPlugin, Microsoft.Crm.ObjectModel, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35; ClassName: Microsoft.Crm.Extensibility.InternalOperationPlugin; Exception: Unhandled Exception: System.Threading.ThreadAbortException: Thread was being aborted.
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.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)
.