ReportViewer遇到Win Server 2008 x64 + IIS 7 出現 ReportViewer 是null或不是一個物件
C#VS2005使用ReportViewer元件
當環境在Win Server 2008 x64 + IIS 7 時
IE右下角會出現一個 ! 驚嘆號的 ReportViewer 是null或不是一個物件 的 錯誤訊息!
Resolution:
<一>可以在IIS上設定
Open Internet Information Services (IIS) Manager and select your Web application.
Under IIS area, double-click on Handler Mappings icon.
At the Action pane on your right, click on Add Managed Handler.
At the Add Managed Handler dialog, enter the following:
Request path: Reserved.ReportViewerWebControl.axd
Type: Microsoft.Reporting.WebForms.HttpHandler
Name: Reserved-ReportViewerWebControl-axd
Click OK.
<二>在webconfig上加
<system.webServer>
<handlers>
<add name=": Reserved-ReportViewerWebControl-axd" path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler" resourceType="Unspecified" preCondition="integratedMode" />
</handlers>
</system.webServer>
以上解法就OK啦~