位于同一解决方案中的不同项目中

位于同一解决方案中的不同项目中

本文介绍了Reportviewer 和 report 位于同一解决方案中的不同项目中.如何将报告附加到查看器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表单应用程序,其中有一个报表查看器.在同一个解决方案但不同的项目中,我有一份报告(rdl).我想使用不同项目中的报告作为向报告查看器显示的报告.这与使用部署到服务器的报告相反.

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.

我最初将此报告部署到本地报告服务器.我正在使用该部署向报表查看器显示.但是,我想使用本地的,以便我可以将其上传到包含数据库、报告和表单的 Mercurial 存储库.

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.

推荐答案

将报表的Copy to Output Directory 属性设置为 Copy Always 然后将其路径添加到您的 报表查看器:

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";

这篇关于Reportviewer 和 report 位于同一解决方案中的不同项目中.如何将报告附加到查看器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 18:33