1

我已经制作了一个 SSRS 报告,当我运行报告时显示了所有所需的数据,但是当我尝试在浏览器上查看时

http://localhost/Reporting/SSRSTestReport

它给了我一个错误

HTTP 错误 404.0 - 未找到 您要查找的资源已被删除、名称已更改或暂时不可用。

当我试图在aspx页面中显示它时,它给了我一个这样的错误:

The attempt to connect to the report server failed. Check your connection information   and that the report server is a compatible version.
The request failed with HTTP status 404: Not Found.

现在我在aspx.cs页面中这样做:

 try
    {
        IReportServerCredentials irsc = new CustomReportCredentials("sa", "arindam", "ITPL_PC1");
        ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
        ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://localhost/Reporting/SSRSTestReport");
        ReportViewer1.ServerReport.ReportServerCredentials = irsc;
        ReportViewer1.ServerReport.ReportPath = "D:\\SSRSTest\\SSRSTest\\SSRSTest\\SSRSTestReport";
        ReportViewer1.ServerReport.Refresh();

    }
    catch (Exception ex)
    {
        Response.Write(ex.ToString());
    } 

CustomReportCredentials我从这里获取的:Passing Credentials to Sql Report Server 2008

这是我http handler的 web.config

<httpHandlers>
        <remove path="*.asmx" verb="*"/>
        <add path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
        <add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
        <add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
        <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
    </httpHandlers>

请帮我解决这个问题,我知道我遗漏了一些东西但找不到

4

1 回答 1

0

您需要将您的设置放在该system.webServer部分

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

请参阅:如何:注册 HTTP 处理程序

于 2013-07-05T07:35:59.690 回答