2012-05-09 76 views
0

我想在SharePoint內顯示報告。我的ASPX頁面包含一個Microsoft.ReportViewer.WebForms.ReportViewer控件。當我試圖打開這個網頁,我得到錯誤:報告查看器配置錯誤

Report Viewer Configuration Error

The Report Viewer Web Control HTTP Handler has not been registered in the application's web.config file. Add <add verb="*" path="Reserved.ReportViewerWebControl.axd" type = "Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> to the system.web/httpHandlers section of the web.config file, or add <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> to the system.webServer/handlers section for Internet Information Services 7 or later.

The attempt to connect to the report server failed. Check your connection information and that the report server is a compatible version.

Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'. The request failed with the error message: -- 401 UNAUTHORIZED<RSError xmlns="http://www.microsoft.com/sql/reportingservices"><MoreInformation><Message>Unbekannter Fehler beim Reporting Services-Endpunkt für diese SharePoint-Website. Wenden Sie sich an den Administrator der SharePoint-Website.</Message></MoreInformation></RSError> --.

我是否確實需要這部分增加的web.config?我應該在哪裏添加這個?

回答

4

嘗試添加以下章節中,

<add verb="*" path="Reserved.ReportViewerWebControl.axd" type = "Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 

system.webhandlers

並添加以下各節

<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 

到​​第handlers

甲通常錯誤消息解釋了一切!希望能幫助到你。

1

這完整的web.config後,我解決了這個問題:

<?xml version="1.0" encoding="utf-8"?> 
 
<!-- 
 
    For more information on how to configure your ASP.NET application, please visit 
 
    http://go.microsoft.com/fwlink/?LinkId=169433 
 
    --> 
 
<configuration> 
 
<system.web> 
 
    <httpHandlers> 
 
     <add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /> 
 
    </httpHandlers> 
 
    </system.web> 
 
    <system.webServer> 
 
    <validation validateIntegratedModeConfiguration="false" /> 
 
    <defaultDocument> 
 
     <files> 
 
     <add value="PreviewReport.aspx" /> 
 
     </files> 
 
    </defaultDocument> 
 
    <handlers> 
 
     <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /> 
 
    </handlers> 
 
    </system.webServer> 
 
</configuration>

1

感謝。 我使用共享主機的godaddy,這個解決方案很適合我的應用。

<system.webServer> 
<validation validateIntegratedModeConfiguration="false" /> 
<handlers> 

    <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 

</handlers> 
</system.webServer>