问题
I created an application that uses Microsoft.ReportViewer to show rdlc reports. The application is working fine on the dev. machine. now I am trying to deploy it on a client machine (windows 7) but when I generate the report nothing happens. Nothing at all. No error message and no exception. I am guessing this is due to missing Microsoft.ReportViewer.Winforms.dll/or framework?? I have set copyLocal=true for this dll but still no luck. what is the issue?
After putting message boxes at different places and catching exception I found out that ReportViewer needed to be installed on the client machine. These were the error messages that were showing up
回答1:
It turns out that I needed to install ReportViewer.exe on the client machines or needed to ship the dlls required with the installer. So I added the reference to the following dlls and marked CopyLocal=True and this solved my issue.
<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>
来源:https://stackoverflow.com/questions/32631604/unable-to-generate-rdlc-report-on-client-machine-after-deployment