发布RDLC文件 [英] Publishing RDLC files

查看:264
本文介绍了发布RDLC文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的WPF应用程序的几个RDLC文件。当我发布项目,报告文件没有公布,当我尝试用客户端来访问他们,我得到一个错误,说他们没有找到。我检查发布文件夹,而事实上,他们不存在。我把下面的代码的RDLC文件:

I have a few RDLC files in my WPF application. When I publish the project, the report files don't get published, and when I try to access them with the client I get an error saying that they're not found. I've checked the publish folder, and indeed, they're not there. I call the RDLC files with the following code:

Microsoft.Reporting.WinForms.ReportViewer rvReportViewer;
/* ... */
rvReportViewer.LocalReport.ReportPath = string.Format("Reports/{0}.rdlc", ReportName);



我试过设置这些为资源,生成操作这就是我对我的静态图片文件,但似乎没有任何区别。

I've tried setting the Build Action on these to "Resource", which is what I have for my static image files, but that doesn't seem to make any difference.

为什么不报告被复制到发布目录?有没有办法来强制实现这一点,或者我应该在一些其他的方式来访问它们?

Why don't the reports get copied to the publish directory? Is there a way to force this to happen, or should I be accessing them in some other way?

谢谢!

推荐答案

我不知道是否有与RDLC文件特别关注的问题,但这里是为确保其他文件被公布的通用方法。

I don't know if there's special concerns with RDLC files, but here's the general approach for making sure other files get published.

右键单击Solution Explorer中的文件,选择属性。将生成操作到内容和复制到输出目录复制如果较新。

Right click the file in the solution explorer, select Properties. Set the "Build Action" to "Content", and "Copy to output Directory to "Copy if newer".

转到项目属性 - >发布页面。点击应用程序文件按钮,勾选显示所有文件,将发布状态,以包括(自动)

Go to the project properties->Publish page. Hit "Application Files Button", check "Show all files". Set the "Publish Status" to "Include (auto)"

文件属性

应用文件

这篇关于发布RDLC文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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