SAP Crystal Reports for Visual Studio – PrintJobLimit Issue

There are default values on regedit that came with Crystal Reports setup,for example, the PrintJobLimit value is cr’s maximum document processing limit set by admin.

This value should be between 25 and 75 as standard.There are forums that talk about giving a value of -1 to give unlimited limit, but I do not recommend this because after a while you may face the situation of memory leak.The load function of Crystal Reports objects stores the RPT document in the temp folder every time it processes it,and deleting these files periodically from the temp folder will give you performance.

One of the most important issues when working with net-Crystal Reports is memory optimization.If you do not close/dispose every object you use and every database connection you open, you will be in trouble. Because these objects can occupy a lot of space on ram generously.

The solution to this problem is in this sample code:

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)
      var report = Activator.CreateInstance(reportClass);
      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);


Crystal Reports 10.0.x
HKEY_LOCAL_MACHINESOFTWARECrystal Decisions10.0Report Application Server InprocServerPrintJobLimit

Crystal Reports 10.2 (Visual Studio .NET 2005 bundle)
HKEY_LOCAL_MACHINESOFTWARECrystal Decisions10.2Report Application Server InprocServerPrintJobLimit

Crystal Reports Basic for Visual Studio 2008 (Visual Studio .NET 2008 bundle)
HKEY_LOCAL_MACHINESOFTWAREBusiness Objects10.5report Application serverInProcServer PrintJobLimitPrintJobLimit

Crystal Reports XI Release 1 (11.0.x)
HKEY_LOCAL_MACHINESOFTWAREBusiness ObjectsSuite 11.0Report Application ServerInprocServerPrintJobLimit

Crystal Reports XI Release 2 (11.5.x)
HKEY_LOCAL_MACHINESOFTWAREBusiness ObjectsSuite 11.5Report Application ServerInprocServerPrintJobLimit

Crystal Reports 2008 (12.x.x)
HKEY_LOCAL_MACHINESOFTWAREBusiness ObjectsSuite 12.0Report Application ServerInprocServerPrintJobLimit

Leave a reply:

Your email address will not be published.