mak101
mak101

Reputation: 147

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.

Upvotes: 0

Views: 212

Answers (1)

NajiMakhoul
NajiMakhoul

Reputation: 1716

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

Upvotes: 1

Related Questions