无法找到执行'iwy2vpzo52pmp555ftfn4455'(rsExecutionNotFound)

Mar*_*gol 5 reportingservices-2005 reporting-services

运行报告时,某些用户会收到以下错误.

•无法找到执行'iwy2vpzo52pmp555ftfn4455'(rsExecutionNotFound)

他们早上运行良好.有什么建议?

谢谢

Dom*_*icz 5

我可以搭把手.

问题是ReportViewer控件使用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();
}
Run Code Online (Sandbox Code Playgroud)

要么

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++;
}
Run Code Online (Sandbox Code Playgroud)