The techie in me RSS 2.0
 Friday, March 07, 2008

If you are working with Crystal Report and not handling the Report closing properly you must have faced this error.

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

The error message is self describing; well now the question is how to resolve this issue. The quick answer is making sure that you end the crystal job successfully, i.e. close the report once the user has closed the report. Yes, you have to do this manually.

 

I found multiple methods of doing this from groups, putting down the best methods I found in order.

 

1. Close the report while unloading the report viewer page.

VB.NET code below

Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload
    If Not objRpt Is Nothing Then
        objRpt.Close()
        objRpt.Dispose()
    End If
End Sub

This is the best method as far as I can think.

2. The lazy option – change registry key to accept more or infinite numbers

regedit - > navigate to

HKEY_LOCAL_MACHINE/SOftware/Crystal Decisions/Report Application Server/InprocServer/ReportDocument

Change the value of the field MaxNumOfRecords to -1(For Unlimited No. of records)

 

Your sys admin may sue you for changing this J

 

3. I like writing more code, give me an option – ok now for you, the option is create a factory class and when creating class check if the max has reached and clear the old ones. (Not a good idea isn’t it?)

public class ReportFactory
{
    protected static Queue rptQueue = new Queue();

    protected static ReportClass CreateReport(Type reportClass)
    {
        object report = Activator.CreateInstance(reportClass);
        rptQueue.Enqueue(report);
        return (ReportClass)report;
    }

    public static ReportClass GetReport(Type reportClass)
    {
        if (rptQueue.Count > MAX_COUNT) ((ReportClass)rptQueue.Dequeue()).Dispose();
        return CreateReport(reportClass);
    }
}

Choose your own method, as I mentioned my fav is the first one...

 

Good luck

Rujith

 

Related posts:
Friday, March 07, 2008 11:34:17 AM (GMT Standard Time, UTC+00:00)  #    Comments [3] -
Crystal Report
Thursday, March 13, 2008 10:32:48 AM (GMT Standard Time, UTC+00:00)
Very helpful post. I am with you, i'll close my eyes and select the first option.
Mark Robinson
Friday, May 09, 2008 5:35:39 PM (GMT Standard Time, UTC+00:00)
Hi Rujith,

Thanks for article onCrystal Report - Maximum report processing jobs limit issue. I am also using the first method and closing and disposing the connection but as a result when I try to use print and export feature in Crystal viewer, it gives me error- Object reference not set to an instance of an object.

I know becuase i am closing the database connection before i can use these features and export and print also need one more trip to database or session to implement. Can you guide me how to use the export and print feature while using close and dispose function. Can we do it after we use these features and how? Please guide and I need it.

THanks

Shailja
shailja
Friday, September 12, 2008 2:29:28 PM (GMT Standard Time, UTC+00:00)
Hi Rujith,

How to use third option?.

It will be great help.

Thanks
Vipul
Comments are closed.
About me
Name : Rujith Anand Send mail to the author(s)
Archive
<February 2012>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910
Blogs I read
Disclaimer

Disclaimer
Postings are provided as is with no warranties, and confer no rights. Opinions expressed here are my own delusions; my employers at best shake their heads and sigh, at worst repudiate the content with extreme prejudice, whenever it manages to appear on their radar.

© Copyright 2012
Rujith Anand

Statistics
Advertisement
All Content © 2012, Rujith Anand