天下無雙
阿龍 --质量是流程决定的。

水晶报表最大进程数限制问题

Solutions
A solution to the print jobs processing limit vary depending on the cause. On occasion, more than one
possible solution may apply, or a combination of solutions will need to be implemented.
Code
Dispose un-needed objects
Ensure that you call .Dispose and .Close method when the report object is no longer need. Also, ensure that
this is done not only with Crystal Reports, but FileStream, Database Connections, datasets or any other
object that supports IDisposable interface.
Use sessions
      1. Create a sub that sets the viewer’s ReportSource property, displays a report in the viewer and
          add the following line of code.
       [VB.NET]
       Session.Add (“REPORT_KEY”, report)
       [C#]
       Session.Add (“REPORT_KEY”, report);
      2. In the Page_Load event, add the following lines of code. These lines of code will grab the report
          object from the Session object and set the viewer’s ReportSource property during a postback.
       [VB.NET]
       If IsPostBack Then
       report = CType(Session.Item(“REPORT_KEY”), Group)
          CrystalReportViewer1.ReportSource = report
       End If
       [C#]
       if (IsPostBack) {
          report = (Group)Session[“REPORT_KEY”]
          CrystalReportViewer1.ReportSource = report;
       }
Running the project now, and navigating the pages in the report will display each page in the viewer without
losing the report source thus keeping the stack and memory clear and delay the -75 limit error. However, you
still need to close and dispose of the report object eventually. This should be done on either close of the
viewer browser window, or if the user navigates to another page.

Increase the 75 Print Job Limit
This may stop the error from occurring temporarily but as load increases, you will find the error will start to
occur again or worse yet, the system may stop responding and a system reboot will be the only way to
recover. For an application using the Crystal reports SDK, the registry key “InprocServer” sets the limit for
the number of print jobs allowed to be processed by the report engine.
CAUTION: The following resolution involves editing the registry. Using the Registry Editor incorrectly can cause serious
      problems that may require you to reinstall the Microsoft Windows operating system. Use the Registry Editor at your
      own risk. It is strongly recommended that you make a backup copy of the registry files before you edit the registry.
      For information on how to edit the registry key, view the 'Changing Keys And Values' online Help topic in the
      Registry Editor (Regedit.exe).
Note: The default value of 75 is the predetermined value for best performance in tested environments. Changing this
      value may affect performance of the system.
To change the PrintJobLimit value, follow these steps:
    1) Click Start > Run. The Run dialog box appears.
    2) Type “regedit” in the Open field. Click OK. The Registry Editor appears.
Navigate to the appropriate registry key value as documented below.
Crystal Reports 10.0.x
HKEY_LOCAL_MACHINE"SOFTWARE"Crystal Decisions"10.0"Report Application Server"
InprocServer"PrintJobLimit
Crystal Reports 10.2 (Visual Studio .NET 2005 bundle)
HKEY_LOCAL_MACHINE"SOFTWARE"Crystal Decisions"10.2"Report Application Server"
InprocServer"PrintJobLimit
Crystal Reports Basic for Visual Studio 2008 (Visual Studio .NET 2008 bundle)
HKEY_LOCAL_MACHINE"SOFTWARE"Business Objects"10.5"report Application server"InProcServer"
PrintJobLimit"PrintJobLimit
Crystal Reports XI Release 1 (11.0.x)
HKEY_LOCAL_MACHINE"SOFTWARE"Business Objects"Suite 11.0"Report Application
Server"InprocServer"PrintJobLimit
Crystal Reports XI Release 2 (11.5.x)
HKEY_LOCAL_MACHINE"SOFTWARE"Business Objects"Suite 11.5"Report Application
Server"InprocServer"PrintJobLimit
Crystal Reports 2008 (12.x.x)
HKEY_LOCAL_MACHINE"SOFTWARE"Business Objects"Suite 12.0"Report Application
Server"InprocServer"PrintJobLimit
Setting the PrintJobLimit value to -1 removes all print job limits.

Hardware
Servers with more memory, dual or even quad CPUs are an option. Web farms may also be worth
considering. For more details on web farms, see the Microsoft MSDN Visual Studio 2008 Developer Center;
“How Do I Use Crystal Reports in a Web Farm or Web Garden?”.
Also, see the SAP article “Crystal Reports 10 for .NET Feature Overview”, page 10.
More Scalable Solution
Consider moving to a more scalable solution such as Crystal Reports Report Application Server, or Business
Objects Enterprise. For details on which product may best fit your project requirements see the article
“Choosing the Right Business Objects SDK for Your Needs”.
Related Content
“Crystal Reports XI Release 2 Component Licensing Explained”
“Improving Crystal Reports Performance in Visual Studio .NET Applications”
“Crystal Reports 2008 Component Engine Scalability”
Note; 1218482 - Error: "Failed to Open Report" in .NET using 'ICachedReport' interface
原文下载
 

posted on 2009-07-13 09:33  阿龍  阅读(903)  评论(0编辑  收藏  举报