Exception pour les rapports Crystal: la limite maximale des tâches de traitement de rapports configurée par votre administrateur système a été atteinte

je fais face à un problème très buggy, en ASP.NET application après avoir visionné le même rapport plusieurs fois simultanément j'ai eu cette exception:

la limite maximale des tâches de traitement de rapports configurées par votre système l'administrateur a été atteint.

Attendez je sais qu'il y a des tonnes de solutions là-bas, mais toutes ne travaillent pas avec moi.

  1. je mets ReportDocument.Close (); ReportDocument.Dispose(); dans CrystalReportViewer_Unload événement, et jettent encore l'exception.

    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. je modifie le Registre PrintJobLimit dans HKEY_LOCAL_MACHINESOFTWARESAP BusinessObjectsCrystal Reports for .NET Framework 4.0Report Application ServerInprocServer et HKEY_LOCAL_MACHINESOFTWARESAP BusinessObjectsCrystal Reports for .NET Framework 4.0Report Application ServerServer à -1 même à 9999, et encore jeter l'exception.

Voici l'extrait de code où j'appelle mon rapport:

 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
10
demandé sur Emad Mokhtar 2012-03-06 12:04:33

10 réponses

je vous recommande de déplacer votre fermeture/disposition/CG.recevez un code en dehors de ce processus de déchargement. En d'autres termes:

  1. rapport de chargement
  2. Affecter à la Visionneuse de Contrôle
  3. Afficher le Rapport dans la Visionneuse de Contrôle
  4. Fermer la Visionneuse de Contrôle et de Déchargement (complètement)
  5. puis fermer/éliminer / gc.collect en dehors de n'importe quel code de contrôle d'observateur

le contrôle de la visionneuse n'est pas complètement fermé lorsque le rapport est nettoyé.

Crystal est un processus très exigeant en mémoire et très délicat.

8
répondu John Cruz 2012-03-06 15:58:35

vous devez disposer de votre instance de rapport après tout. Si vous disposez de la déclaration après l'avoir affichée, vous ne verrez plus jamais l'erreur "la limite maximale des tâches de traitement de la déclaration configurée par votre administrateur système a été atteinte".

  Dim report1 As rptBill = clsBill.GetReport(billNumber)

  rpt.Print()

  'Cleanup the report after that!
  rpt.Close()
  rpt.Dispose()
12
répondu Developer 2012-03-06 16:12:51

Salutations je suis trop en retard pour avoir la réponse sur elle, toutes les réponses fonctionnent et je l'ai vu mais au cas où vous êtes confrontés au même problème et l'erreur alors s'il vous plaît une fois aller dans le dossier TEMP sous "Windows" répertoire et supprimer toutes les instances de rapport crystal. Je dis cela parce que toutes les options ci-dessus fonctionneront mais vous êtes toujours dans la portée maximale donc tout d'abord supprimer toutes les instances puis appliquer toutes les suggestions ci-dessus. merci

2
répondu PrashantNet 2015-12-15 11:18:26

documents Crystal reports mise en œuvre des IDisposable de l'interface. Donc tout ce que vous avez à faire est de joindre l'instance du rapport avec la déclaration using . Il sera automatiquement fermé et éliminé une fois la déclaration using remplie. Vous pouvez écrire quelque chose comme ça:

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

ou (en fonction de votre contexte):

using(var report = new ReportDocument())
{
     // your logic here
}
2
répondu Red 2016-06-17 18:50:03

je travaillais sur un serveur de rapports local. J'ai hébergé mon application web dans un autre pc. Quand j'ai eu une telle erreur je viens de faire IISRESET et de travailler très bien maintenant.

essayez ceci, cela pourrait vous aider.

1
répondu pedram 2016-03-02 11:45:00

assurez-vous que vous utilisez PUSH model pour afficher vos rapports. Ensuite, vous devez faire un changement dans le registre de votre serveur: suivez le chemin:

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

et vous verrez un élément" PrintJobLimit " et vous verrez que sa valeur par défaut est 75. cela signifie que le serveur ne peut gérer que 75 rapports à la fois. Ne vous inquiétez pas à ce sujet et il suffit de modifier la valeur à -1

1
répondu Mansoor 2016-03-02 11:45:51

vous devez Dispose votre instance de rapport après tout. Si vous Dispose le rapport après la montrer, vous ne verrez jamais l'erreur:

la limite maximale des tâches de traitement de rapports configurée par votre administrateur système a été atteinte

Code:

Dim report1 As rptBill = clsBill.GetReport(billNumber)

rpt.Print()

'Cleanup the report after that!
rpt.Close()
rpt.Dispose()
1
répondu Amresh Kumar Singh 2017-04-10 11:38:55

dans mon cas, le rapport comportait quatre sous-rapports...

ce qui a résolu pour moi était de changer la valeur de "PrintJobLimit", de 75 à 500, dans les chemins Regedit suivants:

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

  • \HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\SAP Business Objects\Crystal Reports for .net Framework 4.0\Report Application Server\Server

1
répondu Fernando Meneses Gomes 2018-06-02 18:24:29

assurez-vous que l'utilisateur IIS ont la permission suffisante pour supprimer les fichiers présents dans "c:/windows/temp" dossier.

je fais face à la même question une fois que j'ai fourni la permission d'écrire à ce dossier puis il a résolu mon problème.Assurez-vous également de disposer de cet objet après avoir généré le fichier

0
répondu user3671423 2018-01-18 04:45:34

j'ai fini par utiliser GC.Attendre les finaliseurs de prêt en plus du GC.Collecter, fermer et disposer. Je crois que ma page Web était peut-être en train de décharger et d'arrêter prématurément le traitement du fil avant que les ordures ne soient traitées correctement (vraiment?)

C'est sur le serveur 2012, SQL 2012, CR 13.0.2000.0

Voici mon 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

Région Finale

-1
répondu gojimmypi 2016-08-24 21:10:18