How to load maximum record with crystal report? - crystal-reports

I'm working with crystal report. With crystal report, I have done with few no. of record history. Now just want to load 1139 Records to display and I'm getting this error like above:
Server Error in '/EasyWeb' Application.
The maximum report processing jobs limit configured by your system administrator has been reached.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: The maximum report processing jobs limit configured by your system administrator has been reached.
Source Error:
Line 807: dt.Rows.Add(dr);
Line 808: ReportDocument reportdocument = new ReportDocument();
Line 809: reportdocument.Load(Server.MapPath(#"~/Admin/UserReport.rpt"));
Line 810: reportdocument.SetDataSource(myDataSet);
Line 811: reportdocument.SetDatabaseLogon("user", "user123");
Source File: f:\EasyWeb\Admin\User_Management.aspx.cs Line: 809
Stack Trace:
[COMException (0x80041016): The maximum report processing jobs limit configured by your system administrator has been reached.]
CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +144
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +526
[CrystalReportsException: Load report failed.]
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +621
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) +1969
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename) +186
Admin_User_Management.lbut_print_Click(Object sender, EventArgs e) in f:\EasyWeb\Admin\User_Management.aspx.cs:809
System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) +111
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +79
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
-------------------------------------Updated-----------------------------------------------
reportdocument.Load(Server.MapPath(#"~/Admin/PostHistoryReport.rpt"));
reportdocument.SetDataSource(myDataSet);
reportdocument.SetDatabaseLogon("user", "user123");
CrystalReportViewer1.ReportSource = reportdocument;
reportdocument.Clone();
reportdocument.Dispose();
GC.Collect();
but it's give me error at loading time i include it's screen shot for summary.

We were facing a similar issue recently and it has nothing to do with the number of records your report is trying to retrieve, but rather the number of times you've used the Crystal Reports runtime to open and access reports, specifically creating and consuming a ReportDocument variable, without closing and disposing it.
Have a look at this related article:
Crystal Reports Exception: The maximum report processing jobs limit configured by your system administrator has been reached
Effectively, the solution for us was the following pattern:
ReportDocument report = CreateReportDocument(reportPath);
// Do stuff with the report
report.Close();
report.Dispose();
GC.Collect();
And that resolved our issue of being able to generate a small number of reports before getting the same exception you have. I hope this helps!

First of all issue the ISSRESET command on cmd prompt to clear logs and put the following code under the Unload event of the report viewer going forward.
Here is an example
Protected Sub CrystalReportViewer1_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Unload
master1.Close()
master1.Dispose()
GC.Collect()
End Sub
under

Related

CRM 2016 online - debug custom workflow activity crashes plugin registration tool

I wanted to use Plugin Registration Tool (from now on referenced as PRT) to debug custom workflow activity with CRM 2016 online. My problem is that whenever I click on "Profile Workflow" button, PRT crashes.
Details on crash are found in event log and are stated below.
Event log entry one:
Faulting application name: PluginRegistration.exe, version: 8.2.1.8676, time stamp: 0x58d073d5
Faulting module name: KERNELBASE.dll, version: 10.0.15063.296, time stamp: 0xa0527b0c
Exception code: 0xe0434352
Fault offset: 0x0000000000069e08
Faulting process id: 0xb70
Faulting application start time: 0x01d2ea6794b7727a
Faulting application path: D:_temp\SDK\Tools\PluginRegistration\PluginRegistration.exe
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report Id: 21f5bf85-22be-44ca-b884-ef43d9490886
Faulting package full name:
Faulting package-relative application ID:
Event log entry two:
Application: PluginRegistration.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Xml.XPath.XPathException
at MS.Internal.Xml.XPath.XPathParser.CheckToken(LexKind)
at MS.Internal.Xml.XPath.XPathParser.ParsePredicate(MS.Internal.Xml.XPath.AstNode)
at MS.Internal.Xml.XPath.XPathParser.ParseStep(MS.Internal.Xml.XPath.AstNode)
at MS.Internal.Xml.XPath.XPathParser.ParseRelativeLocationPath(MS.Internal.Xml.XPath.AstNode)
at MS.Internal.Xml.XPath.XPathParser.ParsePathExpr(MS.Internal.Xml.XPath.AstNode)
at MS.Internal.Xml.XPath.XPathParser.ParseUnionExpr(MS.Internal.Xml.XPath.AstNode)
at MS.Internal.Xml.XPath.XPathParser.ParseMultiplicativeExpr(MS.Internal.Xml.XPath.AstNode)
at MS.Internal.Xml.XPath.XPathParser.ParseAdditiveExpr(MS.Internal.Xml.XPath.AstNode)
at MS.Internal.Xml.XPath.XPathParser.ParseRelationalExpr(MS.Internal.Xml.XPath.AstNode)
at MS.Internal.Xml.XPath.XPathParser.ParseEqualityExpr(MS.Internal.Xml.XPath.AstNode)
at MS.Internal.Xml.XPath.XPathParser.ParseAndExpr(MS.Internal.Xml.XPath.AstNode)
at MS.Internal.Xml.XPath.XPathParser.ParseOrExpr(MS.Internal.Xml.XPath.AstNode)
at MS.Internal.Xml.XPath.XPathParser.ParseExpresion(MS.Internal.Xml.XPath.AstNode)
at MS.Internal.Xml.XPath.XPathParser.ParseXPathExpresion(System.String)
at System.Xml.XPath.XPathExpression.Compile(System.String, System.Xml.IXmlNamespaceResolver)
at System.Xml.XPath.XPathNavigator.Compile(System.String)
at System.Xml.XmlNode.SelectSingleNode(System.String, System.Xml.XmlNamespaceManager)
at PluginProfiler.Library.WorkflowXamlUtility.GetCustomActivityFullyQualifiedName(System.String, System.Xml.XmlNode, System.Xml.XmlNamespaceManager)
at PluginProfiler.Library.WorkflowXamlUtility.GetCustomActivityFullyQualifiedNames(Microsoft.Xrm.Tooling.Connector.CrmServiceClient, System.Xml.XmlDocument, System.Xml.XmlNamespaceManager)
at PluginProfiler.Library.WorkflowXamlUtility.GetWorkflowActivitySteps(Microsoft.Xrm.Tooling.Connector.CrmServiceClient, System.String)
at Microsoft.Crm.Tools.PluginRegistration.CommonControls.ExistingWorkflow.Refresh()
at Microsoft.Crm.Tools.PluginRegistration.CommonControls.ProfilerSettingsViewModel.set_SelectedWorkFlow(Microsoft.Crm.Tools.PluginRegistration.CommonControls.ExistingWorkflow)
at Microsoft.Crm.Tools.PluginRegistration.CommonControls.ProfilerSettingsViewModel.RefreshWorkflows()
at Microsoft.Crm.Tools.PluginRegistration.CommonControls.ProfilerSettingsViewModel..ctor(Microsoft.Crm.Tools.Libraries.CrmOrganization, PluginProfiler.OperationType, System.Guid, Microsoft.Crm.Tools.PluginRegistration.CommonControls.ProfilerSettingsView)
at Microsoft.Crm.Tools.PluginRegistration.OrganizationControlViewModel.StartProfiler_Clicked()
at Microsoft.Crm.Tools.PluginRegistration.OrganizationControlViewModel.MenuItem_Clicked(System.Object)
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(System.Windows.Input.ICommandSource, Boolean)
at System.Windows.Controls.MenuItem.InvokeClickAfterRender(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at System.Windows.Application.RunDispatcher(System.Object)
at System.Windows.Application.RunInternal(System.Windows.Window)
at Microsoft.Crm.Tools.PluginRegistration.App.Main()
Both event log entries are created at same time when plugin crashed.
I've spent last our googling, trying to find someone with at least similar problem, but I failed :)
Is there any solution for this?
I've seen behavior like this before with plugins and custom workflow activities depending on the actions taken within the code. For example, if my plugin does an http request I've seen that crash the PRT, I don't know for sure but it may be that the PRT doesn't allow that type of thing if it's debugging in a sandboxed environment.
An alternative to directly debugging the custom workflow activity or plugin is to create a new custom entity with some fields to store information such as the user id the code is running as, the name of the plugin or workflow activity, exception message, etc. and then in the code write to a StringBuilder object in the same way you might write useful information out to the tracing object. In a catch block or always at the end of the code you can create a new record of the custom entity and store the information from the StringBuilder and plugin context, etc. I've used this in a lot of situations where I want to output custom detailed info for debugging or testing as long as the plugin doesn't need to throw an exception which will roll back the transaction. It may seem tedious to add the extra code to output what you want but if debugging isn't an option this will work.
Example code to illustrate what I mean...
Dim tracer As New StringBuilder
Try
tracer.Append("running code ...")
'// do some code here
tracer.AppendLine("done")
tracer.Append("running more code ...")
'// do some code here
tracer.AppendLine("done")
'// Write out some info useful for debugging
tracer.AppendLine(String.Format("value of variable 1 {0}", SomeVariable1))
Catch ex As Exception
tracer.AppendLine(ex.ToString)
End Try
'// Create a new instance of the new custom error entity and save it
'// Where CustomError is the name of your new entity, assuming you're using strongly-typed entity classes
Dim ErrorObj As New CustomError With {
.UserName = "",
.Message = tracer.ToString
}
pluginOrgService.Create(ErrorObj)
I've contacted MS support, exchanged emails with them for couple od days, even had a remote session with their support, then waited couple more days for their support to analyze problem, never got any solution from MS support, and at the end I overcome this by my own.
Problem here is with tool as I wanted to report to MS, but for some reason they are convinced that problem is with my custom code. I managed to narrow down this to one specific custom workflow that I made, lets call it Workflow_A. When plugin registration tool (PRT) try to get list of workflows from CRM (I used Fiddler, there is no order by in that request), Workflow_A was first in that list, PRT could not parse it and crashed. I then, deleted that workflow and recreated it again (same steps and conditions) and voila, it ended as last in workflows list and PRT stop crashing.
AK3800 stated
if my plugin does an http request I've seen that crash the PRT, I don't know for sure but it may be that the PRT doesn't allow that type of thing if it's debugging in a sandboxed environment.
I had to agree with him - PRT is making more problems then it solves (with debugging) so at the end I ended up filling my code with trace logs everywhere and no debugging, just making code changes based on trace logs.
I'd open a support ticket with MS. They offer support for the SDK tools as well.

How can I fix this? System.NullReferenceException: Object reference not set to an instance of an object

just having some problem with the new IIS and ASP.Net4, i was using an upload system in an old version of both in an old server.
Now my request was to put the upload system into a new server and make it run. It was easy at the beginning, but now I have some problems with it. I can loggin and download files, that works great, but if I just try to upload a file, then i get an error like this:
Server Error in '/DownloadManager' Application.
System.NullReferenceException: Object reference not set to an instance
of an object. at
DimpleSoftwares.KFileUploadPlus.KRequestStream.ReadPreloaded(Byte[]
buffer, Int32 offset, Int32 count) at
DimpleSoftwares.KFileUploadPlus.KRequestStream.Read(Byte[] buffer,
Int32 offset, Int32 count) at
DimpleSoftwares.KFileUploadPlus.KUploadRequest..ctor(KRequestStream s,
String strFileName, UploadModule UpLoadModule, Encoding encoding)
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.Exception: System.NullReferenceException:
Object reference not set to an instance of an object. at
DimpleSoftwares.KFileUploadPlus.KRequestStream.ReadPreloaded(Byte[]
buffer, Int32 offset, Int32 count) at
DimpleSoftwares.KFileUploadPlus.KRequestStream.Read(Byte[] buffer,
Int32 offset, Int32 count) at
DimpleSoftwares.KFileUploadPlus.KUploadRequest..ctor(KRequestStream s,
String strFileName, UploadModule UpLoadModule, Encoding encoding)
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[Exception: System.NullReferenceException: Object reference not set to
an instance of an object. at
DimpleSoftwares.KFileUploadPlus.KRequestStream.ReadPreloaded(Byte[]
buffer, Int32 offset, Int32 count) at
DimpleSoftwares.KFileUploadPlus.KRequestStream.Read(Byte[] buffer,
Int32 offset, Int32 count) at
DimpleSoftwares.KFileUploadPlus.KUploadRequest..ctor(KRequestStream s,
String strFileName, UploadModule UpLoadModule, Encoding encoding)]
DimpleSoftwares.KFileUploadPlus.KUploadRequest..ctor(KRequestStream s,
String strFileName, UploadModule UpLoadModule, Encoding encoding)
+2225 DimpleSoftwares.KFileUploadPlus.UploadModule.context_BeginRequest(Object
sender, EventArgs e) +1766
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+80 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +165
I just wondering how can I fix that? I have to add the modules manually in IIS? because for example i don´t find the System.Web.SyncEventExecutionStep or System.Web.HttpApplication.ExecuteStep
I really misst something and I don´t see it...
I've encountered a similar problem "Object reference not set to an instance of an object" before and it was primarily due to .NET v4.5.
If it's possible (unless you really need v4.5), can you try downgrading .NET Framework from v4.5 to just v4.0 and run the code again. The version 4.5 doesn't actually show up in IIS ApplicationPool so there might be a confusion when you see that your web app shows you that it's using v4.0. Note that when you uninstall 4.5 you have to reinstall v4.0 because uninstalling v4.5 takes down v4.0 with it unlike the previous version of .NET (eg v3.0, v3.5 where removing 3.5 won't necessarily remove 3.0).
Hope this helps somehow.
I know it's too late but it would help someone else.
Just go to Application properties-> Build -> Change the Platform Target to x64 or 'Any CPU'.
With this setting it should work.

Program crashes while executed in release visual c++

I have just begun to use Visual C++ 2008 to create an app for my PC.
Program work both in debug and release mode when its run from visual c++.
When I run release when is visual c++ closed and click on buttons unhandled exception occurred.
So what does that actually mean? How to solve the problem ?
Thanks
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.OverflowException: Value was either too large or too small for a character.
at System.Convert.ToChar(Int32 value)
at gorskikotar.Form1.chekSum(String DtCS) in c:\users\freza\desktop\ozalj jednajedinica v100\gorskikotar\form1.h:line 1151
at gorskikotar.Form1.slanjeKomande(String tip, String group, String unit, String komanda) in c:\users\freza\desktop\ozalj jedna jedinica v100\gorskikotar\form1.h:line 1127
at gorskikotar.Form1.testAlarmi(String group, String unit) in c:\users\freza\desktop\ozalj jedna jedinica v100\gorskikotar\form1.h:line 1024
at gorskikotar.Form1.uredajiZaTest() in c:\users\freza\desktop\ozalj jedna jedinica v100\gorskikotar\form1.h:line 1011
at gorskikotar.Form1.button8_Click(Object sender, EventArgs e) in c:\users\freza\desktop\ozalj jedna jedinica v100\gorskikotar\form1.h:line 529
I found your problem: In the code you linked to (it should really be in the question) you declare the variable sum, but you do not initialize it. Visual Studio is helpful and clears it for you, but when running outside of VS, then this variable can be anything.
Change declaration line to:
long sum = 0, i, a, b;

Unhandled exception - just in time debugging

I have an application (extension) that works fine on Windows XP platform. When I run this application on Windows 7 it throws this error. I am not sure what is causing this. I was thinking that it could be due to the fact that .net framework is not installed but I can see all in there. Looking for any ideas to resolve this issue.
Note: this error comes up when I click on a combox box. How can i get past this message box and get to actual error.
Thanks
Jay
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at MapExt_Net.HEI_Extensions.layout.frmLayout.DisplaySize()
at MapExt_Net.HEI_Extensions.layout.frmLayout.cBLayoutExtent_SelectedIndexChanged(Object sender, EventArgs e)
at System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e)
at System.Windows.Forms.ComboBox.WmReflectCommand(Message& m)
at System.Windows.Forms.ComboBox.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
The exception is raised in MapExt_Net.HEI_Extensions.layout.frmLayout.DisplaySize() which seems to be implemented by yourself. Could you please paste the code of the method?

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

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 report processing jobs limit configured by your system
administrator has been reached.
Wait I know there are tons of solutions out there but all of them are not working with me.
I put ReportDocument.Close(); ReportDocument.Dispose(); in CrystalReportViewer_Unload event, and still throw the 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
I edit the PrintJobLimit registry in HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Report Application Server\InprocServer and HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Report Application Server\Server to -1 even to 9999, and still throw the exception.
Here is the code snippet where I call my report:
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
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()
I would recommend moving your close/dispose/gc.collect code outside of that unload process. In other words:
Load report
Assign to Viewer Control
Show Report in Viewer Control
Close Viewer Control and Unload (completely)
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.
Crystal Report document implements IDisposable interface. So all you have to do is to enclose the report's instance with using statement. It will be automatically closed and disposed once the using statement is completed. You can write something like that:
using(var report = GetInvoiceReport())
{
// your logic here
}
or (depends on your context):
using(var report = new ReportDocument())
{
// your logic here
}
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
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
Make sure IIS user have sufficient permission to delete files present in "c:/windows/temp" folder.
I face the same issue once I provide write permission to that folder then it solved my issue.Also make sure dispose that object after generating the file
I was working on local report server. I have hosted my web application in other pc. When I got such error I just did IISRESET and working fine now.
Try this, this could help you.
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
Code:
Dim report1 As rptBill = clsBill.GetReport(billNumber)
rpt.Print()
'Cleanup the report after that!
rpt.Close()
rpt.Dispose()
In my case, the report had 4 subreports...
What solved for me was changing the value of "PrintJobLimit", from 75 to 500, in the following Regedit paths:
\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Report Application Server\InprocServer
\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Report Application Server\Server
I know this thread is older, but if you configure the app pool setting "Recycling..." to recycle at, say, 180 minutes instead of 1740 minutes (the default), this might free up the needed resources.
Use These methods when unload the page
ReportDocument crystalReport;
protected void Page_Unload(object sender, EventArgs e)
{
if (crystalReport != null)
{
crystalReport.Close();
crystalReport.Dispose();
}
}
OR
protected void Page_Unload(object sender, EventArgs e)
{
if (crystalReport != null)
{
crystalReport.Close();
crystalReport.Clone();
crystalReport.Dispose();
crystalReport = null;
GC.Collect();
GC.WaitForPendingFinalizers();
}
}
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