Vote count:
0
i just want know what is the proper way to release memory that was occupied by crystal report.
this is my code :
ReportDocument reportdocument = new ReportDocument();
try
{
reportdocument.Load(Server.MapPath(@"~/EndUser/PostHistoryReport.rpt"));
reportdocument.SetDataSource(myDataSet);
reportdocument.SetDatabaseLogon("user", "user123");
CrystalReportViewer1.ReportSource = reportdocument;
}
finally
{
if (reportdocument != null)
{
reportdocument.Close();
((IDisposable)reportdocument).Dispose();
GC.Collect();
}
}
asked 34 secs ago
Aucun commentaire:
Enregistrer un commentaire