关于发布版软件无法加载ReportViewer问题

标签: ReportViewer, Issue

博客分类: 常见问题及解决方法

场景:做RDLC报表开发,开发机可以使用,用户机子上却无法打开

原因:由于做开发的,个人机子上环境比较完整,在做RDLC报表开发时,visual studio 在处理部分dll时,并未将dll复制到本地,即客户机缺少dll,故我们需要手动将其改为复制到本地。

解决方案:

状况1、ReportViewer控件直接无法创建初始化,缺少Microsoft.ReportViewer.Common程序集dll,一般情况,在处理rdlc时,此程序集已经自动引用,只需修改属性“复制到本地”为true;若没有找到,可自行引用,路径如下:

C:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.Common\12.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.Common.dll

其中12.0.0.0__89845dcd8080cc91为版本,尽量和Microsoft.ReportViewer.WinForms版本保持一致。

 

状况2、ReportViewer能够加载,内部rdlc加载错误,提示缺少Microsoft.ReportViewer.ProcessingObjectModel的引用,处理方法同上,dll路径如下:

C:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.ProcessingObjectModel\12.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.ProcessingObjectModel.DLL

没有评论