【发布时间】:2013-06-05 15:53:00
【问题描述】:
我的应用程序正在使用 ReportViewer WebControl。我没有使用 SSRS - 只是将 ReportViewer 绑定到 sql 数据源。
当我运行一个非常大的报表时,该报表将在浏览器中呈现得很好,但是当我单击工具栏控件以导出为 PDF 或 XLS 时,大约 2 分钟后我得到一个 Request timed out 错误页面:
Server Error in '/' Application.
Request timed out.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Request timed out.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): Request timed out.]
我已经对此进行了一段时间的调查,我发现最好的资源是以下 2 页。
Reporting Services Report Timeout
第一个链接很有趣,但没有给出实际答案,而且我在查询字符串中没有看到 Timeout 参数(见下文)。
第二个也无济于事。首先,我没有使用报告服务器,因此无法按照它描述的方式为单个报告设置超时。其次,我宁愿不增加整个应用程序的超时时间——毕竟它的存在是有原因的。我宁愿只为Reserved.ReportViewerWebControl.axd 增加它,因为这是导致错误的路径 - 当您将报告导出为 pdf 等时,它会打开指向Reserved.ReportViewerWebControl.axd 的直接链接。就我而言,这是:
Reserved.ReportViewerWebControl.axd?Culture=2057&CultureOverrides=True&UICulture=2057&UICultureOverrides=True&ReportStack=1&ControlID=cf991107384446f8859b148bc815745b&Mode=true&OpType=Export&FileName=InvoicesReport&ContentDisposition=OnlyHtmlInline&Format=PDF
所以我决定在 web.config 中更改这个特定处理程序的 executionTimeout:
<location path="Reserved.ReportViewerWebControl.axd"> <system.web> <!-- Set execution timeout to 10 minutes, default is 110 seconds --> <httpRuntime executionTimeout="600"/> </system.web> </location>
但这给了我“位置元素未使用。在 Reserved.ReportViewerWebControl.axd 找不到项目项。路径 C:\...Reserved.ReportViewerWebControl.axd 不支持”。
这是有道理的,因为 Reserved.ReportViewerWebControl.axd 实际上并不作为文件存在。
我该如何进行这项工作?
编辑
我正在使用 v11 的 ReportViewer:
<httpHandlers>
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"
validate="false" />
</httpHandlers>
【问题讨论】:
标签: c# asp.net reportviewer