如何用水晶报告加载最大记录?

时间:2014-03-01 13:34:54

标签: crystal-reports asp.net-3.5

我正在处理水晶报告。有了水晶报告,我做了几个没有。记录历史。现在只想加载1139条记录进行显示,我收到如上所述的错误:

Server Error in '/EasyWeb' Application.
The maximum report processing jobs limit configured by your system administrator has been reached.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: The maximum report processing jobs limit configured by your system administrator has been reached.

Source Error:


Line 807:                    dt.Rows.Add(dr);
Line 808:                    ReportDocument reportdocument = new ReportDocument();
Line 809:                    reportdocument.Load(Server.MapPath(@"~/Admin/UserReport.rpt"));
Line 810:                    reportdocument.SetDataSource(myDataSet);
Line 811:                    reportdocument.SetDatabaseLogon("user", "user123");


Source File: f:\EasyWeb\Admin\User_Management.aspx.cs    Line: 809

Stack Trace:


[COMException (0x80041016): The maximum report processing jobs limit configured by your system administrator has been reached.]
   CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0
   CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +144
   CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +526

[CrystalReportsException: Load report failed.]
   CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +621
   CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) +1969
   CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename) +186
   Admin_User_Management.lbut_print_Click(Object sender, EventArgs e) in f:\EasyWeb\Admin\User_Management.aspx.cs:809
   System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) +111
   System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +79
   System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565


Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053 

-------------------------------------更新------ -----------------------------------------

   reportdocument.Load(Server.MapPath(@"~/Admin/PostHistoryReport.rpt"));
            reportdocument.SetDataSource(myDataSet);
            reportdocument.SetDatabaseLogon("user", "user123");
            CrystalReportViewer1.ReportSource = reportdocument;
            reportdocument.Clone();
            reportdocument.Dispose();
            GC.Collect();

但它在加载时给我错误我包括它的摘要屏幕截图。

enter image description here

2 个答案:

答案 0 :(得分:0)

我们最近遇到了类似的问题,它与您的报告尝试检索的记录数无关,而是与您使用Crystal Reports运行时打开和访问报告的次数无关,特别是创建并且使用ReportDocument变量,而不关闭和处理它。

看看这篇相关文章:
Crystal Reports Exception: The maximum report processing jobs limit configured by your system administrator has been reached

实际上,我们的解决方案是以下模式:

ReportDocument report = CreateReportDocument(reportPath);

// Do stuff with the report

report.Close();
report.Dispose();
GC.Collect();

这解决了我们在获得相同的异常之前能够生成少量报告的问题。我希望这有帮助!

答案 1 :(得分:0)

首先在cmd提示符下发出ISSRESET命令以清除日志,并将以下代码放在报表查看器的Unload事件中。

这是一个例子

Protected Sub CrystalReportViewer1_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Unload
        master1.Close()
        master1.Dispose()
        GC.Collect()
    End Sub

下的