Crystal Reports Exception: The maximum report proc

2020-01-31 07:15发布

I'm facing a very buggy issue, in ASP.NET application after viewing the same report many times simultaneously I got this exception:

The maximum report processing jobs limit configured by your system administrator has been reached.

Wait I know there are tons of solutions out there but all of them are not working with me.

  1. I put ReportDocument.Close(); ReportDocument.Dispose(); in CrystalReportViewer_Unload event, and still throw the exception.

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

  2. I edit the PrintJobLimit registry in HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Report Application Server\InprocServer and HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Report Application Server\Server to -1 even to 9999, and still throw the exception.

Here is the code snippet where I call my report:

 Table_Infos = New TableLogOnInfos()
                Table_Info = New TableLogOnInfo()
                Con_Info = New ConnectionInfo()

                With Con_Info
                    .ServerName = ConfigurationManager.AppSettings("server_name")
                    .DatabaseName = ConfigurationManager.AppSettings("DB")
                    .UserID = user_name
                    .Password = pass_word
                    .Type = ConnectionInfoType.SQL
                    .IntegratedSecurity = False
                End With

                Table_Info.ConnectionInfo = Con_Info

                If Session("recpt_lang") = "Arabic" Then
                    reportFile.Load(Server.MapPath("/Reports/") & "collectrecpt_new_ar.rpt")
                ElseIf Session("recpt_lang") = "English" Then
                    reportFile.Load(Server.MapPath("/Reports/") & "collectrecpt_new.rpt")
                End If

                For Each mytable In reportFile.Database.Tables

                    mytable.ApplyLogOnInfo(Table_Info)

                Next

                CrystalReportViewer1.ReportSource = reportFile
                CrystalReportViewer1.SelectionFormula = Session("SelectionForumla")
                CrystalReportViewer1 = Nothing

11条回答
SAY GOODBYE
2楼-- · 2020-01-31 07:39

I know this thread is older, but if you configure the app pool setting "Recycling..." to recycle at, say, 180 minutes instead of 1740 minutes (the default), this might free up the needed resources.

查看更多
趁早两清
3楼-- · 2020-01-31 07:43

You have to Dispose your report instance after all. If you Dispose the report after showing it, you will never see the error "The maximum report processing jobs limit configured by your system administrator has been reached" again.

  Dim report1 As rptBill = clsBill.GetReport(billNumber)

  rpt.Print()

  'Cleanup the report after that!
  rpt.Close()
  rpt.Dispose()
查看更多
\"骚年 ilove
4楼-- · 2020-01-31 07:43

Crystal Report document implements IDisposable interface. So all you have to do is to enclose the report's instance with using statement. It will be automatically closed and disposed once the using statement is completed. You can write something like that:

using(var report = GetInvoiceReport())
{
     // your logic here
}

or (depends on your context):

using(var report = new ReportDocument())
{
     // your logic here
}
查看更多
啃猪蹄的小仙女
5楼-- · 2020-01-31 07:43

I was working on local report server. I have hosted my web application in other pc. When I got such error I just did IISRESET and working fine now.

Try this, this could help you.

查看更多
你好瞎i
6楼-- · 2020-01-31 07:44

Make sure you are using PUSH model to display your reports. Next you have to make one change in your Server's registry: Follow the path:

"HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Report Application Server\InprocServer" 

and you will see an item " PrintJobLimit" and you will see that its default value is 75. that means the server can only handle 75 reports at a time. Dont worry about that and just modify the value to -1

查看更多
做个烂人
7楼-- · 2020-01-31 07:47

I would recommend moving your close/dispose/gc.collect code outside of that unload process. In other words:

  1. Load report
  2. Assign to Viewer Control
  3. Show Report in Viewer Control
  4. Close Viewer Control and Unload (completely)
  5. Then close/dispose/gc.collect outside of any viewer control code

My guess is the viewer control is not completely closed when the report is being cleaned up.

Crystal is a very memory intensive process and very finicky.

查看更多
登录 后发表回答