【问题标题】:How to load maximum record with crystal report?如何使用水晶报表加载最大记录?
【发布时间】:2014-11-11 05:51:02
【问题描述】:

我正在使用水晶报表。使用水晶报告,我已经完成了一些没有。的历史记录。现在只想加载 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();

但它在加载时给了我错误,我将它的屏幕截图包含在摘要中。

【问题讨论】:

  • 您在哪里看到此错误?在 CR 中或通过在 BO CMC 等服务器中上传 CR

标签: crystal-reports asp.net-3.5


【解决方案1】:

我们最近遇到了类似的问题,它与您的报表尝试检索的记录数量无关,而是您使用 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();

这解决了我们在遇到与您相同的异常之前能够生成少量报告的问题。我希望这会有所帮助!

【讨论】:

  • 是的,我使用了你的技术,但它在运行时不起作用。查看我更新的问题。
  • 您链接的哪篇文章对我有同样的问题。找不到对象引用....
  • 对不起,“找不到对象引用”从何而来?我不明白这与您遇到的问题有何关联...?
  • 我现在看到了,在图片中。对于初学者,您的代码是“reportdocument.Clone();”应该是“reportdocument.Close();”......但我认为你不能在屏幕上的查看器使用对象时处理它,我的问题是在 WPF 应用程序中,而不是在 Web 应用程序中,所以我对不起,我在陌生的地方...
【解决方案2】:

首先在 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

【讨论】:

    猜你喜欢
    • 2015-09-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多