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

时间:2010-01-12 16:43:46

标签: reporting-services reportingservices-2005

某些用户在运行报告时会出现以下错误。

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

他们早上跑得很好。 有什么建议吗?

谢谢

6 个答案:

答案 0 :(得分:5)

我可以帮忙。

问题是ReportViewer控件使用Session来存储当前正在执行的报告。离开报告后,该项目仍然存在并最终丢失其“执行上下文”,这是报表服务器缓存报表的方式。

因此,在浏览报表之前,您应该尝试清除这些报表的会话,以便会话中没有缓存的报表,并且ReportViewer控件可以正常工作。

您还会发现,有时在访问Session.Keys.Count时,可能会发生此错误,执行上下文也会失败。

请确保在显示报告的页面上执行此操作!!

两个选项是:

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++;
}

答案 1 :(得分:3)

我正在使用SSRS 2017,并且在尝试使用URL Access将报告加载到我的MVC项目时遇到了此问题。我的问题与会话有关。

要自行检查,您可以尝试删除RSExecutionSession Cookie并重新加载报告。不幸的是,这只是暂时的解决方法。

如果确实有效,请尝试将rs:ClearSession=true添加到查询字符串中 您可以阅读此设置here

答案 2 :(得分:2)

在报告路径中查找尾随空格。这是我的原因。

答案 3 :(得分:0)

web.config的模拟中,使用身份

impersonate="true" 
userName="xxxxx" 
password="xxxxx"  

代替:!--<identity impersonate="true"

希望有所帮助

答案 4 :(得分:0)

此错误导致我的应用程序显示运行时错误。

我将此添加到Global.asax类以解决错误。尝试过Server.Clear但什么也没得到。 Session.Clear完全摆脱了错误。

Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
    If ex.InnerException IsNot Nothing Then
            If ex.InnerException.ToString.Contains("The report execution") AndAlso
               ex.InnerException.ToString.Contains("rsExecutionNotFound") Then
                Session.Clear()
                Return
            End If
        End If
End Sub

虽然它可能不是100%适用于上述问题,但我未能找到任何其他解决方案。

答案 5 :(得分:0)

如果您运行的是SQL Server Express版本,则SQL Server代理程序不会运行以清理旧的SSRS会话。您需要在SSRS DB上运行作业以清理旧会话。

我的报告需要10秒才能运行,2秒需要导出 - 所以这与会话到期时间长短无关。

导出报告一小时后,将报告导出到我的应用程序时出现错误。