Skip to Content
0
Former Member
Jun 16, 2011 at 03:35 PM

ReportDocument.SetDataSource(DataTable dataTable) OutOfMemoryException

346 Views

When a customer attempts to display a certain report with a calendar year of data, they get the OutOfMemoryException. Apparently they can successfully display any other report before or after. This is .NET 2.0, Crystal Reports 2008 on a desktop client querying a database server.

Exception: Exception of type 'System.OutOfMemoryException' was thrown. (Type: System.OutOfMemoryException; Source: System.Data)

STACK TRACE (Top Level):

at System.Data.Common.Int32Storage.SetCapacity(Int32 capacity)

at System.Data.RecordManager.set_RecordCapacity(Int32 value)

at System.Data.RecordManager.GrowRecordCapacity()

at System.Data.RecordManager.NewRecordBase()

at System.Data.RecordManager.CopyRecord(DataTable src, Int32 record, Int32 copy)

at System.Data.DataTable.CopyRow(DataTable table, DataRow row)

at System.Data.DataTable.Copy()

at CrystalDecisions.CrystalReports.Engine.Table.SetDataSource(Object val, Type type)

at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSourceInternal(Object val, Type type)

at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSource(DataTable dataTable)

Can any configuration be set to provide more memory? Is there a way to tell in advance if a dataset or datatable is too large?