ASP.NET : Maximum Report Limit Exceeded

Dear Experts,

Can anyone guide me on the error?

"Maximum report processing jobs limit configured has been reached"

I got the following code from the internet but I don't know where to use it. Please guide.

Imports System.Collections
Imports System.Collections.Generic
Imports System.Text
Imports CrystalDecisions
Imports CrystalDecisions.CrystalReports
Imports CrystalDecisions.CrystalReports.Engine

Namespace Test.Utilities
	Public Class ReportFactory
		Protected Shared reportQueue As New Queue()

		Protected Shared Function CreateReport(reportClass As Type) As ReportClass
			Dim report As Object = Activator.CreateInstance(reportClass)
			Return DirectCast(report, ReportClass)
		End Function

		Public Shared Function GetReport(reportClass As Type) As ReportClass

			'75 is my print job limit.
			If reportQueue.Count > 75 Then
				DirectCast(reportQueue.Dequeue(), ReportClass).Dispose()
			End If
			Return CreateReport(reportClass)
		End Function
	End Class
End Namespace

Open in new window

D Patel
D PatelD Patel, Software EngineerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dorababu MSenior Software EngineerCommented:
D PatelD Patel, Software EngineerAuthor Commented:
That understood...

But how do I write code so that it clears the cache at 75 job reaches.

Where should I write the above code and from when do I call it?
Dorababu MSenior Software EngineerCommented:
What I see is you need to do the following every time for crystal report

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

D PatelD Patel, Software EngineerAuthor Commented:
I have applied the same to all pages where crystal report viewer control lies at Page_Unload event.

But still the issue is not resolved.
Pravin AsarPrincipal Systems EngineerCommented:
Also look at the timeout setting for the request. May be request is reaching limit
D PatelD Patel, Software EngineerAuthor Commented:
Thanks for your support.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.