Search code examples
visual-studio-2017rdlcreportviewer

need help on Using and Publishing rdlc file


I need a help on using rdlc file in my windows application created in VS 2017 environment.

I read similar thing on Publishing RDLC files but not sure how to use ReportPath, my current code is as follow and works great from visual studio on my machine and I am sure it wont work on client's machine after deployment.

MyRptViewer.LocalReport.ReportPath = Application.StartupPath + "/Reports/MyReport.rdlc";

Does installation create Reports folder and copy .rdlc file to local machine on installation?

I would appreciate if someone can guide me on this.

Thanks.


Solution

  • you can change the rdlc file build action to "embedded resources"

    enter image description here

    and use Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "{AssemblyName}.{ReportName}.rdlc" , this will work without need to copy the report to local machine on installation