Practicing Safe Source


The Report Designer works with another software tool called Visual SourceSafe (VSS). VSS controls access to source code, such as report definitions. This can prevent two report designers from trying to modify the same report at the same time. Even if you do not have multiple report designers, VSS can provide a consistent location where all your reporting projects can be found. VSS stores all the source code entrusted to its safekeeping in its own library database. If this VSS library database is located on a network, you have a central location where all the source code can be backed up regularly.

VSS has one more valuable feature. It keeps multiple versions of your source code. When you check in your source code, VSS does not write over the previous version. Instead, it keeps both the older version and the new version. You continue to work with the newest version of the source code unless there is a problem and you ask to go back to an earlier version. This can be a lifesaver when you make those massive formatting changes to a report, and then you or your users decide it was better the way it was.

Using Visual SourceSafe

VSS is tightly integrated with the Report Designer. Once VSS is installed and config-ured on your PC, you can probably do almost all your interaction with VSS through the Report Designer menus. We look at adding a reporting project to VSS control, checking reports into and out of VSS, and reverting to an older version of a report.

Adding a Reporting Project to Visual SourceSafe Control

Once VSS is set up on your PC, adding a reporting project to VSS control is simple. Right-click the solution or the project in the Solution Explorer and select Add Solution to Source Control. You are prompted to log in to VSS and to specify the VSS database you want to use. Provide this login information and click OK. You see the Add to SourceSafe Project dialog box displaying the project folder hierarchy in your VSS database. Modify the project name at the top of the dialog box if desired, and then browse to the appropriate location in the project folder hierarchy and click OK.

Check In, Check Out, and Get Latest Version

Once the solution has been added to VSS control, a small lock icon appears next to each entry in the Solution Explorer. This indicates each file is checked into VSS. The local copy of each of these files is marked as read-only. The file cannot be modified until it has been checked out.

To check out a report definition file, right-click the entry for that report in the Solution Explorer and select Check Out from the Context menu. If you choose, you can enter a comment stating why the report is being checked out. The most recent version of the report is then copied from the VSS database to your PC. It is no longer read-only but, instead, is ready to accept changes. The lock icon is replaced by a small check mark in the Solution Explorer to indicate the report is checked out. Only one person may have a report checked out at any given time.

Once you complete your changes to the report definition, you need to check the report back into VSS. Right-click the entry for the report in the Solution Explorer and select Check In from the Context menu. Again, you can enter a comment summarizing the changes you made. This is helpful if you ever have to revert to an older version of a report.

If you want to get the latest version of a report someone else is working on, without checking out the report, you can use the Get Latest Version feature of VSS. Right-click the entry for the report in the Solution Explorer, and then select Get Latest Version from the Context menu. A read-only copy of the latest version of the report is then copied to your PC.

Getting a Previous Version

Retrieving an earlier version of a report from VSS is straightforward. Select the report in the Solution Explorer, and then select File | Source Control | History. The History Options dialog box appears. You can enter a range of dates to see the history of the report within that date range. You can also enter a user to see the versions checked in by that user. To see the entire history of the report, leave everything blank and click OK.

The History Of dialog box appears. Here, you can scroll through the previous versions of the report. Click Get to retrieve a copy of a previous version. This previous version then becomes your current copy of the report. Any previous versions of the report checked in after the version you just retrieved continue to reside in the VSS database. Click Rollback to retrieve a copy of a previous version and to delete any versions of the report that were checked in after the version you just retrieved.




Microsoft SQL Server 2005 Reporting Services
MicrosoftВ® SQL Server(TM) 2005 Reporting Services Step by Step (Step by Step (Microsoft))
ISBN: 0735622507
EAN: 2147483647
Year: 2007
Pages: 115

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net