ActiveReports 10
CacheToDisk Property
Example 

GrapeCity.ActiveReports.Document.v10 Assembly > GrapeCity.ActiveReports.Document Namespace > SectionDocument Class : CacheToDisk Property
Sets or returns a value indicating whether to optimize the amount of memory used by the document by caching the report to disk instead of holding it in memory.
Syntax
'Declaration
 
Public Property CacheToDisk As Boolean
public bool CacheToDisk {get; set;}

Property Value

Boolean. The default value is False.
Remarks

Temporary files are written when this property is set to True.  If there is an unhandled exception during report execution, these temporary files may remain on the system.  The location of these files is:

WinForms: C:\Documents and Settings\All Users\Application Data\IsolatedStorage

WebForms: C:\Documents and Settings\<machine name>\ASPNET\ Local Settings\Application Data\IsolatedStorage

CacheToDisk uses IsolatedStorage to store a page’s canvasItems to disk. To use CacheToDisk you must have permissions set for the IsolatedStorage folder.

Temporary files and folders created in IsolatedStorage are not deleted automatically.

Note: This property should only be set to True for reports that consume large amounts of memory, as it slows processing time. The property was created to be used with reports for which there is a danger of being unable to finish processing due to memory usage.

The PDF export will also detect this setting and export the cached report. Other exports will ignore this setting, so very large reports may cause them to run out of memory.

Note that the ClearCanvasItems method does not work correctly if this property is set to True.

Example
private void arv_Load(object sender, System.EventArgs e)
{
    rptDocument rpt = new rptDocument();
    rpt.Document.CacheToDisk = true;
    rpt.Run();
    arv.Document=rpt.Document;
}
Private Sub arv_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles arv.Load
    Dim rpt As New rptDocument
    rpt.Document.CacheToDisk = True
    rpt.Run()
    arv.Document = rpt.Document
End Sub
See Also

Reference

SectionDocument Class
SectionDocument Members
ClearCanvasItems Method