处理“非法路径”时C#报告错误 [英] C# Reporting Error in Processing 'Illegal Path'

查看:69
本文介绍了处理“非法路径”时C#报告错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用C#进行报告。我正在尝试嵌入我的rdlc文件:

I am trying to get reporting in C# to work. I'm trying to embed my rdlc file as such:

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字符串中的正确命名空间。但是当我尝试加载报告时出现此错误:

The build action on the rdlc file itself is set to embedded resource and the copy to output directory set to copy always.

I have double checked and I'm certain that that is the correct namespace in the ReportEmbeddedResource string. However when I try to load the report I get this error:

我尝试在路径中切换一些东西,例如用'/'和'\'替换'。'但是到目前为止,我还没有得到任何解决方法。我也尝试过使用LocalPath而不是EmbeddedResource但是我又遇到了错误。



我已经搜索过这个问题但是到目前为止还没有找到解决我问题的方法。

I have tried switching a few things around in the path, such as replacing '.' with '/' and '\' but so far I have not been able to get anything to fix this. I have also tried using LocalPath instead of EmbeddedResource but again I come across errors.

I have searched for this issue but haven't found anything to resolve my issue thus far.

推荐答案

您好DRD94,

Hi DRD94,

谢谢在这里发帖。

根据你的问题与Winform有关,我将把它移到
Windows Forms General
论坛以获得合适的支持。

According to your question is more related to Winform, I will move it to Windows Forms General forum for suitable support.

Visual C#讨论并询问C#编程语言,IDE ,库,样本和工具。

The Visual C# discuss and ask the C# programming language, IDE, libraries, samples and tools.

如果您有一些语法或代码错误,请随时与我们联系。我们将尽力为您提供解决方案。

If you have some grammar or code errors, please feel free to contact us. We will try our best to give you a solution.

感谢您的理解与合作。

最诚挚的问候,

Wendy


这篇关于处理“非法路径”时C#报告错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆