organickarma
Programmer
Environment
Crystal Reports XI Release 2
Visual Studio 2005 ASP . NET 2.0
Windows Server 2003
I have integrated a report that has 2 subreports in it with an ASP . NET website.
I am using Table Adapters to populate dropdownlists for 4 parameters in a cascading manner
When method Parameter4_OnSelectedIndexChanged() is called a method filterReport() is called that sets the values selected to the parameters
The report viewer is called CrystalReportViewer1 and the ReportSource is CrystalReportSource1
These are created by default when I drag drop the viewer and reportsource controls from the toolbox
The site has built beautifully and everything works fine, but from experience I know that when 70 to 80 users are hitting the site the maximum report object creation limt is reached and the app crashes.
i placed this code in filterReport() as follows
protected bool filterReport()
{
CrystalReportSource1.ReportDocument.Close()
CrystalReportSource1.ReportDocument.Dispose()
// This is where I would like to create a new instance of object CrystalReportSource1
//I set the parameters after this
CrystalReportSource1.ReportDocument.SetParameterValue()
and so on
}
This obviously throws an object not set to instance of object exception.
My question is .. where do I place this garbage collection code so that it cleans up resources after browser is closed
OR
What is the way for me to recreate the CrystalReportSource1 object after i close and dispose the previous instance on calling filterReport()
Please HELP!!!
Crystal Reports XI Release 2
Visual Studio 2005 ASP . NET 2.0
Windows Server 2003
I have integrated a report that has 2 subreports in it with an ASP . NET website.
I am using Table Adapters to populate dropdownlists for 4 parameters in a cascading manner
When method Parameter4_OnSelectedIndexChanged() is called a method filterReport() is called that sets the values selected to the parameters
The report viewer is called CrystalReportViewer1 and the ReportSource is CrystalReportSource1
These are created by default when I drag drop the viewer and reportsource controls from the toolbox
The site has built beautifully and everything works fine, but from experience I know that when 70 to 80 users are hitting the site the maximum report object creation limt is reached and the app crashes.
i placed this code in filterReport() as follows
protected bool filterReport()
{
CrystalReportSource1.ReportDocument.Close()
CrystalReportSource1.ReportDocument.Dispose()
// This is where I would like to create a new instance of object CrystalReportSource1
//I set the parameters after this
CrystalReportSource1.ReportDocument.SetParameterValue()
and so on
}
This obviously throws an object not set to instance of object exception.
My question is .. where do I place this garbage collection code so that it cleans up resources after browser is closed
OR
What is the way for me to recreate the CrystalReportSource1 object after i close and dispose the previous instance on calling filterReport()
Please HELP!!!