2012-03-06 12 views
10

Sono di fronte a un problema molto buggato, nell'applicazione ASP.NET dopo aver visualizzato lo stesso rapporto molte volte contemporaneamente ho ottenuto questa eccezione:Eccezione Crystal Reports: è stato raggiunto il limite massimo di lavori di elaborazione del report configurato dall'amministratore di sistema

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

Aspetta, so che ci sono tonnellate di soluzioni là fuori, ma non tutte funzionano con me.

  1. Ho messo ReportDocument.Close(); ReportDocument.Dispose(); in CrystalReportViewer_Unload event e lancia comunque l'eccezione.

    Private Sub CrystalReportViewer1_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Unload reportFile.Close() reportFile.Dispose() GC.Collect() End Sub

  2. ho modificare il Registro di PrintJobLimit in HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Report Application Server\InprocServer e HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Report Application Server\Server a -1 fino al 9999, e ancora generare l'eccezione.

Ecco il frammento di codice in cui io chiamo la mia relazione:

Table_Infos = New TableLogOnInfos() 
       Table_Info = New TableLogOnInfo() 
       Con_Info = New ConnectionInfo() 

       With Con_Info 
        .ServerName = ConfigurationManager.AppSettings("server_name") 
        .DatabaseName = ConfigurationManager.AppSettings("DB") 
        .UserID = user_name 
        .Password = pass_word 
        .Type = ConnectionInfoType.SQL 
        .IntegratedSecurity = False 
       End With 

       Table_Info.ConnectionInfo = Con_Info 

       If Session("recpt_lang") = "Arabic" Then 
        reportFile.Load(Server.MapPath("/Reports/") & "collectrecpt_new_ar.rpt") 
       ElseIf Session("recpt_lang") = "English" Then 
        reportFile.Load(Server.MapPath("/Reports/") & "collectrecpt_new.rpt") 
       End If 

       For Each mytable In reportFile.Database.Tables 

        mytable.ApplyLogOnInfo(Table_Info) 

       Next 

       CrystalReportViewer1.ReportSource = reportFile 
       CrystalReportViewer1.SelectionFormula = Session("SelectionForumla") 
       CrystalReportViewer1 = Nothing 

risposta

8

Suggerirei spostando il vicino/smaltire codice/GC.Collect al di fuori di quel processo di scaricamento. In altre parole:

  1. rapporto carico
  2. Assegna al visualizzatore di controllo
  3. Mostra Report nel controllo Visualizzatore
  4. Chiudere Visualizzatore di controllo e di scaricamento (completo)
  5. Poi vicino/smaltimento/GC.Collect fuori di qualsiasi codice di controllo del visualizzatore

La mia ipotesi è che il controllo del visualizzatore non sia completamente chiuso quando il rapporto viene ripulito.

Crystal è un processo molto intensivo di memoria e molto pignolo.

+0

Sto anche cercando di fare lo stesso utilizzando ... ma che mostra l'eccezione del tipo di riferimento oggetto, quindi devo usare il metodo di scarico che non ha un bell'aspetto. –

11

Dopotutto, è necessario eliminare l'istanza del report. Se il rapporto viene eliminato dopo averlo mostrato, non si vedrà mai più l'errore "Il limite massimo dei lavori di elaborazione del rapporto configurato dall'amministratore di sistema è stato raggiunto".

Dim report1 As rptBill = clsBill.GetReport(billNumber) 

    rpt.Print() 

    'Cleanup the report after that! 
    rpt.Close() 
    rpt.Dispose() 
0

Assicurarsi di utilizzare il modello PUSH per visualizzare i report. Poi si deve fare un cambiamento nel Registro di sistema del server: Seguire il percorso:

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

e vedrete una voce "PrintJobLimit" e vedrete che il suo valore di default è 75. che significa che il server può gestire solo 75 rapporti alla volta. Non ti preoccupare di questo e solo modificare il valore a -1

+0

Per favore @Mansoor controlla la mia domanda Ho scritto che l'ho già fatto. –

+0

Stai essenzialmente rendendo illimitati i lavori di stampa. questa è una pratica molto pessima. Puoi anche dire loro di riavviare IIS ogni volta che succede e starai bene. – oppassum

2

Saluti Sono troppo tardi per avere risposta su di esso, tutta risposta stanno lavorando e ho visto, ma nel caso in cui ancora si trovano ad affrontare lo stesso problema e l'errore allora per favore una volta entrare nella cartella TEMP sotto la directory "windows" ed eliminare tutte le istanze di Crystal Reports. Sto dicendo questo perché l'opzione sopra riportata funzionerà ma tu sei ancora nella massima copertura, quindi prima di tutto cancella tutte le istanze quindi applica tutto il suggerimento sopra. grazie

1

Stavo lavorando al server di report locale. Ho ospitato la mia applicazione web su un altro pc. Quando ho ricevuto questo errore, ho appena fatto IISRESET e ora sto lavorando bene.

Prova questo, questo potrebbe aiutarti.

+0

Chi ha downvoted? Dai il motivo – pedram

2

Crystal Report documenta l'interfaccia IDisposable. Quindi tutto ciò che devi fare è racchiudere l'istanza del rapporto con l'istruzione using. Sarà automaticamente chiuso e eliminato una volta completata la dichiarazione using. È possibile scrivere qualcosa di simile:

using(var report = GetInvoiceReport()) 
{ 
    // your logic here 
} 

o (dipende dal vostro contesto):

using(var report = new ReportDocument()) 
{ 
    // your logic here 
} 
-1

ho finito per usare GC.WaitForPendingFinalizers oltre al GC.Collect, chiudere e smaltire. Credo che la mia pagina web è stato forse lo scarico e l'arresto di trasformazione filo prematuramente prima che la spazzatura è stata correttamente elaborata

Questo è il Server 2012, SQL 2012, CR 13.0.2000.0

Ecco il mio codice (davvero?):

#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 Regione

+0

promemoria che i dati di riempimento in un crRoportDocument devono essere presenti in Page_Init e non in Page_Load. Vedi [https://scn.sap.com/thread/1070812](https://scn.sap.com/thread/1070812) – gojimmypi

1

Devi Dispose all'istanza rapporto, dopo tutto. Se si Dispose il rapporto dopo aver mostrato che, non vedrete mai l'errore:

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

Codice:

Dim report1 As rptBill = clsBill.GetReport(billNumber) 

rpt.Print() 

'Cleanup the report after that! 
rpt.Close() 
rpt.Dispose() 
0

Assicurarsi utente di IIS dispone di autorizzazioni sufficienti per eliminare i file presenti in "c:/windows/temp "cartella.

mi trovo di fronte lo stesso problema una volta che fornisco i permessi di scrittura a quella cartella allora risolto il mio issue.Also assicurarsi smaltire l'oggetto dopo aver generato il file di

Problemi correlati