564 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owls only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
|Prevent Reporting Services from caching data|
|By default SSRS will create files with extension .rdl.data to cache data. This blog gives two and a half ways to ensure you're always seeing the latest data in a report.|
How can you be sure that you're seeing the latest copy of any data? The answer: disable report caching. This blog explains what the problem is, then gives two-and-a-half possible solutions.
So - you run a report listing out various films from a Movies database, and get:
The first couple of films from our report.
You decide that Jurassic Park was too long (that scary bit with the T. Rex should be cut), and make a change to your data:
The owl's cut: 1 hour 40 minutes should do it.
You then rerun the report, and nothing has changed:
The film length hasn't changed in the report, even though the underlying data has.
This problem comes about because SSRS is trying to speed up your reports. Whenever you run a report using exactly the same combination of parameters (where there are any) as for the previous time you ran the report, you'll see cached data.
A simple solution is just to refresh the data for your report:
Click on the icon shown to see the latest data for your report.
A second solution is to delete the cached data file:
Find the file with extension .rdl.data in your project in Windows Explorer and delete it - you'll then get the latest data when you run your report.
This isn't a great solution: you have to keep doing it again (as the file shown is recreated whenever you run the report); there's always the risk you'll delete the report itself by mistake; and you have to delete the report through Windows Explorer, as it doesn't show up in Solution Explorer in Visual Studio.
You can - in theory - prevent report caching by changing your configuration settings - but first you have to find them! The folder path will be something like:
Once you've found this folder, you can double-click on the file called RSReportDesigner.config to edit it:
Double-click on this file to change your settings.
You can then change the CacheDataForPreview option to false:
Change the value of this option from true to false to disable data caching.
However, this change doesn't seem to have any effect in SSRS 2008 (although I suspect it did work in earlier versions), and Microsoft seem to agree.
If anyone can throw any more light on this, please do so via the comments at the bottom of this web page.
25 Aytoun Street