I am trying to bind the data to rdlc
file in a report viewer. Report works fine in machines where Report viewer Redistributable is installed, but not on the others. though I have all the reportviewer
dll's in my application bin I get this error. I am using VS 2013 and click once.
An error occurred during local report processing. - Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Failed to load expression host assembly. Details: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)
private void FaxTemplateMultiFaxLoad(object sender, EventArgs e)
{
try
{
this.MultiReportViewer.ProcessingMode = ProcessingMode.Local;
var permissionSet = new PermissionSet(PermissionState.None);
permissionSet.AddPermission(new FileIOPermission(PermissionState.Unrestricted));
permissionSet.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution |
SecurityPermissionFlag.ControlPrincipal));
this.MultiReportViewer.LocalReport.SetBasePermissionsForSandboxAppDomain(permissionSet);
this.MultiFaxBindingSource.DataSource = this.multiTbaFaxData;
this.MultiReportViewer.LocalReport.ReportPath = @"C:\EnterpriseApp-DEV\WorkStation\" + "Report.rdlc";
this.MultiReportViewer.LocalReport.EnableExternalImages = true;
this.MultiReportViewer.RefreshReport();
this.MultiReportViewer.LocalReport.ReleaseSandboxAppDomain();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Here is the stack trace
at Microsoft.Reporting.WinForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, CreateAndRegisterStream createStreamCallback, Warning[]& warnings)
at Microsoft.Reporting.WinForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings)
at Microsoft.Reporting.WinForms.AsyncMainStreamRenderingOperation.RenderLocalReport(LocalReport report)
at Microsoft.Reporting.WinForms.ReportViewer.AsyncReportOperationWrapper.PerformOperation()
at Microsoft.Reporting.WinForms.ProcessingThread.ProcessThreadMain(Object arg)
Any help to fix this would be much appreciated
User contributions licensed under CC BY-SA 3.0