Search
Close this search box.

Maximum report processing jobs limit issue in Crystal Report

This is a very common error in Crystal Report when its give this following message.
The maximum report processing jobs limit configured by your system administrator has been reached.”
I have been read about its on lot forums and new groups. Its actually means that Crystal Report print job limit has been reached and you should handle this problem by increasing the job limit in the registry. The basic reason of this problem is Garbag Collector (GC) cannot clear the reference of report document in their collection process its only clear report viewer.
HKEY_LOCAL_MACHINE\SOFTWARE\CRYSTAL DECISIONS\10.0\REPORT APPLICATION SERVER\SERVER\PrintJobLimit
Yesterday we also facing this problem in our application and after lot of discussion in the team we find out a good solution of this problem in the form following factory class because we not facing this problem in whole application.

using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using CrystalDecisions;
using CrystalDecisions.CrystalReports;
using CrystalDecisions.CrystalReports.Engine;

namespace Test.Utilities {
  public class ReportFactory {
    protected static Queue reportQueue = new Queue();

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

    public static ReportClass GetReport(Type reportClass) {
      // 75 is my print job limit.
      if (reportQueue.Count > 75)
        ((ReportClass)reportQueue.Dequeue()).Dispose();
      return CreateReport(reportClass);
    }
  }
}

You can use this ReportFactory class for creating ReportClass object and don’t need to call explicitly dispose method on the page because ReportFactory class will automatically dispose it when count reach to 75.

posted on Tuesday, July 17, 2007 6:42 PM

This article is part of the GWB Archives. Original Author: Saqib Ullah

Related Posts