Results 1 to 6 of 6

Thread: The variable 'Reportviewer1' is either undeclared or was never assigned

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2016
    Posts
    155

    The variable 'Reportviewer1' is either undeclared or was never assigned

    Problems going from 2013 application to 2019 and report issues. I made sure I have v12 of Microsoft.Reportviewer.Winforms and .Common. Latest version of .Webforms Also have error 'Could not load file or assembly Microsoft.Reportviewer.Common, Version=12.0.0.0, Culture=nuetral, PublicKeyToken=89845ddcd8080cc91' or one of its dependencies. They system can not find the file specified.

    Was working but could not create another report because of another error about a reference already being there so I upgraded the references. It worked until I opened up another report, now none work.

    Why must Microsoft be so hard to deal with?
    Thanks

  2. #2
    PowerPoster jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    2,393

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Apr 2016
    Posts
    155

    Re: The variable 'Reportviewer1' is either undeclared or was never assigned

    OK I think I fixed it by updating all the nuget things I needed but now when I click on the form in the Solutions Explorer is opens the form to code. How do I get it back to the forms designer? Thanks again.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Apr 2016
    Posts
    155

    Re: The variable 'Reportviewer1' is either undeclared or was never assigned

    Well, I added another form and we are back to square one again. So there is something clearly wrong with Reporting in Visual Studio. If I add another form and then try to adda reportviewer to it I get an error on that too. Failed to create component 'ReportViewer. The error message follows: 'System.Runtime.InteropServices.COMException (0x8004D745): A reference to the component 'Microsoft.ReportViewer.Winforms' already exists in the project. Necer had these issues with VS 2013. Is this stuff fixed in a later version of VS than 2019?

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Apr 2016
    Posts
    155

    Re: The variable 'Reportviewer1' is either undeclared or was never assigned

    Install-Package Corrected.Microsoft.ReportingServices.ReportViewerControl.Winforms -Version 150.1358.0 Fixed that issue.

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Apr 2016
    Posts
    155

    Re: The variable 'Reportviewer1' is either undeclared or was never assigned

    it fixed the opening of the form issue. and it fixed the reportviewer issue but the actual report viewer does not show on the new forms. You have to add Me.Controls.Add(Me.Reportviewername) to the InitializeComponent section but then you still can't interact with the reportviewer. Any ideas on that?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width