Saturday, October 10, 2015

Report Snapshots in SSRS





A Report Snapshot is a report that contains layout information and a data-set that is retrieved at a specific point in time. Unlike on-demand reports, which get up-to-date query results when you select them, report snapshots are processed on a schedule and then saved to a report server. When you select a report snapshot for viewing, the report server retrieves the stored report from the report server database, and shows the data and layout that were current for the report at the time the snapshot was created.
In this article, I will show you how to use report snapshots in SSRS.
1. First of all open Internet Explorer and go to Report Manager URL which is something  like below:
http://bhushan-pc/Reports2012
Your internet explorer tab looks like below :
1-Report Snapshots in SSRS
2. Click on your SSRS project. In my case it is Start SSRS. So now it will show you the list of reports which are deployed on your report server.
2-Report Snapshots in SSRS
3. Now click on down arrow on the report which you want to subscribe and selectManage as shown in below screen shot.
3-Report Snapshots in SSRS
4. Then select Snapshot Options from left pane and you will see screen shown in below screen shot.
4-Report Snapshots in SSRS
The following are the main points of Snapshot Options : 
Allow report history to be created manually : Select this check box to add snapshots to report history as needed. Selecting this check box causes the New Snapshot button to appear on the History page.
Store all report execution snapshots in report history :Select this check box to copy a report snapshot that you generate based on report execution properties to report history. You can set report execution properties to run a report from a generated snapshot. By setting this report history property, you can keep a record of all reports snapshots that are generated over time by placing copies of them in report history.
Use the following schedule to add snapshots to report history : Select this check box to add snapshots to report history on a scheduled basis. You can create a schedule that is used exclusively for this purpose, or you can select a predefined shared schedule if one contains the schedule information you want.
Select the number of snapshots to keep : Select from the following options to control the number of reports that are kept in report history. Report history settings can vary for each report.
  • Select Use default setting to retain the default setting. The report server administrator controls a master setting for report history storage. If you choose this option, the number of snapshots that are retained is obtained from this master setting.
  • Select Keep an unlimited number of snapshots in report history to retain all report history snapshots. You must manually delete snapshots to reduce the size of report history.
  • Select Limit the copies of report history to retain a set number of snapshots. When the limit is reached, older copies are removed from report history to make room for newer copies.
Report history is stored in the report server database. If you have large reports or numerous reports for which you want to maintain history, consider limiting the amount of report history to help manage the disk space requirements of the report server database.
5. Now we modify above properties as par our requirements. See below screen shot.
5-Report Snapshots in SSRS
6. Then click on Apply button. So we have done with Report Snapshots in SSRS.
You will also see the Report Snapshot History by clicking on Report History.
In that screen you will also take Manual Snapshot by clicking on New SnapshotButton.
6-Report Snapshots in SSRS
Congratulations! We successfully completed use of Report Snapshots in SSRS.



1.   Background

The aim of this article is to describe a way of Report Snapshot creation and how we can utilize the snapshot. Report Snapshot is very useful when we need report for a specific point of time. By using Report Snapshot, We can maintain history reports (e.g month wise reports) that will be helpful for analysis purpose.

2.   What is Report Snapshot?

  •  A report snapshot is a report that contains layout information and query results that were retrieved at a specific point in time.
  • We can say that it is the replica of report executed at a specific time.
  • All the report snapshot saved in ReportServer DB.
  • Report Snapshot will not provide you the latest data from the data source.
  • We can create report snapshot on schedule basis.
  • By creating a series of report snapshots, you can build a history of a report that shows how data changes over time.
  • By scheduling large reports to run during off-peak hours, you can reduce processing impact on the report server during core business hours.

3.   Prerequisite

  • Reporting Services should be configured
  • SQL Agent service should run.
  • Credential should store securely in the report server for the data source mapped to Report/Report Dataset. Below is the screenshot from Datasource property page:
.

4.   Steps to create Report Snapshot:

Below is the sample report showing census details of India:

This report is extracting data from the source database. Now we will create the snapshot of this report so that snapshot of this report should have data up to this specific time only.

                I.        For creating a Report Snapshot, go to the report, click on drop button over the report and select Manage :

              II.        Click on Report History and then click on New Snapshot:

             III.        It will create the report snapshot with time stamp:


            IV.        Go to Processing option and select “Render this report from a report snapshot”:

              V.        Now run the report to ensure report is working fine:
  Report is working fine with Report Snapshot.

            VI.        Report Dataset definition is selecting all the data from Population table:
                   
  
           VII.        To test report snapshot, we will add some data to source table. Initially, we have 10 records in the Population table so report is showing 10 records only. Now I have added 5 more records and so table is having total 15 records.
Here we can see 5 new records also.

          VIII.        Now preview the report and see whether you are able to see the new records in the report or not:

Report is showing only old records only. It is not showing latest data from the database because this report is retrieving from the report snapshot that was created before data changes done in DB.

            IX.        Now I am changing the Processing option from Report Snapshot to “Always run this report with most recent data”:
                   
Click Apply.

              X.        Now run the report and see the data. It should display latest data from database:

 So it is concluded that Report snapshot does not display data from data source. it will show report from a snapshot that has been created  at a specific point of time.

5.   How to schedule the report snapshot:

                I.        To create a report snapshot, we can either create a Report specific schedule or Shared schedule.
                       II.        For Report specific schedule, go to the report properties then processing option then select “Render this report from a report snapshot”. Finally select “Report specific schedule”

                   III.        Click on Configure and schedule the report:
Click ok.


            IV.        For shared schedule, go to site setting then Schedule and create a schedule
Map the same shared schedule to report.



6.   Report History

We can see the history to refer old snapshots. To see the history, go to report properties then Report History:

We can directly click on any snapshot to see the report for that specific point of time.

7.   Conclusion

By using the above steps, we can create Report Snapshots.


----------------------------------------------------End of Document---------------------------------------------------