ActiveReports.Viewer3 Request technical support
CacheToDisk Property
See Also  Example


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

Visual Basic (Declaration) 
Public Property CacheToDisk As Boolean
Visual Basic (Usage)Copy Code
Dim instance As Document
Dim value As Boolean
 
instance.CacheToDisk = value
 
value = instance.CacheToDisk
C# 
public bool CacheToDisk {get; set;}

Return Value

Boolean. The default value is False.

Example

C#Copy Code
private void arv_Load(object sender, System.EventArgs e)
{
   rptDocument rpt =
new rptDocument();
   rpt.Document.CacheToDisk = true;
   rpt.Run();
   arv.Document=rpt.Document;
}
Visual BasicCopy Code
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

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\<user name>\Local Settings\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.

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.

See Also