Reportviewer and report are in different projects in the same solution. How do I attach the report to the viewer

☆樱花仙子☆ 提交于 2019-12-24 08:59:17

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!