# Cache Mode

When using very large reports with Stimulsoft Reports.Net in 32-bit environments, there is a chance of getting an out of memory exception. Such a scenario could be a small report  that is printed to more than 20.000 pages in one go. The exception is thrown during report rendering inside Stimulsoft Reports.Net, this is after the DataSet has been generated by the PPJ Framework and passed on to the report.

Fortunately, Stimulsoft Reports.Net provides means to handle very large reports through different cache settings. The most important setting is part of the report properties, called "Report Cache Mode" with the following options:

<table data-header-hidden><thead><tr><th width="100"></th><th></th></tr></thead><tbody><tr><td>Off</td><td>Caching is deactivated for this report, all pages are rendered in memory entirely without any caching to disk.</td></tr><tr><td>On</td><td>Caching is enabled directly when report rendering is started.</td></tr><tr><td>Auto</td><td><p>Caching is performed after a certain number of pages have been rendered. To further optimize and tweak the behavior of Stimulsoft Reports.Net, there are three additional options in the Stimulsoft report object that can be accessed at runtime through the PPJ Framework:</p><p><em>StiOptions.Engine.ReportCache.LimitForStartUsingCache</em>: This is the cut off point as a page count of when caching kicks in. For example if this static property has been set to 100 then all pages after 100 will cause the report cache to be used. For all pages up to 100 the report cache is not beeing used.</p><p><em>StiOptions.Engine.ReportCache.AmountOfQuickAccessPages</em>: When rendering a report, the engine usually stores some pages in memory to speed up some internal processes. The memory usually contains just the last rendered pages. In order to change the number of pages to keep in memory, use this static property to further optimize Stimulsoft Reports.Net.</p><p><em>StiOptions.Engine.ReportCache.CachePath</em>: Specify the directory to use for caching purposes.</p></td></tr></tbody></table>

These properties can be modified at runtime during report processing and even before, because they are static.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.iceteagroup.com/general/ported-reports/stimulsoft/cache-mode.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
