Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Why Large datatable in the case of crystal report is causing out of memory exception in IIS 7.5? I am using asp.net with c#. The datatable is having around 4 lakh records. But the max limit is around 1 crore something.
So how to resolve this issue.

Crystal Report code as follows:
C#
if(Session["ROLE"].ToString()=="C3O")

          {
                     ds = new ActiveCardsDetails().FetchAllActiveCardsDetails(startMonth, startYear, endMonth, endYear, corporateId,"C3O");
          }
          else
          {
                     ds = new ActiveCardsDetails().FetchAllActiveCardsDetails(startMonth, startYear, endMonth, endYear, corporateId,"C3");
          }


          DataTable dt = new DataTable();
          if (ds.Tables[0].Rows.Count > 0)
              dt = ds.Tables[0];
          else
          {
              Common.showMessage("No Records Found", this);
              return;
          }

          //--Initializing CrystalReport
          reportDocument = new ReportDocument();
          reportDocument.Load(reportPath);
          reportDocument.SetDataSource(dt);

          //Setting ParameterValues to report
          reportDocument.SetParameterValue("@p_FromMonth", startMonth);
          reportDocument.SetParameterValue("@p_ToMonth", endMonth);
          reportDocument.SetParameterValue("@p_FromYear", startYear);
          reportDocument.SetParameterValue("@p_ToYear", endYear);

          //--Binding report with CrystalReportViewer
          CRVActiveCardsDetails.ReportSource = reportDocument;
          CRVActiveCardsDetails.DataBind();
          Common.UserPageAudit(Session["User"].ToString(), "Active Cards Details", Session["ROLE"].ToString(), "Active Cards Details Report Viewed");
Posted
Comments
DamithSL 15-May-14 3:08am    
OMG! you really need to show 4 lakh records in your report?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900