Greetings!
Currently I am working with one of our customer’s issue. The Issue is a Crystal Report 2013 insufficient memory issue. Following are the details of the issue:
Our customer is running a report for a period of 3 months (last quarter) against a moderate size MS SQL Server database. They are hitting the following error:
[Error] ReportViewer.RefreshReport: Exception Occured during RunReport. Cancelled=False
Top Exception
Type=System.Runtime.InteropServices.COMException
Source=rptcontrollers.dll
Message=Not enough memory for operation.
StackTrace:
at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.GetLastPageNumber(RequestContext pRequestContext)
at CrystalDecisions.ReportSource.EromReportSourceBase.GetLastPageNumber(ReportPageRequestContext reqContext)
at CrystalDecisions.CrystalReports.Engine.FormatEngine.GetLastPageNumber(ReportPageRequestContext reqContext)
at ININ.Reporting.Historical.Engine.Module.ViewModels.CrystalReportsViewerControl.RunReport() in d:\builds\eic_main_systest\products\eic\src\reporting\HistoricalReporting\ReportEngine\ReportEngineModule\ViewModels\CrystalReportsViewerControl.cs:line 125
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
StackTrace:
at <>c__DisplayClass16.<RefreshReport>b__11(Exception q) d:\builds\eic_main_systest\products\eic\src\reporting\HistoricalReporting\ReportEngine\ReportEngineModule\ViewModels\ReportViewer.cs(548)
at AggregateException.Handle(Func`2 predicate)
at ReportViewer.<RefreshReport>b__10(Task`1 p) d:\builds\eic_main_systest\products\eic\src\reporting\HistoricalReporting\ReportEngine\ReportEngineModule\ViewModels\ReportViewer.cs(562)
at ContinuationTaskFromResultTask`1.InnerInvoke()
at Task.Execute()
at Task.ExecutionContextCallback(Object obj)
at ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
at Task.ExecuteEntry(Boolean bPreventDoubleExecution)
at SynchronizationContextTaskScheduler.PostCallback(Object obj)
at ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at DispatcherOperation.InvokeImpl()
at DispatcherOperation.InvokeInSecurityContext(Object state)
at ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
at DispatcherOperation.Invoke()
at Dispatcher.ProcessQueue()
at Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at HwndSubclass.DispatcherCallbackOperation(Object o)
at ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at UnsafeNativeMethods.DispatchMessage(MSG& msg)
at Dispatcher.PushFrameImpl(DispatcherFrame frame)
at Dispatcher.PushFrame(DispatcherFrame frame)
at Application.RunDispatcher(Object ignore)
at Application.RunInternal(Window window)
at Application.Run(Window window)
at WpfShellImplementation.ShowAndRun() d:\builds\eic_main_systest\products\eic\src\Cafe\Library.Wpf\WpfShellImplementation.cs(72)
at CafeApplication.Run() d:\builds\eic_main_systest\products\eic\src\Cafe\Library\CafeApplication.cs(203)
at ShellApplication.RunApp()
at ShellApplication.Main()
We are able to reproduce the issue in our local testing environment too with their database. We have tested the report with 16 GB of memory, but the application running the Crystal Report is well under the available memory.
We have tested the database query also, following are the results:
Further investigating the issue, we tried to search some content about the error, we found this link which shows that Crystal Report, being a 32-bit app, can only access approximately 2GB of RAM at any given point in time. Our Crystal Report version is 13.0.9.1312:
The report that is failing to run has aggregation/sum formulas for different groups. This report runs fine if run for a shorter period of time (<30 days).
Is there any limitation in CR2013 for handling big dataset with aggregation/sum formulas for different groups? We appreciate some help to resolve this issue.
Thanks!
Sanjoy.