0
Good afternoon,
I use Visualstudio 2015 Community on a Windows 10 x64 and am encountering the following problem when running the debug of a Windows Form Application project:
System.MethodAccessException was unhandled
HResult=-2146233072
Message=Falha no método 'Microsoft.Reporting.WinForms.LocalReport..ctor()' ao tentar acessar o método 'Microsoft.ReportingServices.StandalonePreviewStore..ctor()'.
Source=Sistema
StackTrace:
em Microsoft.Reporting.WinForms.LocalReport..ctor() na C:\Projetos\VisualStudio\Sistema\Sistema\Beans\GuiaSadt.cs:linha 0
em Microsoft.Reporting.WinForms.ReportViewer.CreateLocalReport() na C:\Projetos\VisualStudio\Sistema\Sistema\Beans\GuiaSadt.cs:linha 0
em Microsoft.Reporting.WinForms.ReportViewer.Reset() na C:\Projetos\VisualStudio\Sistema\Sistema\Beans\GuiaSadt.cs:linha 0
em Microsoft.Reporting.WinForms.ReportViewer..ctor() na C:\Projetos\VisualStudio\Sistema\Sistema\Beans\GuiaSadt.cs:linha 0
em Sistema.FrmPrincipal.FrmPrincipal_Load(Object sender, EventArgs e) na C:\Projetos\VisualStudio\Sistema\Sistema\FrmPrincipal.cs:linha 181
em System.Windows.Forms.Form.OnLoad(EventArgs e)
em System.Windows.Forms.Form.OnCreateControl()
em System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
em System.Windows.Forms.Control.CreateControl()
em System.Windows.Forms.Control.WmShowWindow(Message& m)
em System.Windows.Forms.Control.WndProc(Message& m)
em System.Windows.Forms.ScrollableControl.WndProc(Message& m)
em System.Windows.Forms.Form.WmShowWindow(Message& m)
em System.Windows.Forms.Form.WndProc(Message& m)
em System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
em System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
em System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
InnerException:
I am using Control Reportviewer inside a Form with nothing else in it and this error happens.
Is there any reference or configuration missing in my project? Grateful.
EDIT: Where the error occurs is the following excerpt:
this.reportViewer1 = new Microsoft.Reporting.WinForms.ReportViewer();
Has more information of the error?
– gato
@Unfortunately not denercarvalho, that’s all that appears in the detail panel of the exception, there is some other information that I can put here or an image.. thanks for the help
– gabriel_albuquerque
What is the method of reportviewer q this given error?
– gato
@Denercarvalho I edited the question with the passage that launches the Exception
– gabriel_albuquerque
You are initiating the object in the load event?
– gato
This
this.reportViewer1 = new Microsoft.Reporting.WinForms.ReportViewer();
is the content of line 181?– gato
@Denercarvalho When I drag the control pro form, the code is automatically created in the form Load event
this.reportViewer1.RefreshReport();
which is line 181 already thenew ReportViewer()
is chado from theInitializeComponents()
form builder– gabriel_albuquerque