部署后无法在客户端计算机上生成RDLC报告

时间:2015-09-17 13:30:41

标签: c# wpf reportviewer rdlc reportviewer2008

我创建了一个使用Microsoft.ReportViewer显示rdlc报告的应用程序。该应用程序在开发时工作正常。机。现在我试图在客户机上部署它(Windows 7),但是当我生成报告时没有任何反应。什么都没有。没有错误消息,也没有异常。我猜这是由于缺少Microsoft.ReportViewer.Winforms.dll /或框架?我为此dll设置了copyLocal = true但仍然没有运气。问题是什么?

将消息框放在不同的位置并捕获异常后,我发现需要在客户端计算机上安装ReportViewer。这些是出现的错误消息

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:1)

事实证明,我需要在客户端计算机上安装ReportViewer.exe,或者需要运送安装程序所需的dll。所以我添加了对以下dll的引用并标记了CopyLocal = True,这解决了我的问题。

<Reference Include="Microsoft.ReportViewer.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>C:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.Common\11.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.Common.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="Microsoft.ReportViewer.ProcessingObjectModel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>C:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.ProcessingObjectModel\11.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.ProcessingObjectModel.DLL</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="Microsoft.ReportViewer.WinForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
  <HintPath>C:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WinForms\11.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.WinForms.DLL</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="Microsoft.SqlServer.Types, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.Types\11.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Types.dll</HintPath>
  <Private>True</Private>
</Reference>