[英]Delay in loading multiple reports using report viewer in asp.net
I am facing dramatic delay when loading SSRS reports in reportviewer dynamically in multiple popups. 在多个弹出窗口中动态加载ReportViewer中的SSRS报告时,我面临着巨大的延迟。 Once the first report is completely loaded, then only then next report starts processing even if I open the reports in parallel. 第一个报告完全加载后,即使我并行打开报告,也只有下一个报告才开始处理。 So I have to wait for long time to load small report if long running report is opened before it. 因此,如果在打开长时间运行的报告之前,我必须等待很长时间才能加载小报告。 Its not loading in parallel. 它不是并行加载。 I have done some research on this and got to know from the below link that ReportViewer blocks the session for loading each report. 我对此进行了一些研究,并从下面的链接中了解到ReportViewer阻止了加载每个报告的会话。
http://www.networksteve.com/enterprise/topic.php/Multiple_report_viewers_on_one_page_issue/?TopicId=56213&Posts=5 http://www.networksteve.com/enterprise/topic.php/Multiple_report_viewers_on_one_page_issue/?TopicId=56213&Posts=5
Can anyone help me on this. 谁可以帮我这个事。 Is there any solution available for this? 有什么解决方案吗?
I am using Microsoft.ReportViewer.WebForms Version=11.0.0.0, and Framework 4.5 with VS 2012. ReportViewer is in server mode. 我在VS 2012中使用Microsoft.ReportViewer.WebForms版本= 11.0.0.0和Framework 4.5。ReportViewer处于服务器模式。 Please see the code below 请看下面的代码
reportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
reportViewer.ServerReport.ReportServerUrl = new Uri(ReportServer);
reportViewer.ServerReport.ReportPath = ReportPath.Trim();
reportViewer.SizeToReportContent = true;
reportViewer.ServerReport.Refresh();
Maybe breaking up the processing into multiple threads could be the answer. 也许将处理分成多个线程可能是答案。 Create a list of the reports you'll have to get, then use the Parallel
class like so... 创建必须获取的报告列表,然后像这样使用Parallel
类...
Parallel.ForEach(reports => report
{
// code for rendering your report
});
Likewise, you can also create an Action
delegate for each report and simplify this down to... 同样,您也可以为每个报告创建一个Action
委托,并将其简化为...
Parallel.ForEach(reports => report.Invoke());
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.