我试图在C#中使用报告工作。我试图嵌入我的RDLC文件,例如:处理“非法路径”中的C#报告错误
var reportDataSource = new ReportDataSource("ProspectsDataSet", _allProspects);
ReportViewer.LocalReport.DataSources.Add(reportDataSource);
ReportViewer.LocalReport.ReportEmbeddedResource = "SdcDatabase.Modules.EnquiryModule.View.Reports.ProspectsReport.rdlc";
ReportViewer.ZoomMode = ZoomMode.PageWidth;
ReportViewer.RefreshReport();
在RDLC文件本身的生成操作设置为嵌入的资源,并复制到输出目录设置为始终复制。
我有双重检查,我敢肯定,这是ReportEmbeddedResource字符串中的正确命名空间。然而,当我尝试加载的报告中,我得到这个错误:
我曾尝试在路径切换周围的几件事情,如更换“”与'/'和'\',但到目前为止我还没有能够得到任何解决这个问题。我也尝试使用LocalPath而不是EmbeddedResource,但我又遇到了错误。
我已经搜索了这个问题,但到目前为止还没有找到任何解决我的问题。
https://social.msdn.microsoft.com/Forums/zh-CN/7b259014-9bb2-424a-9c5b-37be2fcb1bef/how-to-use-reportembeddedresource-in-reportviewer-webform-control?forum=vsreportcontrols – mm8