Rdlc 報表在 asp.net web application 中部署

下載ReportViewer.exe 和 ReportViewerLP.exe 文件在服務器上執行

當然也可以在dos下

copy C:\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.Common\9.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.Common.dll d:\

copy C:\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.Common.resources\9.0.0.0_zh-CHT_b03f5f7f11d50a3a\Microsoft.ReportViewer.Common.resources.dll d:\

copy C:\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.Design\9.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.Design.dll d:\

copy C:\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.Design.resources\9.0.0.0_zh-CHT_b03f5f7f11d50a3a\Microsoft.ReportViewer.Design.resources.dll d:\

copy C:\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.ProcessingObjectModel\9.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.ProcessingObjectModel.dll d:\

copy C:\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.WebDesign\9.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.WebDesign.dll d:\

copy C:\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.WebDesign.resources\9.0.0.0_zh-CHT_b03f5f7f11d50a3a\Microsoft.ReportViewer.WebDesign.resources.dll d:\

copy C:\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\9.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.WebForms.dll d:\

copy C:\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms.resources\9.0.0.0_zh-CHT_b03f5f7f11d50a3a\Microsoft.ReportViewer.WebForms.resources.dll d:\

copy C:\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.WinForms\9.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.WinForms.dll d:\

copy C:\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.WinForms.resources\9.0.0.0_zh-CHT_b03f5f7f11d50a3a\Microsoft.ReportViewer.WinForms.resources.dll d:\

注:上面的 .resources文件為繁體中文,簡體中文為CHS

拷貝以上文件

我們拷貝了那麼多dll,其實在asp.net 中隻需要

Microsoft.ReportViewer.Common.dll

Microsoft.ReportViewer.ProcessingObjectModel.dll

Microsoft.ReportViewer.WebForms.dll

和語言包

Microsoft.ReportViewer.WebForms.resources.dll

做完以上的事情,如果是在web site專案中部署,就已經全部OK,可以運行了,

但如果是在web Appliction專案中部署,就會出現找不到對應的.rdlc報表文件

因為web Appliction專案發行時,.rdlc文件是做為 “內嵌資源”發行的,發行之後就根本就找不到這些以.rdlc結尾的報表文件。

解決方法

選擇.rdlc報表文件,屬性->建置動作:在下拉框中選: 內容。

重新發信web application ,一切OK,搞定。

附上vs2010的報表dll復制方法

同樣是在dos下執行

copy C:\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.Common\10.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.Common.dll d:\

copy C:\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.Common.resources\10.0.0.0_zh-Hant_b03f5f7f11d50a3a\Microsoft.ReportViewer.Common.resources.dll d:\

copy C:\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.ProcessingObjectModel\10.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.ProcessingObjectModel.dll d:\

copy C:\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\10.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.WebForms.dll d:\

copy C:\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms.resources\10.0.0.0_zh-Hant_b03f5f7f11d50a3a\Microsoft.ReportViewer.WebForms.resources.dll d:\

copy C:\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.WinForms\10.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.WinForms.dll d:\

copy C:\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.WinForms.resources\10.0.0.0_zh-Hant_b03f5f7f11d50a3a\Microsoft.ReportViewer.WinForms.resources.dll d:\