"Out of Memory Exception" with Push Method for crystal reports

G

Guest

Hi,
I'm using a dataset close to 11 MB as the datasource for my reports.
I've 15 subreports in my report, of which two uses this dataset as the
datasource and the rest uses the same dataset, but have Selection Formula
applied to the report document to filter the data. I get a Out of Memory
exception while looping to set the data source. Has anyone had this problem
before, and how do I fix this.

Thanks,
Debi
 
V

Val Mazur \(MVP\)

Hi,

What kind of tool are you using to create reports? What is the code that
generates this error. If you post more details about it here, then someone
could try to help you.
 
G

Guest

I'm using crystal reports. This is the code
**********************************
sReportPath = Server.MapPath("Reports/Target_Merged.rpt");
rep_doc.Load(sReportPath);
rep_doc.Refresh();
for (int i = 0; i < rep_doc.Subreports.Count; i++)
{

rep_doc.Subreports.SetDataSource(dtReportPerformance);
}
SetSelectionFormula_Target();
*****************************************
This is the exception
*****************************************
Exception of type 'System.OutOfMemoryException' was thrown. ### at
System.Data.Common.DecimalStorage.SetCapacity(Int32 capacity) at
System.Data.DataColumn.SetCapacity(Int32 capacity) at
System.Data.RecordManager.set_RecordCapacity(Int32 value) at
System.Data.RecordManager.GrowRecordCapacity() at
System.Data.RecordManager.NewRecordBase() at
System.Data.DataTable.NewUninitializedRecord() at
System.Data.RecordManager.CopyRecord(DataTable src, Int32 record, Int32 copy)
at System.Data.RecordManager.ImportRecord(DataTable src, Int32 record) 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) at ShowReports.GenerateReport() in c:\projects\Copy of
GenevaCrystal\ShowReports.aspx.cs:line 146
*********************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top