NA2009_ENUS_BIIP_05
NA2009_ENUS_BIIP_05
Introduction
This chapter outlines the architecture of Reporting Services and describes how to
configure Reporting Services in Microsoft® SQL Server® 2005.
The example used in this chapter demonstrates how to create a report definition
language (RDL) report using Microsoft SQL Server Business Intelligence
Development Studio, and how it can be deployed. The example is based on the
database configured in Chapter 3, "Configuring a BA Database in Microsoft
Dynamics NAV."
NOTE: Microsoft SQL Server 2005 is used throughout this chapter, but the latest
version supported is Microsoft SQL Server 2008.
The chapter also provides a general review of the Microsoft SQL Server
Reporting Services functionality based on a level that is sufficient for designing a
report. Microsoft SQL Server Business Intelligence Development Studio is used
for business intelligence purposes as an alternative to other online analytical
processing (OLAP) client applications such as Business Analytics for Microsoft
Dynamics NAV or Microsoft® Office Excel®.
If Microsoft SQL Server Reporting Services is being used, for more details and
depending on the version of the Microsoft SQL Server installed, refer to either
"Course 2793A: Implementing and Maintaining Microsoft SQL Server 2005
Reporting Services" or "Course 6236A: Implementing and Maintaining
Microsoft SQL Server 2008 Reporting Services."
Users can interact with the Report Server Web service directly, or instead use
Report Manager, a Web-based application that interfaces with the Report Server
Web service. With Report Manager, users can view, subscribe to, and manage
RDL reports (files in the XML format that are created according to the report
definition language standards and can be viewed by any application that supports
this standard). Users can also manage and maintain data sources and security
settings. Reports can be delivered through the use of e-mail, placed on a file
system, or printed out as a hard copy. Security is role-based and can be assigned
on an individual item, such as a report or data source, a folder of items, or site
wide. Security roles and rights are inherited and can be overloaded.
In addition to using the standalone report server that comes with Microsoft SQL
Server, RDL reports can also be viewed using the ASP.NET ReportViewer Web
control or the ReportViewer Windows Forms control. This allows reports to be
embedded directly into Web pages or .NET Windows applications. The
ReportViewer control processes reports in one of the following ways:
Microsoft SQL Server Reporting Services also supports ad hoc reports: the
designer develops a report schema and deploys it on the reporting server, where
the user can choose relevant fields/data and generate reports. Users can then
download the reports locally.
1. Go to Start > All Programs > Microsoft SQL Server 2005 >
Configuration Tools > Reporting Services Configuration to run
the Reporting Services Configuration Manager.
2. In the Report Server Installation Instance Selection dialog box,
fill in the fields as follows:
Field Description
Machine Leave the default name.
Name
Instance Name Leave the default name, or if a different server
instance is installed, select the name of that instance
by clicking the AssistButton next to the field and
selecting the name from the list.
3. Click Connect.
Now specify a virtual directory for the report server. The virtual directory is a
part of the URL used to access the report server Web service. To configure a
virtual directory, use the following procedure:
Field Description
Website Leave the default name or select a Web site by
clicking the AssistButton next to the field.
Virtual Leave the default name or enter a directory name.
Directory
4. Click OK.
To configure a virtual directory for accessing Report Manager, use the following
procedure:
Field Description
Website Leave the default name or select a Web site by
clicking the AssistButton next to the field.
Virtual Leave the default name or enter a directory name.
Directory
4. Click OK.
Both the report server and report manager virtual directories must be created
under an existing Web site. You can use the default Web site or a custom Web
site. The same Web site can be used for both virtual directories. There are no
special requirements for the Web site. All security, ASP.NET, paths,
permissions, and other settings are configured for the virtual directories.
To specify under which account the Report Server Windows service runs, use the
Windows Service Identity page in the Reporting Service Configuration
Manager window. You can choose a built-in or Windows account.
If choosing a built-in account, choose one that can make network connections.
SQL Server 2005 uses domain accounts as service account defaults.
If using Microsoft® Windows® Server 2003, you can use Network Service.
Using Local System is not recommended. It has more permissions than the
service requires.
Local Service will not work in most scenarios. Avoid using this built-in account
unless all client and server operations are performed exclusively on the local
computer.
To create and configure the report server databases that provides internal storage
for one or more report server instances, use the Database Setup page in the
Reporting Service Configuration Manager window.
1. In the New Application Pool dialog box, fill in the fields as follows:
Field/Button Description
Server Name Specify the name of the SQL Server database engine that runs
the report server database and click Connect to log on to the
SQL Server database engine. The SQL Server Connection
dialog box opens so that you can specify credentials used to
log on to the server.
Field/Button Description
Database Specify the name of the report server database that stores the
name server data. You can specify an existing database or create a
new database.
Select an existing database if upgrading or migrating to a
Reporting Services installation. Only databases that contain
the report server tables are available for selection.
If choosing a report server database that was created using the
SQL Server 2000 version of Reporting Services, you can
upgrade the database to the new format. Perform the following
actions next to the Database Name field:
• Click New to create a new database on the SQL Server
instance to which you are currently connected
• Click Upgrade to migrate the tables to the new database
schema. Upgrading the database is required if you want to
use it with a SQL Server 2005 Reporting Services
instance.
Credentials Specify credentials that the report server uses to connect to the
Type report server database.
Account Specify a domain user account if you are using Windows
Name credentials or a SQL Server login if you are using SQL Server
credentials. If using Windows credentials, specify them in this
format: <domain>\<account>
Password Specify the password for the account.
Script Click Script to create SQL script (.sql) files for future use in a
scripted environment. You can create scripts to create and
upgrade a report server database to the current schema. You
can also create and run a script that configures the SQL Server
database roles for the account(s) used to connect to the report
server database.
Reports are published to a report server as report definition (.rdl) files. Because a
report definition is an XML document, you can create and edit reports using
other tools besides the Report Designer. You can edit a report definition using a
text editor or a third-party tool that is designed for editing reports that are written
in the Report Definition Language (RDL). Report Designer uses the Reporting
SOAP API to publish reports to a report server. If you use another tool to create
.rdl files that does not publish reports directly to a report server, reports can be
uploaded using the Report Manager.
Now, create a report using the Report Wizard for the scenario from the
Configuring Business Analytics Database in Microsoft Dynamics NAV.
Because it is a simple report, Ronald creates a new report using the Report
Designer.
To create a new report in Microsoft Visual Studio, use the following procedure:
7. Click Next.
FIGURE 5.3 THE SELECT THE DATA SOURCE PAGE OF THE REPORT
WIZARD
8. On the Select the Data Source page, click New Data Source, enter
a name for the data source, select the data type Microsoft SQL
Server Analysis Services, and then enter the connection string for
the data source.
9. To build the connection string, click Edit. The Connection
Properties window opens:
When you click the Query Builder button, the Query Builder window opens.
The Query Builder contains functionality similar to the cube browser of
Microsoft SQL Server Management Studio described in Chapter 4, "Processing
Cubes in Analysis Services Using Microsoft SQL Server Management Studio."
14. Open the Sales and Purchase Efficiency cube (the virtual cube that
is created in Chapter 3, "Configuring a BA Database in Microsoft
Dynamics NAV").
15. Drag the Amount, Quantity and Unit Cost _LCY_ measures from the
SalesInvoiceLine measure group and Gross Margin calculated
measure to the Data pane.
17. Drag the Customer and Sales Invoice Line No_ dimensions to the
Drop Row Fields Here area in the Data pane, and the Posting Date
and the Currency dimensions to the Drop Filter Fields Here area in
the Data pane.
NOTE: Selecting the Matrix option produces a report with data arranged in a
matrix, or crosstab.
Options Description
Stepped Create a report that contains one column for each field,
with group fields appearing in group headers to the left
of the detail field columns. This type of table does not
have group footers
Block Create a report that contains one column for each field,
with group fields appearing in the first detail row for
each group. This type of table has group footers only if
Include subtotals is also selected.
Include Choose this option to include a subtotal for the numeric
subtotals fields in the report. If Stepped is selected, the subtotal is
placed in the group header rows. If Block is selected, the
subtotal appears in the group footer rows.
Enable Choose this option to hide the inner groups of the report,
drilldown and enable a visibility toggle, resulting in a drilldown
report.
You can also click the Preview tab to preview the report:
You must have permission to publish a report. The ability to add content to a
report server is determined through role-based security that is defined by your
report server administrator. Publishing operations are typically granted through
the Publisher role.
You can also add more configurations in the Property Pages window. To open
the window, right-click the project name in the Solution Explorer and select
Properties. For example, you can add a configuration that publishes reports to a
test server as follows.
Property Description
StartItem A debug property that contains the name of the report to
display in the preview window or in a browser window when
the report project is run.
OverwriteDat A deployment property that indicates whether to overwrite an
aSources existing data source on the server. Set this property to False if
you do not want to overwrite the existing data source. Set it
to True to republish the data source information to the server.
Property Description
TargetDataSo The name of the folder in which to store the published shared
urceFolder data sources. If you do not specify a folder, the data source is
published to the same folder as the report. If the folder does
not exist on the report server, the Report Designer creates the
folder when the reports are published.
When publishing to a report server that is running in the
native mode, specify the full path of the folder hierarchy
starting at the root. For example, Folder1/Folder2/Folder3.
When publishing to a report server that is running in the
SharePoint integrated mode, use a URL to the SharePoint
library. For example,
http://<servername>/<site>/Documents/MyFolder.
TargetReportF The name of the folder in which to store the published
older reports. By default, this is the name of the report project. If
the folder does not exist on the report server, the Report
Designer creates the folder when the reports are published.
When publishing to a report server that is running in the
native mode, specify the full path of the folder hierarchy
starting at the root. If a folder is located within another
folder, include the path to the folder that starts at the root. For
example, Folder1/Folder2/Folder3.
When publishing to a report server that is running in the
SharePoint integrated mode, use a URL to SharePoint library.
For example,
http://<servername>/<site>/Documents/MyFolder.
TargetServer A debug property that contains the name of the report to
URL display in the preview window or in a browser window when
the report project is run.
Make sure the Build and Deploy check boxes are selected.
These two properties determine how the Report Designer runs a report project.
All project properties can be accessed through the project property pages. To
access these properties, in Solution Explorer, right-click the report project and
then click Properties. To open Configuration Manager, click Configuration
Manager.
Setting Result
Build Yes - The Report Designer builds the report project and reports
errors in the Task List window.
No - The Report Designer does not build the project; errors are
only detected by the report server or preview process.
Deploy Yes - The reports in the project are published to the report server
as defined in the Deployment properties for the project.
No - The Report Designer displays the report in a local preview
window.
To build and deploy the report in a project, click Debug > Start Debugging or
press F5.
When a report is published to a report server, you can use the Report Manager,
SharePoint Web parts, or a browser to view it. All reports that you open from the
report server open in an HTML viewer that provides page navigation and other
functionality that is useful for working with the report. To view reports that are
delivered to a shared folder, use the desktop application that corresponds to the
file type created during report delivery.
NOTE: The report toolbar also appears in a browser window at the top of a
report when accessing reports through a URL.
Summary
Microsoft SQL Server Reporting Services is a free application that comes with
Microsoft SQL Server. It is a repository for reports created in Microsoft Visual
Studio which are then published to this repository. Applications windows and
Web applications are then used to send requests to this repository and retrieve the
report in a window or Internet browser. Complex reports can be created to show
different charts and graphs; which makes Reporting Services a good tool to use
in Intranet Web applications.
3. What are the three ways to create a report in the Report Designer? (Select all
that apply)
( ) Creating a blank report, manually adding queries, and specifying the
layout.
( ) Importing a report from Microsoft Dynamics NAV.
( ) Importing a report from Microsoft Office Access.
( ) Using the Report Wizard.
Scenario
Kevin, the Sales Manager, wants to analyze the liquid ratio by measuring the
liquidity and ability of his company to meet its obligations on a national scale.
Meaning, Kevin wants to analyze whether the receivables from the domestic
debtors can cover the payables to the domestic creditors.
Challenge Yourself!
Create a report named Payables/Receivables and deploy it on a report server.
Step by Step
1.
2.
3.
Solutions
Test Your Knowledge
1. Which of the following features does Microsoft SQL Server Reporting
Services provide? (Select all that apply)
( ) Datamining
(√) Publishing reports to a report server
( ) Administering through a windows application
(√) Viewing reports through a Web interface
MODEL ANSWER:
3. What are the three ways to create a report in the Report Designer? (Select all
that apply)
(√) Creating a blank report, manually adding queries, and specifying the
layout.
( ) Importing a report from Microsoft Dynamics NAV.
(√) Importing a report from Microsoft Office Access.
(√) Using the Report Wizard.