问题
I have a forms application and it has a reportviewer in it. In the same solution, but different project, I have a report (rdl). I would like to use the report in the different project as the report displayed to the reportviewer. This is opposed to using a report that is deployed to a server.
I originally had this report deployed to a local reporting server. I was using that deployment to display to the reportviewer. However, I would like to use a local one, so that I can upload this to a Mercurial repository with the db, report and form all included.
回答1:
Set your report's Copy to Output Directory
property to Copy Always
then add its path to your ReportViewer
:
this.reportViewer1.LocalReport.ReportPath = "yourReportFileName.rdlc";
来源:https://stackoverflow.com/questions/31550965/reportviewer-and-report-are-in-different-projects-in-the-same-solution-how-do-i