Hello All,
I am running VS2010 and my application is in WPF, I am using RDLC report
I am having an issue to use reportviewer of winform control in WPF. I got an exception while debug the code as follows
The runtime has encountered a fatal error. The address of the error was at 0x6657f96c, on thread 0x1a68. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug
include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.
I got the above exception on the line reportViewer.RefreshReport();
the same exception my client got on his pc and it is strange if I run the application using exe I didn't get any exception and report generated successfully.
My C# code is below (I written this code in UserControl_Load event)
reportViewer.LocalReport.ReportEmbeddedResource = ReportEmbeddedResource;
reportViewer.LocalReport.ExecuteReportInCurrentAppDomain(Assembly.GetExecutingAssembly().Evidence);
reportViewer.LocalReport.DataSources.Clear();
reportViewer.LocalReport.DataSources.Add(rptSource);
reportViewer.RefreshReport();
MY Xaml code :
<WindowsFormsHost HorizontalAlignment="Stretch" Name="windowsFormsHost1" VerticalAlignment="Stretch" >
<reports:ReportViewer x:Name="reportViewer" ProcessingMode="Local" />
</WindowsFormsHost>
If you have any kind of resolution please share.
Many thanks in advance,