Using Data Snapshots

Using Data Snapshots

Data snapshots store a static snapshot of the data you need to run a report. Without data snapshots, you can only run a report if you have access to everything the report depends on, in particular, the data used by the report and its subreports or subdatasets. A data snapshot saves the data for a specific run so that you can run the report without any data connections. This lets you work on report layout and presentation offline, share a version of the report for troubleshooting, or create a sample report together with data.

The snapshot only contains the data needed by the report at the time it is run. If you make changes to the report that affect its data use, such as adding fields, you will need to create an updated snapshot. When Cache Data in Memory is selected and you have made changes that affect the data use, this is detected and the cached data is automatically updated. Changes that only affect the layout, such as moving fields or resizing bands, do not trigger a cache update.

To create a data snapshot:

1. Select the Preview tab.
2. Right-click and select Cache Data in Memory.
3. Run the report to capture the report data.

To save a data snapshot to a file:

1. Select the Preview tab.
2. Right-click and select Save Data to File.
3. Enter a file name when prompted and click Save. The file is saved with a .jrds (JasperReports data snapshot) extension.
4. Run the report to capture the report data in the file you just created.

To update a data snapshot with new data:

1. Select the Preview tab.
2. Right-click and deselect Cache Data in Memory.
3. Run the report to clear the cache.
4. Right-click , select Cache Data in Memory. If you want to save to a file, also select Save Data to File.
5. Run the report to update the latest report data.

To use a data snapshot:

1. Select the Preview tab.
2. Right-click and select Load From File.
3. Run the report.

The data in the snapshot is used to fill the report. Information about the snapshot is displayed in the Report State window, including when the snapshot was created (Data Queried At) and the name and location of the snapshot file.

 

Version: 
Feedback
randomness