Results 1 to 22 of 22

Thread: [RESOLVED] Can't get ReportViewer working

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2010
    Posts
    74

    Resolved [RESOLVED] Can't get ReportViewer working

    I'm building a VB.Net Windows Forms application, and I need to incorporate reporting functions into it (just straightforward report generation, viewing and exporting). Much of the data for the reports will be drawn directly from a local Jet 4.0 database, while some will be generated internally by the application.

    I've spent several days attempting to test the ReportViewer control, using VS 2017, 2019 and 2022, but nothing has worked. In most cases I couldn't even get the control to appear in the Toolbox. In the few projects where it did appear, I always got an error message when I attempted to drag it onto a form. I've repeatedly used the NuGet Package Manager to process different versions of the ReportViewer control for Winforms, and other related packages. Now I can't even get ReportViewer to appear in the Toolbox. I've tried the troubleshooting suggestions found on too many technical websites to count, one of which stated that ReportViewer will not work with VS 2022 or any .Net version later than 4.8.1.

    I'll be most appreciative if anyone can tell me the following:
    1. Which versions of Visual Studio and .Net should I be using. My inclination is to use VS 2022 and .Net 6.0, but since I'm not likely to need any of the latest features I'll be happy to use whatever are the latest versions that support Jet 4.0 and the reporting functionality I need, AND will allow the application to run even on old systems (specifically 32 bit machines running Windows 7 or later).
    2. What are the specific steps I need to take to get ReportViewer (or any alternate reporting component) to appear in the Toolbox and function properly on a form?
    Last edited by silverblatt; Feb 2nd, 2023 at 02:20 AM.

  2. #2
    Frenzied Member
    Join Date
    Apr 2016
    Posts
    1,415

    Re: Can't get ReportViewer working

    Hi Silver,

    Don't worry we'll sort you out. Installing the "correct" version of the ReportViewer can be such a headache because for some reason there are versions that work and there are versions that don't work.

    I am using VS 2019 with NET 4.5.

    So first we have to see what you have. Can you go to your "packages" folder and look for: Microsoft.ReportViewer.WinForms.dll

    The file details of the dll will display the version number you have?

    You will find that packages folder where your product file is.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2010
    Posts
    74

    Re: Can't get ReportViewer working

    Thanks, schoemr! I have versions of Microsoft.ReportViewer.WinForms.dll in the following folders:

    ...\.nuget\packages\microsoft.reportingservices.reportviewercontrol.winforms\150.1537.0\lib\net40
    ...\.nuget\packages\microsoft.reportingservices.reportviewercontrol.webforms\150.1537.0\lib\net40
    ...\.nuget\packages\microsoft.reportingservices.reportviewercontrol.winforms\140.340.80\lib\net40

    For each file, when I hover over the filename the version number is displayed in a popup, and that number matches (with an extra period) the name of the folder that is the container of the lib\net40 folder.

  4. #4
    Frenzied Member
    Join Date
    Apr 2016
    Posts
    1,415

    Re: Can't get ReportViewer working

    Is that the "packages" folder where your project files are? It must be where your current project is..

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Apr 2010
    Posts
    74

    Re: Can't get ReportViewer working

    Sorry, I may have misunderstood. No, the projects were each in other folders (I say "were" because I've since deleted them all since none were working). Each of the projects was in a new folder within the C:\Data\ folder, while the Microsoft.ReportViewer.WinForms.dll files are all in folders that are within the C:\Users\Alan\ folder.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Apr 2010
    Posts
    74

    Re: Can't get ReportViewer working

    For example, when I listed ...\.nuget\packages\microsoft.reportingservices.reportviewercontrol.winforms\150.1537.0\lib\net40 folder I actually was referring to the C:\Users\Alan\.nuget\packages\microsoft.reportingservices.reportviewercontrol.winforms\150.1537.0\li b\net40 folder.

  7. #7
    Frenzied Member
    Join Date
    Apr 2016
    Posts
    1,415

    Re: Can't get ReportViewer working

    Oh okay, it seems you downloaded a few ReportViewers but did not install it.

    From Windows Explorer can you browse to the location where your current project files are?

    By default, Visual Studio saves projects in the "Documents\Visual Studio 2019\Projects" - but you may have selected a different location for your project. So you need to find the location of your project.

    Once you have the location, see if there is a folder named "Packages"

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Apr 2010
    Posts
    74

    Re: Can't get ReportViewer working

    OK, I just created and saved a new project in VS 2017 targeting .Net 4.8. The project is saved to the C:\Data\VS 2017\RVTest\ folder. There is no Packages folder in that folder.

  9. #9
    Frenzied Member
    Join Date
    Apr 2016
    Posts
    1,415

    Re: Can't get ReportViewer working

    Okay good. Open your project then:

    Open the NuGet Package Manager in Visual Studio from the "Tools" menu, follow these steps:

    1 - Go to the "Tools" menu
    2 - Select "NuGet Package Manager"
    3 - Select "Manage NuGet Packages for Solution..."

    Then on top click on "Browse" and in the searchbox Type ReportViewer

    I think it says something like ReportViewer for Winforms

    Once you have it install it. You will have to install it to your current project. I think there is a checkbox you must check to install it to your project.

    Let me know if you get this far.

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Apr 2010
    Posts
    74

    Re: Can't get ReportViewer working

    After step 3., when I go into Browse and search for Microsoft.ReportViewer.WinForms, 11 different packages come up, 4 of which are by Microsoft. They are:
    Microsoft.ReportViewer.WinForms version 10.0.40219.1
    Microsoft.ReportingServices.ReportViewerControl.Winforms version 150.1537.0
    Microsoft.ReportViewer.Winforms.2010SP1Upgrade version 10.0.40219.329
    ReportViewerCore.Winforms version 15.1.7

    Which one(s) should I install?

  11. #11
    Frenzied Member
    Join Date
    Apr 2016
    Posts
    1,415

    Re: Can't get ReportViewer working

    Like I said some works, some not but let's see:

    Microsoft.ReportingServices.ReportViewerControl.Winforms version 150.1537.0

  12. #12

    Thread Starter
    Lively Member
    Join Date
    Apr 2010
    Posts
    74

    Re: Can't get ReportViewer working

    OK, that package now appears to have been installed successfully in the project. A new tab opened up in VS, with the header "Action required to load native assemblies" near the top, followed by several paragraphs dealing with special procedures for deploying applications that use "spatial data types".

  13. #13
    Frenzied Member
    Join Date
    Apr 2016
    Posts
    1,415

    Re: Can't get ReportViewer working

    "Action required to load native assemblies" near the top you can ignore:

    Next:

    Right-click on your toolbox and select "Choose items"

    1 - Wait until everything loads

    2 - Click browse button

    3 - Browse to the project that you are working on -> C:\Data\VS 2017\RVTest

    4 - You will now see a new folder that the package installed: "packages"

    5 - Open this folder: Microsoft.ReportingServices.ReportViewerControl.Winforms.150.1537.0

    6 - click on: lib >> net40 >> and here you will find the Microsoft.ReportViewer.WinForms.dll

    7- Click on Open

    8- Now you will see it was added to the .NET Famework Components



    You can find it now in the toolbox ..
    Last edited by schoemr; Feb 2nd, 2023 at 12:58 PM.

  14. #14

    Thread Starter
    Lively Member
    Join Date
    Apr 2010
    Posts
    74

    Re: Can't get ReportViewer working

    On step 5., the exact folder you mentioned was not present - I used the only near match, which was C:\Data\VS 2017\RVTest\packages\Microsoft.ReportingServices.ReportViewerControl.Winforms.150.1537.0\

    On step 6., the exact filename you mentioned was not present - I used the closest match, which was Microsoft.ReportViewer.WinForms.dll

    ReportViewer 15.0.0.0 is now listed in the .NET Framework Components tab of the Choose Toolbox Items dialog box, but the ReportViewer control is still NOT visible in the Toolbox.

  15. #15

    Thread Starter
    Lively Member
    Join Date
    Apr 2010
    Posts
    74

    Re: Can't get ReportViewer working

    Oops, I found it. It had been added out of the normal alphabetical order, so I missed it the first time around.

    I've now succeeded in adding an instance of the ReportViewer to a form. Is there anything else I need to install or test to make sure everything's as it needs to be?

    Also, I'm assuming this procedure should work for VS 2019, but probably not for VS 2022 - your thoughts?

  16. #16
    Frenzied Member
    Join Date
    Apr 2016
    Posts
    1,415

    Re: Can't get ReportViewer working

    Alan, can you just see if you right-click on the toolbox and select "Choose Toolbox Items". Then make sure you have selected the ".NET Framework Components" tab then scroll down the list and check "Microsoft.ReportViewer.WinForms" (it must have a check in the checkbox) You may also see other versions then uncheck it. Just check the version that you installed now.

    Is it like that? If it is checked then it MUST be in the toolbox.

    Also, you must have focus on a Form when you open the toolbox so it will show you available controls for a form.

    e.g. if you have a setting page open, or code, and select toolbox there will be no controls displayed.

    Also, I'm not sure if it will help but you may want to save, go out, and open your project again....
    Last edited by schoemr; Feb 2nd, 2023 at 01:17 PM.

  17. #17
    Frenzied Member
    Join Date
    Apr 2016
    Posts
    1,415

    Re: Can't get ReportViewer working

    Quote Originally Posted by silverblatt View Post
    Oops, I found it. It had been added out of the normal alphabetical order, so I missed it the first time around.

    I've now succeeded in adding an instance of the ReportViewer to a form. Is there anything else I need to install or test to make sure everything's as it needs to be?

    Also, I'm assuming this procedure should work for VS 2019, but probably not for VS 2022 - your thoughts?
    No, that's it...

    Next you have to make sure you have the RDLC designer installed. You will need it to design your reports. If you don't have the RDLC designer installed already then follow the same steps as in post # 9.

    Good luck with your project!

    Let me know if you need help with RDLC reports.

    I'm assuming this procedure should work for VS 2019, but probably not for VS 2022 - your thoughts?
    I don't know...
    Last edited by schoemr; Feb 2nd, 2023 at 01:25 PM.

  18. #18

    Thread Starter
    Lively Member
    Join Date
    Apr 2010
    Posts
    74

    Re: Can't get ReportViewer working

    Thanks so much! Your assistance has been a lifesaver, and I really appreciate your hanging in there with me.

  19. #19

    Thread Starter
    Lively Member
    Join Date
    Apr 2010
    Posts
    74

    Re: Can't get ReportViewer working

    I'm not seeing RDLC Designer anywhere. It's not in the Toolbox, nor in the Toolbox's Choose Items... list, nor when using that list's Browse function to look at the project's Packages folder, nor in the Manage NuGet Packages for Solution's Browse function. I went to https://marketplace.visualstudio.com...&ssr=false#qna and clicked the Download button, which launch VSIX and SEEMED to install the RDLC Report Designer successfully for both VS 2017 and VS 2019. But after re-saving and re-building the project, exiting VS and then re-starting it and reloading the project, I still can't see RDLC designer anywhere. Not sure what to do next ...

  20. #20
    Frenzied Member
    Join Date
    Apr 2016
    Posts
    1,415

    Re: Can't get ReportViewer working

    It's not in the toolbox 🙂

    In your project explorer right click on your project and select 'add >> new item'

    Go down the list en select "Report". You will be prompted to name it and you will see the .rdlc extension.

  21. #21

    Thread Starter
    Lively Member
    Join Date
    Apr 2010
    Posts
    74

    Re: Can't get ReportViewer working

    OK, got it. Thanks again!

  22. #22
    Frenzied Member
    Join Date
    Apr 2016
    Posts
    1,415

    Re: Can't get ReportViewer working

    Quote Originally Posted by silverblatt View Post
    OK, got it. Thanks again!
    You're welcome. The next thing you will have to do is to add your dataset to the project. You can't design a report without data..

Tags for this Thread

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