Saturday, March 17, 2012

SQL Server Reporting Services (SSRS) - Deployment

Deploy Reports

Overview

In  the prior sections we used Business Intelligence Development Studio (BIDS) to create some sample reports. BIDS has a preview capability which allowed us to render our report in the development environment. When we have completed a report we need tp deploy it so  that other users can runit.

In this section we  will show how to deploy reports using the following methods:

  • Business Intelligence Development Studio
  • Report Manager 
In SQL Server 2005 Reporting Services you could also use  SQL Server Management Studio to depploy reports.This functionality has  been  removed in SQL Server 2008.

You can deploy reports to a Sharepoint document library when you configure Reporting Services in Sharepoint Integration mode.We are not covering Sharepoint Integration in this tutorial.

Now let's continue on the next section to see how to deploy from BIDS.

BIDS

overview

BIDS provides the capability to deploy reports.This is very convinient since we use BIDS to design, develop and test our reports.In this section we will walk through report deployment uing BIDS.

Explanation
n order to deploy reports and data sources using BID,we need to specify some project settings. Right click on the project name in the Slution Explorer then select properties from the popup menu; you will see the dialog as shown below:
The following is a description of deployment settings:
  • OverwriteDataSources - SpecifyTrue or Flase;When you deploy using BIDS you probably want to choose False so that if the Data Sources already exists on the deployment target it does not get overwritten. The reasoning is that the connection strings in your development environment are probably different that your target deployment server.
  • TargetDataSourceFolder - the name of the folder  where you ant to  deploy your data sources; the default value is datasources.
  • TargetReportFolder - the name of the folder where you  want to deploy your reports.The default value is  the name of your project.
  • TargetServerURL - the URL of your deployment report server; use the format http://SERVERNAME/reportserver where SERVERNAME is the name of the server where you installed Reporting Services.  "reportserver" is the default name; if you manually configured Reporting Services using the Reporting Services Configuration Manager then specify the name you used for the report server.
Deploying to http://sql2008test/reportserver
Deploying data source '/Data Sources/AdventureWorksLT'.
Warning : Cannot deploy data source AdventureWorksLT to 
the server because it already exists and OverwriteDataSources 
is not specified.
Deploying report '/SSRS 2008 Tutorial/ReportDesignerExample'.
Deploy complete -- 0 errors, 1 warnings
== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==
== Deploy: 1 succeeded, 0 failed, 0 skipped ==

After a successful deployment of our sample project, you will see the following on the Report Manager home page:
To navigate to the Report Manager use the URL http://SERVERNAME/reports; if you manually  configured Reporting Services using the Reporting Services Configuration Manager  then specify the name you used for the Report Manager, You can click on  the Data Sources or SSRS Tutorials folders to  see the  data source or the reports.
Now let's continue on to the next sectionto see how to deploy reports  using the Report Manager.

Report Manager

overview
Report Manager is the web-based application included wit Reporting Services that handles all aspects of managing reports.In this section we will walk through  report deployment using the Report Manager.

Explanation
If you can deploy data sources and reports with BIDS, then why bother with using Report Manager? Probably the best answer is that  those who develop reports may not have the necessary  permissions to deploy those reports  to the production server.When a report is ready for deployment, you man need to hand if off to a person who has the  permissions to deploy to the production server ans that person doesn't want to use BIDS.  Most admins are not developers and why they want is  the ability  to script out deployments or atleast use a tool that isn't developer-centric. Report Manager provides the capability to deploy  data sources and reports by using  a simple browsr-based interface.
To begin navigate to the Report Manager home by opening your browser and typing in the URL; e.g. http://SERVERNAME/reports, where SERVERNAME is the server where the Report manager is deployed. If you are working in your development environment and allowed the SQL Server installer to install and configure Reporting Services then you can use localhost as your SERVERNAME. After navigating to the Report Manager home you will see the following:


The folders shown in the above screen shot were created in the previous section where we discussed deploying data sources and reports using BIDS. Recall that the Reporting Services project has deployment settings which determine the folders for deploying data sources and reports. To deploy using the Report Manager we would create folders for our data sources and reports as shown above by clicking the New Folder button. Navigate to the new folder by clicking on it, then click the Upload File button to upload either a data source or a report.

When you click the New Folder button, the following dialog will be displayed:
Fill in the Name textbox; e.g. Report Manager Deployment Example and click OK. The Report Manager now displays the new folder:

Click on the Report Manager Deployment Example hyperlink to navigate to the folder. We are going to create a new data source and upload a report.
Typically when you deploy your data sources, the settings will be different than what you have in your development environment. Click the New Data Source button to create and configure your data source as follows:
The following are the main points about creating a data source:
• You have to enter the connection string; there is no helper dialog
• The Connect using option selected is Windows integrated security; this means the report executes using the Windows credentials of the caller; the caller must have at least read permission on the database
• The Credential stored securely in the report server option along with checking Use as Windows credentials when connecting to the data source is a good choice when you don't want to give the users running the report read permission on the database; rather you specify User name as DOMAIN\USERNAME and give just that account read permission on the database
After clicking OK to finish creating your data source, click the Upload File button to deploy a report. Fill in the dialog as shown below by navigating to the report that you want to deploy. I navigated to the folder where our BIDS project was saved and picked the file ReportDesignerExample.rdl (reports are stored in XML files with a .RDL extension):

After clicking OK to deploy the report, you can click on the report in the Report Manager to render it as shown below:


Configure Report Manager Security
Overview
Reporting Services implements a role-based security model that leverages the underlying Windows security model for authentication and authorization. You can administer Reporting Services security by using the Report Manager. By default only local administrators will have access to the Report Manager; you have to grant access to other users. There are two aspects to security: site settings and item level settings.
Now let's continue on to the next section to see how to configure site settings in Report Manager.
Site Settings
Overview
The first step in implementing Reporting Services security is to specify Site Settings. As the name implies Site Settings have to do with securing the Report Manager. We'll cover item level security in the next section where we talk about securing folders, reports, and data sources.
Explanation
To begin open your browser and launch the Report Manager. By default the Report Manager URL is http://SERVERNAME/reports unless you changed it by manually configuring Reporting Services. You will see the Report Manager home page as shown below:

Note in the upper right hand corner the Site Settings hyperlink; click it to navigate to the Site Settings page then click the Security hyperlink; the Site Settings Security page will be displayed as shown below:


Site settings offer two roles: System Administrator and System User. The default installation and configuration of Reporting Services adds the local administrators group to the System Administrator role. You can add any user or group that you want to administer the Report Manager to the System Administrator role. Any user or group that you want to allow access to the Report Manager content, you add them to the System User role. Click on the New Role Assignment button to display the New System Role Assignment page as shown below:


Fill in a user name or group using the format DOMAIN\USERNAME or DOMAIN\GROUPNAME. If your Reporting Services installation is on a stand-alone server (i.e. not a member of a domain) then substitute MACHINENAME for DOMAIN. Check the appropriate box to add the group or user to the System Administrator or System User role. Sometimes you may want to add the domain group Authenticated Users to the System User role; you still have to provide item level security settings which we will cover in the next section.

Item Level Settings
Overview
The second step in implementing Reporting Services security is to specify Item Level Settings. As the name implies Item Level Settings have to do with securing folders, reports, and data sources.
Explanation
To begin open your browser and launch the Report Manager. By default the Report Manager URL is http://SERVERNAME/reports unless you changed it by manually configuring Reporting Services. You will see the Report Manager home page as shown below:


Click the Properties hyperlink to navigate to the Security page as shown below:


Note that the local administrators group is already added to the Content Manager role; this is done by default. Click on the New Role Assignment button to display the New Role Assignment page as shown below:


There are a number of built-in roles available for item level security as shown above. The description provides the details of what each role is able to do. Wherever possible it's a good idea to assign role(s) to Windows groups rather than individual users. Specify the group as DOMAIN\GROUP or an individual user as DOMAIN\USER then check the appropriate role(s). If you want a group or a user to just be able to run reports, assign them to the Browser role.
When you create new folders in the Report Manager, they will automatically inherit the item level security settings of the parent folder. When you navigate to a folder, click on the Properties tab then click the Security hyperlink, you will see an Edit Item Security button. If you click Edit Item Security you will be asked whether to override the security as specified in the parent folder.
Typically setting item level security at the folder level is good enough. However you can set security at the individual item level. Navigate to the desired folder as shown below:

Click the Show Details button to display the detailed view as shown below:

Click the icon in the Edit column for an item then click the Security hyperlink on the Properties page; you will see the Security page as shown below:

Click the Edit Item Security button to override the security settings if necessary.