带有Report Viewer的ASP.NET无法与IIS集成模式一起使用

时间:2019-02-27 10:44:27

标签: asp.net reportviewer reportviewerformvc

我正在使用带有报表查看器的ASP.NET来显示报表。在IIS上以经典模式配置网站时,它可以正常工作,并且可以查看报告,但是在以集成模式进行配置时,某些控件未显示在报告中。 我在web.config中使用以下处理程序:

<system.webServer>
    <handlers>
      <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
    </handlers>
  </system.webServer>

我试图直接调用失败控件的URL,但出现以下错误:

ObjectDisposedException]: Safe handle has been closed
   at System.Runtime.InteropServices.SafeHandle.DangerousAddRef(Boolean& success)
   at System.StubHelpers.StubHelpers.SafeHandleAddRef(SafeHandle pHandle, Boolean& success)
   at System.Security.Principal.Win32.ImpersonateLoggedOnUser(SafeAccessTokenHandle hToken)
   at System.Security.Principal.WindowsIdentity.SafeImpersonate(SafeAccessTokenHandle userToken, WindowsIdentity wi, StackCrawlMark& stackMark)
   at System.Security.Principal.WindowsIdentity.Impersonate()
   at Microsoft.Reporting.ServerImpersonationContext..ctor(WindowsIdentity userToImpersonate)
   at Microsoft.Reporting.WebForms.SoapReportExecutionService.ServerReportSoapProxy.GetWebResponse(WebRequest request)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.ReportExecutionService.RenderStream(String Format, String StreamID, String DeviceInfo, String& Encoding, String& MimeType)
   at Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.<>c__DisplayClass17.<RenderStream>b__16()
   at Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.ProxyMethodInvocation.Execute[TReturn](RSExecutionConnection connection, ProxyMethod`1 initialMethod, ProxyMethod`1 retryMethod)
[MissingEndpointException]: The attempt to connect to the report server failed.  Check your connection information and that the report server is a compatible version.
   at Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.ProxyMethodInvocation.Execute[TReturn](RSExecutionConnection connection, ProxyMethod`1 initialMethod, ProxyMethod`1 retryMethod)
   at Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.RenderStream(String Format, String StreamID, String DeviceInfo, String& Encoding, String& MimeType)
   at Microsoft.Reporting.WebForms.ServerReport.InternalRenderStream(String format, String streamId, String deviceInfo, String& mimeType, String& encoding)
   at Microsoft.Reporting.WebForms.ReportControlSession.GetStreamImage(String streamID, String deviceInfo, String& mimeType)
   at Microsoft.Reporting.WebForms.ReportImageOperation.GetStreamImage(String streamID, HttpResponse response, String iterationId)
   at Microsoft.Reporting.WebForms.ReportImageOperation.PerformOperation(NameValueCollection urlQuery, HttpResponse response)
   at Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

有人可以帮我解决这个问题吗?

0 个答案:

没有答案
相关问题