当我尝试将报表导出到ReportViewer中的Excel超过110秒时,我遇到了运行时错误。
这个问题的唯一解决方案是我在这里和许多其他网站上找到的,它是在root web.config文件中的httpRuntime下设置executionTimeout。
现在虽然这确实有效,但它并不适合项目,如果只有ReportViewer的运行时超时时间更长,那将更为可取。
我的问题是,有没有办法只为ReportViewer设置executionTimeout?
我尝试过但仍然暂停的事情
将executionTimeout应用于根web.config
中ReportViewer所在的区域<location path="Areas/Reporting">
<system.web>
<httpRuntime executionTimeout="600" maxRequestLength="2097151"/>
</system.web>
</location>
在ReportViewer背后的代码中设置以下超时
Server.ScriptTimeout = 600;
ScriptManager.GetCurrent(this).AsyncPostBackTimeout = 600;
if (!IsPostBack)
{
reportViewer.ServerReport.Timeout = reportViewerServerReportTimeoutMilliseconds;