一些用户在运行报告时收到以下错误。
• 找不到执行 'iwy2vpzo52pmp555ftfn4455' (rsExecutionNotFound)
他们早上跑得很好。
有什么建议?
谢谢
最佳答案
我可以搭 Handlebars 。
问题在于 ReportViewer 控件使用 Session 来存储当前正在执行的报表。一旦您离开报告,该项目仍然保留并最终失去其“执行上下文”,这是 Report Server 缓存报告的方式。
因此,在浏览报表之前,应该尝试清除这些报表的Session,这样Session中就没有缓存的报表,ReportViewer控件才能正常工作。
你还会发现,有时在访问Session.Keys.Count的时候,会出现这个错误,同样是执行上下文失败了。
确保在显示报告的页面上执行此操作!!
2个选项是:
if (!IsPostBack)
{
HttpContext.Current.Session.Clear();
ReportViewer1.ServerReport.ReportServerUrl = new Uri(ReportServerUrl, System.UriKind.Absolute);
ReportViewer1.ServerReport.ReportPath = ReportPath;
System.Collections.Generic.List<ReportParameter> parameters = new System.Collections.Generic.List<ReportParameter>();
....
ReportViewer1.ServerReport.SetParameters(parameters);
ReportViewer1.ServerReport.Refresh();
}
或者
for (int i = 0; i < HttpContext.Current.Session.Keys.Count; )
{
if (HttpContext.Current.Session[i].ToString() == "Microsoft.Reporting.WebForms.ReportHierarchy")
HttpContext.Current.Session.RemoveAt(i);
else
i++;
}
关于reporting-services - 找不到执行 'iwy2vpzo52pmp555ftfn4455' (rsExecutionNotFound),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2050593/