In order to publish the application containing reportviewer, you first need to add the required references, go to references and add "Microsoft.Reportviewer.common" and "Microsoft.Reportviewer.Winforms"(or Microsoft.Reportviewer.Webforms if it is a web application) to your project. if you don't have this already in your visual studio then you search online and add it. Now when you go to setup and go to file system, you should enter your applications folder. Here when you add your primary output, reportviewer references should appear as well, but if it doesn't you can add it manually by right clicking on a blank area and going to "add" and enter "assemblies", then add it. Now go to your solution explorer and enter properties - publish - application files. Under "Publish status", ensure that all your report viewer references are set to "include" or "include auto".
Now for the last process. In order to add reportviewer to your application there are some prerequisites you must add these are "Microsoft report viewer 20** runtime" and "Microsoft System CLR Types for SQL Server" (both x64 and x86 for 64 and 32 bit respectively). And you need to add this in two places. First in your setup, right click and go to properties - prerequisites, and add it. Then next in your publish, go to prerequisites and add it as well. If you don't have these prerequisites already in your visual studio, search online and add it.
Note: All these are necessary when you are selecting the option "Download prerequisites from the same location as my application". If you want the other two options, then this process might not be necessary.
No comments:
Post a Comment