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.
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
I edit the PrintJobLimit registry in
HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Report Application Server\InprocServer
andHKEY_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
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.
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.
Crystal Report document implements
IDisposable
interface. So all you have to do is to enclose the report's instance withusing
statement. It will be automatically closed and disposed once theusing
statement is completed. You can write something like that:or (depends on your context):
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.
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:
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
I would recommend moving your close/dispose/gc.collect code outside of that unload process. In other words:
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.