Share via


Cache Reports with "High Shareability"

Another way to optimize scalability in a Crystal Reports for Visual Studio project is to cache reports with "high shareability".

What defines a report as having "high shareability"?

A report that has common information that is relevant to all users has high shareability; for example, a report showing quarterly profits for the entire company. In contrast, a report showing an individual's accrued vacation days is user-specific and therefore has low shareability.

Persistence and shareability

Most reports need to be viewed across several page reloads, either to view another page in the report or to reflect changes based on interaction with the viewer's toolbar or the runtime code. For the report to retain state between page reloads it must be stored, or persisted, in server memory.

There is more than one persistence approach to choose from. These approaches are discussed in detail in Which Persistence Approach Should I Use with Crystal Reports? However, most reports are persisted by placing the report into either the user's Session object or the application's Cache object. Reports with low shareability should be persisted using the user's Session object, (see Session and Persistence of the ReportDocument Object Model). Reports with high shareability should be persisted using the application's Cache object, (see Cache and Persistence of the ReportDocument Object Model).

Persistence and scalability

Proper use of persistence benefits scalability by preventing unnecessary usage of server memory. For example, if reports with low shareability were placed in the application's Cache object, this would waste memory because user-specific reports would remain in the Cache long after the user had exited the application. Conversely, if reports with high shareability were placed in the user's Session object, this would waste memory and generate tremendous redundancy by storing many instances of a report where only one was needed.

Using user-level persistence (Session) with reports that have low shareability and application-level persistence (Cache) with reports that have high shareability maximizes the scalability of your server memory.