Crystal Reports Exception: The maximum report processing jobs limit configured by your system administrator has been reached

前端 未结 11 1621
猫巷女王i
猫巷女王i 2020-12-06 02:06

I\'m facing a very buggy issue, in ASP.NET application after viewing the same report many times simultaneously I got this exception:

The maximum repor

相关标签:
11条回答
  • 2020-12-06 02:27

    Greetings I am too late to have answer on it, all reply are working and i have seen but in case still you are facing same problem and error then please once go in to TEMP folder under "windows" directory and delete all instances of crystal report. I am saying this because all above option will work but you are still in the maximum reach so first of all delete all instance then apply all the above suggestion. thanks

    0 讨论(0)
  • 2020-12-06 02:28

    I ended up using GC.WaitForPendingFinalizers in addition to the GC.Collect, close and dispose. I believe my web page was perhaps unloading and stopping thread processing prematurely before the garbage was properly processed (really?)

    This is on Server 2012, SQL 2012, CR 13.0.2000.0

    Here's my code:

    #Region "Cleanup"
    
    Private Sub crCleanup(Optional blnForce As Boolean = False)
        Try
            ' Crystal(code Is Not managed, i.e.it) 's COM interop => you have to manually
            ' release any objects instantiated. Make sure you set the ref to nothing and
            ' also call the dispose method if it has one.
    
            ' under some conditions, we don't want to destroy the ReportDocument (e.g. report page-to-page navigation)
            If blnForce OrElse Me.blnPageHasFatalError OrElse (Not Me.CrystalUseCache) Then ' do not release when using cache! (unless forced)
                If Not crReportDocument Is Nothing Then Me.crReportDocument.Close()
                If Not crReportDocument Is Nothing Then Me.crReportDocument.Dispose()
                If Not thisWebAppUser Is Nothing Then Me.thisWebAppUser.Dispose()
                Me.thisWebAppUser.ClearReportCache() ' we are using HttpContext.Current.Cache.Item instead of sessions to save CR document
            End If
    
            ' the rest of the items, we'll always want to clean up
            If Not crParameterFieldDefinitions Is Nothing Then crParameterFieldDefinitions.Dispose()
            If Not crParameterFieldDefinition Is Nothing Then crParameterFieldDefinition.Dispose()
    
            crParameterFields = Nothing
            crParameterField = Nothing
            crParameterFieldName = Nothing
            crParameterValues = Nothing
            crParameterDiscreteValue = Nothing
            crParameterDefaultValue = Nothing
            crParameterRangeValue = Nothing
    
            '
            If Not crSections Is Nothing Then crSections.Dispose()
            If Not crSection Is Nothing Then crSection.Dispose()
            If Not crReportObjects Is Nothing Then crReportObjects.Dispose()
            If Not crReportObject Is Nothing Then crReportObject.Dispose()
            If Not crSubreportObject Is Nothing Then crSubreportObject.Dispose()
            If Not crDatabase Is Nothing Then crDatabase.Dispose()
            If Not crTables Is Nothing Then crTables.Dispose()
            If Not crTable Is Nothing Then crTable.Dispose()
            crLogOnInfo = Nothing
            crConnInfo = Nothing
    
            crDiskFileDestinationOptions = Nothing
            ConnParam = Nothing
    
            If Not subRepDoc Is Nothing Then subRepDoc.Dispose()
        Catch ex As Exception
            Me.thisWebAppUser.SendSysAdminMessage("Failed CR cleanup", ex.ToString)
        End Try
    
    
        ' yes, use of the GC.Collect (and even more the GC.WaitForPendingFinalizers) is highly controversial
        ' 
        ' the reality is that rendering crystal reports is rather slow compared to most web operations
        ' so it is expected that waiting for GC will have relatively little performance impact
        ' and will in fact, help tremendously with memory management.
        '
        ' try setting these values to 1 and confirm for yourself by instantiating multiple crDocuments in different browsers if you don't believe it:
        '
        '   HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Report Application Server\InprocServer 
        '   HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Report Application Server\Server 
        '
        ' or google this error: The maximum report processing jobs limit configured by your system administrator has been reached
        ' 
        ' I believe the problem is that on very fast servers, the page unloads and stops processing code to properly cleanup the Crystal Report objects
        ' 
        ' This is done in 3 places: 
        '   Report Viewer (Page_Unload and CrystalReportViewer1_Unload) rendering a report will of course always using a processing job
        '   Report Parameter Selector (Page_Unload) loading a crDocument without rendering a report still counts towards CR processing job limit.
        '   Custom Control crReportParameterSelectionTable (Public Overrides Sub dispose())
    
        GC.Collect()
        GC.WaitForPendingFinalizers()
    
    End Sub
    '***********************************************************************************************************************************
    ' 
    '***********************************************************************************************************************************
    Private Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Unload
        'If Me.IsCallback Then Exit Sub ' the menutree causes callbacks, but we are not interested
    
        crCleanup()
        ' response object not available here, so cannot redirect (such as in the case of XLS opeing in a separate window)
    
        ' if for some crazy reason there is STILL a crReportDocument, set it to nothing
        '        If Not crReportDocument Is Nothing Then Me.crReportDocument = Nothing
        '        Me.CrystalReportViewer1 = Nothing
    End Sub
    
    Private Sub CrystalReportViewer1_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Unload
        'If Me.IsCallback Then Exit Sub ' the menutree causes callbacks, but we are not interested
    
        crCleanup()
    End Sub
    

    End Region

    0 讨论(0)
  • 2020-12-06 02:35

    I would recommend moving your close/dispose/gc.collect code outside of that unload process. In other words:

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

    My guess is the viewer control is not completely closed when the report is being cleaned up.

    Crystal is a very memory intensive process and very finicky.

    0 讨论(0)
  • 2020-12-06 02:36

    You have to Dispose your report instance after all. If you Dispose the report after showing it, you will never see the error "The maximum report processing jobs limit configured by your system administrator has been reached" again.

      Dim report1 As rptBill = clsBill.GetReport(billNumber)
    
      rpt.Print()
    
      'Cleanup the report after that!
      rpt.Close()
      rpt.Dispose()
    
    0 讨论(0)
  • 2020-12-06 02:38

    Make sure you are using PUSH model to display your reports. Next you have to make one change in your Server's registry: Follow the path:

    "HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Report Application Server\InprocServer" 
    

    and you will see an item " PrintJobLimit" and you will see that its default value is 75. that means the server can only handle 75 reports at a time. Dont worry about that and just modify the value to -1

    0 讨论(0)
提交回复
热议问题