Академический Документы
Профессиональный Документы
Культура Документы
10990B
Analyzing Data with SQL Server Reporting
Services
MCT USE ONLY. STUDENT USE PROHIBITED
ii Analyzing Data with SQL Server Reporting Services
Information in this document, including URL and other Internet Web site references, is subject to change
without notice. Unless otherwise noted, the example companies, organizations, products, domain names,
e-mail addresses, logos, people, places, and events depicted herein are fictitious, and no association with
any real company, organization, product, domain name, e-mail address, logo, person, place or event is
intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the
user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in
or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical,
photocopying, recording, or otherwise), or for any purpose, without the express written permission of
Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property
rights covering subject matter in this document. Except as expressly provided in any written license
agreement from Microsoft, the furnishing of this document does not give you any license to these
patents, trademarks, copyrights, or other intellectual property.
The names of manufacturers, products, or URLs are provided for informational purposes only and
Microsoft makes no representations and warranties, either expressed, implied, or statutory, regarding
these manufacturers or the use of the products with any Microsoft technologies. The inclusion of a
manufacturer or product does not imply endorsement of Microsoft of the manufacturer or product. Links
may be provided to third party sites. Such sites are not under the control of Microsoft and Microsoft is not
responsible for the contents of any linked site or any link contained in a linked site, or any changes or
updates to such sites. Microsoft is not responsible for webcasting or any other form of transmission
received from any linked site. Microsoft is providing these links to you only as a convenience, and the
inclusion of any link does not imply endorsement of Microsoft of the site or the products contained
therein.
© 2016 Microsoft Corporation. All rights reserved.
Released: 10/2016
MCT USE ONLY. STUDENT USE PROHIBITED
MICROSOFT LICENSE TERMS
MICROSOFT INSTRUCTOR-LED COURSEWARE
These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its
affiliates) and you. Please read them. They apply to your use of the content accompanying this agreement which
includes the media on which you received it, if any. These license terms also apply to Trainer Content and any
updates and supplements for the Licensed Content unless other terms accompany those items. If so, those terms
apply.
BY ACCESSING, DOWNLOADING OR USING THE LICENSED CONTENT, YOU ACCEPT THESE TERMS.
IF YOU DO NOT ACCEPT THEM, DO NOT ACCESS, DOWNLOAD OR USE THE LICENSED CONTENT.
If you comply with these license terms, you have the rights below for each license you acquire.
1. DEFINITIONS.
a. “Authorized Learning Center” means a Microsoft IT Academy Program Member, Microsoft Learning
Competency Member, or such other entity as Microsoft may designate from time to time.
b. “Authorized Training Session” means the instructor-led training class using Microsoft Instructor-Led
Courseware conducted by a Trainer at or through an Authorized Learning Center.
c. “Classroom Device” means one (1) dedicated, secure computer that an Authorized Learning Center owns
or controls that is located at an Authorized Learning Center’s training facilities that meets or exceeds the
hardware level specified for the particular Microsoft Instructor-Led Courseware.
d. “End User” means an individual who is (i) duly enrolled in and attending an Authorized Training Session
or Private Training Session, (ii) an employee of a MPN Member, or (iii) a Microsoft full-time employee.
e. “Licensed Content” means the content accompanying this agreement which may include the Microsoft
Instructor-Led Courseware or Trainer Content.
f. “Microsoft Certified Trainer” or “MCT” means an individual who is (i) engaged to teach a training session
to End Users on behalf of an Authorized Learning Center or MPN Member, and (ii) currently certified as a
Microsoft Certified Trainer under the Microsoft Certification Program.
g. “Microsoft Instructor-Led Courseware” means the Microsoft-branded instructor-led training course that
educates IT professionals and developers on Microsoft technologies. A Microsoft Instructor-Led
Courseware title may be branded as MOC, Microsoft Dynamics or Microsoft Business Group courseware.
h. “Microsoft IT Academy Program Member” means an active member of the Microsoft IT Academy
Program.
i. “Microsoft Learning Competency Member” means an active member of the Microsoft Partner Network
program in good standing that currently holds the Learning Competency status.
j. “MOC” means the “Official Microsoft Learning Product” instructor-led courseware known as Microsoft
Official Course that educates IT professionals and developers on Microsoft technologies.
k. “MPN Member” means an active Microsoft Partner Network program member in good standing.
MCT USE ONLY. STUDENT USE PROHIBITED
l. “Personal Device” means one (1) personal computer, device, workstation or other digital electronic device
that you personally own or control that meets or exceeds the hardware level specified for the particular
Microsoft Instructor-Led Courseware.
m. “Private Training Session” means the instructor-led training classes provided by MPN Members for
corporate customers to teach a predefined learning objective using Microsoft Instructor-Led Courseware.
These classes are not advertised or promoted to the general public and class attendance is restricted to
individuals employed by or contracted by the corporate customer.
n. “Trainer” means (i) an academically accredited educator engaged by a Microsoft IT Academy Program
Member to teach an Authorized Training Session, and/or (ii) a MCT.
o. “Trainer Content” means the trainer version of the Microsoft Instructor-Led Courseware and additional
supplemental content designated solely for Trainers’ use to teach a training session using the Microsoft
Instructor-Led Courseware. Trainer Content may include Microsoft PowerPoint presentations, trainer
preparation guide, train the trainer materials, Microsoft One Note packs, classroom setup guide and Pre-
release course feedback form. To clarify, Trainer Content does not include any software, virtual hard
disks or virtual machines.
2. USE RIGHTS. The Licensed Content is licensed not sold. The Licensed Content is licensed on a one copy
per user basis, such that you must acquire a license for each individual that accesses or uses the Licensed
Content.
2.1 Below are five separate sets of use rights. Only one set of rights apply to you.
2.2 Separation of Components. The Licensed Content is licensed as a single unit and you may not
separate their components and install them on different devices.
2.3 Redistribution of Licensed Content. Except as expressly provided in the use rights above, you may
not distribute any Licensed Content or any portion thereof (including any permitted modifications) to any
third parties without the express written permission of Microsoft.
2.4 Third Party Notices. The Licensed Content may include third party code tent that Microsoft, not the
third party, licenses to you under this agreement. Notices, if any, for the third party code ntent are included
for your information only.
2.5 Additional Terms. Some Licensed Content may contain components with additional terms,
conditions, and licenses regarding its use. Any non-conflicting terms in those conditions and licenses also
apply to your use of that respective component and supplements the terms described in this agreement.
a. Pre-Release Licensed Content. This Licensed Content subject matter is on the Pre-release version of
the Microsoft technology. The technology may not work the way a final version of the technology will
and we may change the technology for the final version. We also may not release a final version.
Licensed Content based on the final version of the technology may not contain the same information as
the Licensed Content based on the Pre-release version. Microsoft is under no obligation to provide you
with any further content, including any Licensed Content based on the final version of the technology.
b. Feedback. If you agree to give feedback about the Licensed Content to Microsoft, either directly or
through its third party designee, you give to Microsoft without charge, the right to use, share and
commercialize your feedback in any way and for any purpose. You also give to third parties, without
charge, any patent rights needed for their products, technologies and services to use or interface with
any specific parts of a Microsoft technology, Microsoft product, or service that includes the feedback.
You will not give feedback that is subject to a license that requires Microsoft to license its technology,
technologies, or products to third parties because we include your feedback in them. These rights
survive this agreement.
c. Pre-release Term. If you are an Microsoft IT Academy Program Member, Microsoft Learning
Competency Member, MPN Member or Trainer, you will cease using all copies of the Licensed Content on
the Pre-release technology upon (i) the date which Microsoft informs you is the end date for using the
Licensed Content on the Pre-release technology, or (ii) sixty (60) days after the commercial release of the
technology that is the subject of the Licensed Content, whichever is earliest (“Pre-release term”).
Upon expiration or termination of the Pre-release term, you will irretrievably delete and destroy all copies
of the Licensed Content in your possession or under your control.
MCT USE ONLY. STUDENT USE PROHIBITED
4. SCOPE OF LICENSE. The Licensed Content is licensed, not sold. This agreement only gives you some
rights to use the Licensed Content. Microsoft reserves all other rights. Unless applicable law gives you more
rights despite this limitation, you may use the Licensed Content only as expressly permitted in this
agreement. In doing so, you must comply with any technical limitations in the Licensed Content that only
allows you to use it in certain ways. Except as expressly permitted in this agreement, you may not:
• access or allow any individual to access the Licensed Content if they have not acquired a valid license
for the Licensed Content,
• alter, remove or obscure any copyright or other protective notices (including watermarks), branding
or identifications contained in the Licensed Content,
• modify or create a derivative work of any Licensed Content,
• publicly display, or make the Licensed Content available for others to access or use,
• copy, print, install, sell, publish, transmit, lend, adapt, reuse, link to or post, make available or
distribute the Licensed Content to any third party,
• work around any technical limitations in the Licensed Content, or
• reverse engineer, decompile, remove or otherwise thwart any protections or disassemble the
Licensed Content except and only to the extent that applicable law expressly permits, despite this
limitation.
5. RESERVATION OF RIGHTS AND OWNERSHIP. Microsoft reserves all rights not expressly granted to
you in this agreement. The Licensed Content is protected by copyright and other intellectual property laws
and treaties. Microsoft or its suppliers own the title, copyright, and other intellectual property rights in the
Licensed Content.
6. EXPORT RESTRICTIONS. The Licensed Content is subject to United States export laws and regulations.
You must comply with all domestic and international export laws and regulations that apply to the Licensed
Content. These laws include restrictions on destinations, end users and end use. For additional information,
see www.microsoft.com/exporting.
7. SUPPORT SERVICES. Because the Licensed Content is “as is”, we may not provide support services for it.
8. TERMINATION. Without prejudice to any other rights, Microsoft may terminate this agreement if you fail
to comply with the terms and conditions of this agreement. Upon termination of this agreement for any
reason, you will immediately stop all use of and delete and destroy all copies of the Licensed Content in
your possession or under your control.
9. LINKS TO THIRD PARTY SITES. You may link to third party sites through the use of the Licensed
Content. The third party sites are not under the control of Microsoft, and Microsoft is not responsible for
the contents of any third party sites, any links contained in third party sites, or any changes or updates to
third party sites. Microsoft is not responsible for webcasting or any other form of transmission received
from any third party sites. Microsoft is providing these links to third party sites to you only as a
convenience, and the inclusion of any link does not imply an endorsement by Microsoft of the third party
site.
10. ENTIRE AGREEMENT. This agreement, and any additional terms for the Trainer Content, updates and
supplements are the entire agreement for the Licensed Content, updates and supplements.
12. LEGAL EFFECT. This agreement describes certain legal rights. You may have other rights under the laws
of your country. You may also have rights with respect to the party from whom you acquired the Licensed
Content. This agreement does not change your rights under the laws of your country if the laws of your
country do not permit it to do so.
13. DISCLAIMER OF WARRANTY. THE LICENSED CONTENT IS LICENSED "AS-IS" AND "AS
AVAILABLE." YOU BEAR THE RISK OF USING IT. MICROSOFT AND ITS RESPECTIVE
AFFILIATES GIVES NO EXPRESS WARRANTIES, GUARANTEES, OR CONDITIONS. YOU MAY
HAVE ADDITIONAL CONSUMER RIGHTS UNDER YOUR LOCAL LAWS WHICH THIS AGREEMENT
CANNOT CHANGE. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT AND
ITS RESPECTIVE AFFILIATES EXCLUDES ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
14. LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. YOU CAN RECOVER FROM
MICROSOFT, ITS RESPECTIVE AFFILIATES AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP
TO US$5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL,
LOST PROFITS, SPECIAL, INDIRECT OR INCIDENTAL DAMAGES.
It also applies even if Microsoft knew or should have known about the possibility of the damages. The
above limitation or exclusion may not apply to you because your country may not allow the exclusion or
limitation of incidental, consequential or other damages.
Please note: As this Licensed Content is distributed in Quebec, Canada, some of the clauses in this
agreement are provided below in French.
Remarque : Ce le contenu sous licence étant distribué au Québec, Canada, certaines des clauses
dans ce contrat sont fournies ci-dessous en français.
EXONÉRATION DE GARANTIE. Le contenu sous licence visé par une licence est offert « tel quel ». Toute
utilisation de ce contenu sous licence est à votre seule risque et péril. Microsoft n’accorde aucune autre garantie
expresse. Vous pouvez bénéficier de droits additionnels en vertu du droit local sur la protection dues
consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties
implicites de qualité marchande, d’adéquation à un usage particulier et d’absence de contrefaçon sont exclues.
EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous pourriez avoir d’autres droits
prévus par les lois de votre pays. Le présent contrat ne modifie pas les droits que vous confèrent les lois de votre
pays si celles-ci ne le permettent pas.
Acknowledgements
Microsoft Learning would like to acknowledge and thank the following for their contribution towards
developing this title. Their effort at various stages in the development has ensured that you have a good
classroom experience.
Ed Harper is a database developer specializing in Microsoft SQL Server. Ed has worked with SQL Server
since 1999, and has developed and designed transaction-processing and reporting systems for cloud
security, telecommunications, and financial services companies.
Contents
Module 1: Introduction to Business Intelligence and Data Modeling
Module Overview 1-1
Lab A: Create and Publish Reports That Include Parameters with Report
Designer 4-22
Lab B: Create and Publish Reports That Include Parameters with Report Builder 4-28
Module 4 Lab B: Create and Publish Reports That Include Parameters with
Report Builder L04-9
Course Description
Note: This is the second (B) release of this course. It replaces the A release. This release is
built using the RTM version of SQL Server 2016 and has been updated to reflect changes in the
RTM software.
This three-day instructor-led course teaches students how to implement a SQL Server 2016 Reporting
Services solution for data analysis in an organization. The course discusses how to use the Reporting
Services development tools to create and manage reports and implement self-service BI solutions.
Audience
The primary audience for this course is database professionals who need to fulfil a BI developer role to
create reports. Primary responsibilities will include implementing reports and mobile reports.
The secondary audiences for this course are power information workers.
Student Prerequisites
In addition to their professional experience, students who attend this training should have technical
knowledge equivalent to the following course:
Course Objectives
After completing this course, students will be able to:
Describe key features of data modelling within business intelligence
Describe various report services data sources and how these are configured
Course Outline
The course outline is as follows:
Module 1: ‘Introduction to business intelligence and data modelling’ introduces the key concepts in
business intelligence. Additionally they will learn about the Microsoft BI product suite.
Module 2: ‘Reporting services data’ describes various Report Services data sources and how these are
configured.
Module 3: ‘Implementing reports’ describes how to create reports with report designer or report
builder.
Module 4: ‘Configuring reports’ describes how to configure reports with report builder or report
designer.
Module 5: ‘Creating mobile reports’ describes how to create SQL Server mobile reports.
MCT USE ONLY. STUDENT USE PROHIBITED
ii About This Course
Course Materials
The following materials are included with your kit:
Course Handbook: a succinct classroom learning guide that provides the critical technical
information in a crisp, tightly-focused format, which is essential for an effective in-class learning
experience.
o Lessons: guide you through the learning objectives and provide the key points that are critical to
the success of the in-class learning experience.
o Labs: provide a real-world, hands-on platform for you to apply the knowledge and skills learned
in the module.
o Module Reviews and Takeaways: provide on-the-job reference material to boost knowledge
and skills retention.
Modules: include companion content, such as questions and answers, detailed demo steps and
additional reading links, for each lesson. Additionally, they include Lab Review questions and answers
and Module Reviews and Takeaways sections, which contain the review questions and answers, best
practices, common issues and troubleshooting tips with answers, and real-world issues and scenarios
with answers.
Resources: include well-categorized additional resources that give you immediate access to the most
current premium content on TechNet, MSDN®, or Microsoft® Press®.
Course evaluation: at the end of the course, you will have the opportunity to complete an online
evaluation to provide feedback on the course, training facility, and instructor.
Note: At the end of each lab, you must revert the virtual machines to a snapshot. You can
find the instructions for this procedure at the end of each lab
The following table shows the role of each virtual machine that is used in this course:
Software Configuration
The following software is installed on the virtual machines:
SQL2016
Course Files
The files associated with the labs in this course are located in the D:\Labfiles folder on the 10990B-MIA-
SQL virtual machine.
Classroom Setup
Each classroom computer will have the same virtual machine configured in the same way.
Dual 120-gigabyte (GB) hard disks 7200 RM Serial ATA (SATA) or better
DVD drive
Network adapter
Additionally, the instructor’s computer must be connected to a projection display device that supports
SVGA 1024×768 pixels, 16-bit colors.
MCT USE ONLY. STUDENT USE PROHIBITED
1-1
Module 1
Introduction to Business Intelligence and Data Modeling
Contents:
Module Overview 1-1
Module Overview
Business intelligence (BI) is a term that has become increasingly common in recent years. Along with big
data, data mining, predictive analytics, data science, and data stewards, BI is now very much part of
business vocabulary. Much of the impetus behind this is the need for organizations to cope with ever
increasing datasets. It is now normal to have databases that contain millions of rows, requiring gigabytes,
terabytes, or even petabytes, of storage space. Data is no longer confined to an on-premises server
room—it is hosted in the cloud, feeds are taken from third-party providers, public datasets are freely
available, and social media interactions generate ever-expanding datasets.
Reporting and analysis is certainly not a new concept to business, but the difference between how data
analysis is done today, compared with five or 10 years ago, is immense. Nowadays, organizations need BI
to see not only what has been done in the past, but also more of what is to come. There is now an
overwhelming amount of data to gather and compose into reports. Add to this an increasing need for
data to offer up-to-the-minute numbers, so business can react faster to changing trends in markets and
industries.
Businesses that can react fast and predict near-term trends to provide products and services where there
is consumer demand, have the best chance of survival in our modern and highly competitive world. With
the rise of big data, there is an increasing need for data analysts who can take this data, and find the
critical points within a plethora of information.
Objectives
After completing this module, you will be able to:
Lesson 1
Introduction to Business Intelligence
This lesson introduces you to the concepts that comprise BI. You will explore scenarios for using BI and
how current trends affect the use of BI, along with project roles and data models.
Lesson Objectives
After completing this lesson, you will be able to:
Understand BI scenarios.
See how trends in data and reporting solutions have impacted BI.
Reporting
Extracting data from your company’s database and presenting it in reports is certainly not a new
phenomenon. Most organizations, whatever their size, use some form of reporting, as a reflection of their
performance within their sector. Until recently, most organizations were happy with end-of-month and
annual reports, as a backward reflection of their performance. Modern reporting still needs this, but it
should also look to the future and predict where and how to sell more, thereby increasing turnover and
reducing the bottom line.
Traditionally, reports have been compiled by department heads, and then given to directors to guide their
decision-making. Organizational data, or BI, was the privilege of a few. For example, reports show
metrics—how much did we sell last month? How many new customers have we acquired this year? How
many mentions did our latest promotion receive on social media? A report can provide the answers to
questions that the organization needs to make decisions. Reports can be contained in spreadsheets, or
created using a visual tool, and distributed on a daily, weekly, or other regular schedule. Reflecting on
past performance is a worthwhile task, but modern reports must also predict the future.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 1-3
Analysis
Analysis is the process of evaluating data to find insights. Data analysis should answer questions, and offer
guidance in decision-making. Data is extracted from source, and then cleaned, modeled, and transformed
until it can be appropriately presented in a report. The report can be a simple table in a spreadsheet, or a
visual and dynamic, colorful solution—but how the data is presented affects the analysis and the
conclusions drawn. For example, you can present data in a column chart, but not notice patterns in that
data until you use a different type of chart—such as a map or scatter chart—and discover clusters of
behavior as a result of geographic location, or outliers that are skewing results.
With so much data to analyze, and constant changes in consumer and market trends, modern data has a
limited lifespan. Data quickly becomes outdated, so the process of analysis is ongoing. However, with
bigger data to analyze, more questions can be asked of it. With an increase in publicly available datasets,
including population changes, socioeconomic data, weather patterns, and climate change, corporate data
can be analyzed against a backdrop of relevant statistics.
Collaboration
Data is ubiquitously generated and consumed. It is no longer retained and controlled by a handful of
decision makers in an organization; instead, it is used at all levels, meaning that colleagues can react to
data, and change the course of their work if necessary. Information is critical to companies of all sizes and
across industries, with information workers needing to collaborate, and share data and results. Microsoft
Excel® has long been the dominant tool of the business user—spreadsheets are created, shared,
published, altered, emailed, printed, saved, and distributed without version control, or adherence to
security policies. As spreadsheets are shared and changed, and shared again, analysts work from different
datasets, see different results, and reach different conclusions. To collaborate and work cohesively,
analysts must be able to synchronize their teamwork.
Using a more sophisticated reporting solution generally requires a dedicated report developer, and a
lengthy process to submit a feature requirement to IT, and a wait for the report to be developed and
published—only to find it does not deliver the right data. And so begins another lengthy process of
submitting a change request, and waiting for the report developer to make the changes. Giving users
access to the data means they can see what is available for analysis, and lets them decide what is useful.
The delay in waiting for a report not only frustrates users and holds back their work, but also delays
decision-making and the ability for organizations to react to changing circumstances.
Program/Project Manager
Depending on the scale of the project, either a program or project manager will be assigned to deliver the
successful BI project. They will be responsible for defining the organizational BI strategy and delivery,
often coordinating multiple projects at any one time. While the role is non-technical, it is beneficial to
have an understanding of the subject matter, the business requirements, and the technical terminology.
The main role of a program or project manager includes:
Data Architect
Like the program manager, the data architect may be responsible for multiple projects, combining
business and technical knowledge to shape the BI solutions. The data must be architected and presented
in a design that the organization can understand and derive information from. The main role of the data
architect includes:
Defining and managing master data and liaising with the organization’s data stewards.
Technical Architect
The technical architect must communicate with the BI developers and the operations team to ensure the
BI environment is configured correctly. This role is less hands-on than that of the BI developer, but
requires deep technological understanding. The main role of the technical architect includes:
Deciding on appropriate development technologies, and justifying those decisions to the program
manager.
Designing the architecture of the extract, transform, and load (ETL) processes.
Developing the disaster recovery plan.
Data Steward
Within large organizations, each department should have individuals assigned as data stewards. The data
stewards have a good understanding of the data and how it is used by the business, where it is produced,
and who can access it. Their responsibilities also include:
Ensuring the data is being used consistently in various computer systems.
Defining and enforcing a data management policy—and therefore being responsible for the
definition, management, control, integrity or maintenance of departmental or enterprise data
resources.
End User
End users work closely with business analysts to capture their requirements and make themselves
available to test and shape the reports. The end users will make business decisions based on the reports
delivered by the project. The quality of the delivered reports depends on the project having the correct
level of access to key individuals in the business.
Business Analyst
Business analysts will work closely with the organization’s data stewards, end users and stakeholders to
capture their reporting requirements and document these specifications for the project. They will also be
responsible for:
Working with the architects to translate business requirements into technical specifications.
Working with end users to coordinate prototype reviews and user acceptance.
BI Developer
The BI developer role can comprise ETL, data warehouse (DW), and report development. Depending on
the size of the organization and the structure of the team, one developer may specialize in one aspect, or
may perform one or more roles, but there is likely to be an overlap between at least two. The main role of
a BI developer includes:
Writing ETL packages to load the transformed data into the data warehouse.
Building cubes.
Data Modeling
A data model is a visual representation of how the data will be structured in a database. If the database is
an OLTP database, then the data will be normalized to reduce repeating values, and ensure an entity only
has the attributes that belong to it. This leads to the best performance for random, small, and isolated
transactions. A data warehouse denormalizes the data, so that the database performs optimally for
reporting.
A data model comprises a logical design, and a physical design. There are two approaches to data
modeling: a top-down approach, or a bottom-up approach. In a top-down approach, the model is
created by gaining an understanding of the business requirements. The bottom-up approach creates a
model from existing databases. A model is only a representation of the database, so it will contain objects
such as tables, columns, and relationships that can be visualized. A database developer uses the model to
develop the physical database.
Semantic Models
A semantic model is a data model that includes information to give meaning to the data. The semantic
information should enable the model to describe itself. Semantic models help to create consistency. The
dataset of a semantic model uses inherent structures, whereas in a database, the context of data is defined
through its relationships with other data. Semantic data models give representation to real-world entities
such as a Customer, Store, or Employee. A relational model breaks entities into parts, whereas the
semantic model uses the entity to fully represent itself.
Question: How does your organization approach BI? Is this a major part of the corporate
strategy? What BI solutions does your organization use? What do you think are the major
issues with your organization’s approach to BI?
MCT USE ONLY. STUDENT USE PROHIBITED
1-8 Introduction to Business Intelligence and Data Modeling
Lesson 2
The Microsoft Business Intelligence Platform
The Microsoft BI platform has a wide variety of technologies at both the server and client level. This gives
a high degree of choice and flexibility when planning your solution. At the server level, you can use an
existing SharePoint® deployment or use a report server to host your reports. For data, you might have a
data warehouse, an online analytical processing (OLAP) cube, or a relational database. For clients, you
might use Excel, a web browser, or a mobile device. All of these technologies can be partnered with each
other, resulting in a solution that matches your specific requirements.
Lesson Objectives
After completing this lesson, you will be able to:
Microsoft SQL Server Analysis Services (SSAS) provides multidimensional modeling and data mining
capabilities to gain insights into your data.
You can use Microsoft SQL Server Reporting Services (SSRS) to create and deploy informative and eye-
catching reports for both desktop and mobile consumers. SQL Azure Reporting Services extends this
functionality to the cloud.
Microsoft Office
Microsoft Office Excel is the most widely used analytical tool and provides power users with an ideal
platform to create reports from a wide variety of data.
BI Semantic Models
SSAS has three semantic models for BI,
multidimensional, tabular, and PowerPivot. The
models are not interchangeable, although you can
import a PowerPivot model as a new tabular model.
Therefore, it is important to consider the
advantages and disadvantages of each model
before development.
Multidimensional Models
Multidimensional models use the industry-standard
online analytical processing (OLAP) semantic model.
Multidimensional models consist of cubes and
dimensions that can pre-calculate aggregations and
provide fast query response times, even with one-off queries.
Tabular Models
Tabular models use relational modeling that might be easier to understand for relational database
professionals. The Analysis Services databases either run in-memory or, if the database is too large, use
DirectQuery to fetch data directly from the source relational database.
PowerPivot Models
SQL Server 2016 PowerPivot for SharePoint enables Analysis Services to host PowerPivot data in a
SharePoint farm. This means you can host PowerPivot workbooks on a SharePoint server with an
underlying tabular infrastructure. PowerPivot models are created visually in Excel—which is often the most
intuitive approach— and can be imported as new tabular models in Analysis Services.
For more information about the different semantic models, see MSDN:
SQL Server
SQL Server has three defined roles: database
engine, Analysis Services, and Reporting Services.
These could all run on one single server but, as the
system scales up, they would typically run on
separate servers. Within this, a report server can
either run in stand-alone native mode, or can be
deployed as part of a SharePoint server farm in
SharePoint integrated mode. These scenarios are concerned with producing reports, but there are also
Power BI dashboards.
Power BI
Power BI is a cloud-based service that connects to many data sources, including SQL Server databases and
SSAS, and hosts web-based dashboards that act as reports for users. You could also produce Power BI
dashboards as local files using Power BI Desktop, or create PowerPivot galleries in SharePoint.
Mobile Access
Finally, you should decide whether to support mobile access for reports and dashboards. There are Power
BI apps for the leading mobile operating systems and Reporting Services now has the ability to create
mobile reports that dynamically resize to fit the screen of the viewer’s device.
When considering how to deploy SharePoint and Reporting Services, you should think about how many
servers are available, how much your solution is likely to scale up, and where each service should reside.
It is possible to install SharePoint, the SQL Server database engine, and Analysis Services on one server.
While theoretically possible, this topology is only recommended for testing purposes.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 1-11
Two Servers
In a two-server deployment, one server would have the SharePoint Server with Excel Services, the
PowerPivot service, the Reporting Services service application, and the Reporting Services add-in for
SharePoint. The other server would have the SQL Server database engine and Analysis Services in
SharePoint mode.
Three Servers
In a three-server deployment, one server would be designated as playing the front-end role. It would
therefore host the SharePoint products, including the Reporting Services Add-in. The second server would
be designated as hosting the applications. It would therefore host Reporting Services, Analysis Services,
and Integration Services, along with a SharePoint object model. The final server would be assigned the
database role, and host the SharePoint content and configuration databases, the Reporting Server
database, and connections to any external data sources. The strength of this topology allows each
individual role to have the correct level of system resources. For example, if the number of front-end users
dramatically increases, additional front-end servers and a load balancer could be added to improve
performance.
Demonstration Steps
View Data in a Transact-SQL Query
1. On the taskbar, click Microsoft SQL Server Management Studio.
2. In the Connect to Server dialog box, in the Server name box, type MIA-SQL, in the Authentication
list, click Windows Authentication, and then click Connect.
3. Click the AdventureWorks Sample Reports folder, and then click Sales_Order_Detail.
1. In Internet Explorer, open a new Tab, and in the address bar, type mia-
sql/sites/adventureworks/Reports, and then press Enter.
2. Click Sales_Order_Detail.
4. In the Last Order ID box, type 57033, and then click Apply.
6. Close Internet Explorer and SQL Server Management Studio, without saving any changes.
You are setting up a test system for Reporting Services running on SharePoint-
integrated mode with SSAS as the data provider. What is the minimum number of
servers for this configuration?
5
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 1-13
Lesson 3
Introduction to Reporting Services
Microsoft SQL Server Reporting Services is a highly functional and versatile reporting platform. Reporting
Services is included with SQL Server and means you can extend your database solution to provide
reporting capabilities. Reporting services has multiple installation modes and report authoring tools to
provide a versatile reporting solution.
Lesson Objectives
After completing this lesson, you will be able to:
Scalable
Cloud computing systems are massively scalable. Not only is it straightforward to scale up the virtual
machines and storage to cope with additional demand, but it is also straightforward to scale down the
system to save money when demand is lower.
High Availability
Cloud-based systems run on dedicated server farms with built-in redundancy. This enables extremely high
availability when compared with traditional on-premises solutions and avoids the complexity of managing
complex clustered solutions.
MCT USE ONLY. STUDENT USE PROHIBITED
1-14 Introduction to Business Intelligence and Data Modeling
Disaster Recovery
Azure storage supports geo-replication to multiple data centers around the world; data is stored three
times redundantly in each data center. This would not stop incorrect data in your system; in fact, you
would now have many copies of the incorrect data, but there is also the ability to manage backups in
Azure. Backups can be used traditionally and stored in the cloud or on-premises; Azure SQL database has
the ability to perform point-in-time restores of data.
Security
By storing data in the cloud, there is no risk of lost hardware making sensitive data available. Data is
securely stored and can be accessed by mobile devices that are more portable, more cost effective, and by
those that can be remotely wiped if lost.
Of course, cloud computing is not the best solution in every scenario. You might find it beneficial to use
existing hardware and software with no additional cost to your organization; you might need to store
data on-premises locally to meet data governance requirements; you might be using cloud storage for
backups to provide the benefits of cloud-based disaster recovery for your on-premises solution. The key
thing is that every new solution is evaluated, based on that specific solution.
SQL Server 2016 Reporting Services has features that are only available in Native mode. These are:
Updated web portal. The web portal has been completely updated for SQL Server 2016 Reporting
Services in Native mode. The new web portal is much more informative, intuitive, and graphical. In
Integrated mode, SharePoint provides the web portal.
Mobile reports. Mobile reporting enables reports and key performance indicators (KPIs) that are
configured for mobile devices and that resize, based on the screen dimensions. With the proliferation
of smartphones and tablets, mobile devices are increasingly used as business tools—mobile reporting
makes functional, graphical data available without the need for a laptop or desktop device. Mobile
reporting is not available in Integrated mode.
KPIs. KPIs provide an instant way to view key metrics at a glance. For example, you could use traffic
light KPIs to show green for excellent revenue; amber for acceptable revenue; and red for poor
revenue. You could then investigate detailed reports to understand why a KPI is red, without having
to look through data when the revenue performs at, or at better than, expectations. KPIs are not
available in Integrated mode.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 1-15
Report Designer
Report Designer is part of SQL Server Data Tools
(SSDT), a Microsoft Visual Studio environment.
Report Designer works with both Native mode and
Integrated mode Report Server deployments.
Because the interface is through Visual Studio,
Report Designer is likely to be favored by report
creators who have a background in development,
or who use SSDT for other parts of their role; for example, SQL Server Integration Services (SSIS).
Report Designer has an expression editor to build Visual Basic expressions, and can create custom report
items. These features are not available in Report Builder.
Report Builder
In SQL Server 2016 Reporting Services, Report Builder is approaching functional parity with Report
Designer. Although it doesn’t have an interface to build Visual Basic expressions, it does have all of the
tools to create both data-driven and graphical reports. Because it has an interface that is very similar to
Microsoft Office applications, Report Builder is a suitable tool for report creators who have started
working with data in Excel and now wish to create Reporting Services reports.
End User
Once the data is easily accessible to end users they
will likely need to make amendments,
improvements, and additions to reports. They might also realize that there are further reports that require
development. The end users will probably be creating and editing their reports in Excel. These reports
MCT USE ONLY. STUDENT USE PROHIBITED
1-16 Introduction to Business Intelligence and Data Modeling
may include pivot tables using data stored in pre-existing analysis server-based data cubes, made
available by the BI project.
Data Steward
Data stewards are business area data experts. Within their role they are tasked with ensuring data quality,
and will, therefore, have specific reporting requirements to support their role. They will be seen as the
reporting experts in their respective business areas, and will support end users in locating data, defining
its meaning and shaping it into useful information. Data stewards will be very familiar with Excel. Over
time, if they are producing more complex reports that need to be shared within the organization, they
may begin using Report Builder.
Business Analyst
Business analysts will traditionally work closely with end users and stakeholders to define any new reports.
Business analysts are interested in the output of a report—they are likely to work back from the output
that they require, and then find the data that will produce this output. Typically, they will be very familiar
with using Excel to create reports and should find it relatively straightforward to make the transition to
Report Builder and Mobile Report Publisher.
BI Developer
Traditionally, report developers have started as database professionals, and so have created Reporting
Services reports with the SQL Server tools. They are likely to have a deep understating of the data and
create reports in a data forward way, creating the most suitable reports based on the data. A BI developer
is a professional who should be familiar with SSDT and therefore more productive when using Report
Designer.
Generalizations can be made about which tools different job roles would favor. It is possible that a
business analyst would start to use Report Designer if they needed to add Visual Basic functionality.
Equally, a database professional could start to use Report Builder for its intuitive nature, or Mobile Report
Publisher because of the increasing demands for report consumption on mobile devices.
Demonstration Steps
Open the Sales_Order_Detail Report in Report Builder
4. In the top right of the Sales_Order_Detail report, click the ellipses, and then click MANAGE.
6. In the Internet Explorer dialog box, clear the Always ask before opening this type of address
check box, and then click Allow.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 1-17
1. In the Sales_Order_Detail - Microsoft SQL Server Report Builder window, in the Report Data
pane, right-click Data Sources, click Add Data Source.
2. In the Data Source Properties dialog box, in the Name box, type AdventureWorks_on_Azure.
4. In the Select connection type list, click Microsoft Azure SQL Database.
11. On the taskbar, click Sales_Order_Detail - Microsoft SQL Server Report Builder, and then click
Build.
12. In the Connection Properties dialog box, in the Server name box, paste the copied server name.
15. In the Password box, type Pa$$w0rd, and then select the Save my password check box.
16. In the Select or enter a database name list, click AdventureWorksLT, and then click OK.
17. In the Data Source Properties dialog box, click Test Connection.
1. In the Report Data pane, right-click Datasets, and then click Add Dataset.
2. In the Dataset Properties dialog box, in the Name box, type Online_Sales, and then click Use a
dataset embedded in my report.
4. In the Query box, type the follow code, and then click OK:
SELECT
SalesOrderHeader.SalesOrderNumber
,Product.Name
,SalesOrderDetail.UnitPrice
,SalesOrderDetail.UnitPriceDiscount
,SalesOrderHeader.OrderDate
FROM
SalesLT.SalesOrderHeader AS SalesOrderHeader
INNER JOIN SalesLT.SalesOrderDetail AS SalesOrderDetail
ON SalesOrderDetail.SalesOrderID = SalesOrderHeader.SalesOrderID
INNER JOIN SalesLT.Product AS Product
ON Product.ProductID = SalesOrderDetail.ProductID
WHERE SalesOrderHeader.SalesOrderNumber BETWEEN 'SO' + @FirstOrderID AND 'SO'+
@LastOrderID
5. On the Insert tab, in the Data Visualizations group, click Chart, and then click Chart Wizard.
6. In the New Chart dialog box, on the Choose a dataset page, click Online_Sales, and then click
Next.
7. On the Choose a chart type page, click Pie, and then click Next.
8. On the Arrange chart fields page, drag the Name field into the Categories box.
9. Drag the Name field into the Values box, then click the drop-down list for the field, click Count, and
then click Next.
10. On the Preview page, click Finish.
11. Resize and move the inserted pie chart above the table.
14. In the Last Order ID boxes, type 57033, and then click View Report.
17. In the Last Order ID boxes, type 71774, and then click View Report.
19. In the Last Order ID boxes, type 71780, and then click View Report.
20. Note the chart is querying data on the Azure database, and the table shows data from the on-
premises database.
Categorize Activity
The following features are either available in Native mode only or in both Native mode and SharePoint
Integrated mode. You should place each item into the appropriate category. Indicate your answer by
writing the category number to the right of each item.
Items
2 Paginated reports
3 Mobile reports
4 HTML5 rendering
5 KPIs
Category 1 Category 2
Objectives
After completing this lab, you will have:
Explored a report.
Password: Pa$$w0rd
2. Run Setup.cmd in the D:\Labfiles\Lab01\Starter folder. The crash is a symptom of the Virtual
Machine environment and is linked to restarting IIS. It can be ignored.
2. Note that the total sales for the employee David Campbell is $106,380.438.
2. Note that the total sales for the employee David R. Campbell is $106,380.438.
3. Use Sales Amount for the values, Full Name for the rows, and Order Date.Calendar for the
columns.
4. Filter the data to show the sales figures for April 2013.
5. Note that the total sales for the employee David R. Campbell is the amount $106,380.438.
2. In Report Builder, run the Employee_Sales_Summary report from the AdventureWorks Sample
Reports folder.
3. Note that the total sales for the employee David R. Campbell amount to $106,380.
4. Experiment with changing the filters at the top of the report and click View Report to refresh the
data.
Module 2
Reporting Services Data
Contents:
Module Overview 2-1
Module Overview
Almost every report that you publish by using SQL Server Reporting Services (SSRS) will be built from data
that is obtained from one or more source systems. This lesson explains how to configure SSRS to interact
with source data systems by working with data sources.
Objectives
After completing this lesson, you will be able to:
Describe datasets.
Lesson 1
Data Sources
To create SSRS reports, you must create and manage connections to the source data that will form the
basis of your reports. Even when you do not need to define data sources—because your reports are based
on shared data sources that a coworker has defined for you—you still need to be able to work with data
sources to use them in reports that you design.
Lesson Objectives
At the end of this lesson, you will be able to:
Explain the differences between shared data sources and embedded data sources.
The location of the source system. This depends on the source system type, but it is typically a
computer name or IP address.
Authentication credentials for the source system. This might be a user name and password for the
source system.
The advantage of encapsulating the connection information in a data source object is that the connection
information for a source system needs to be defined only once in a report definition, even if the report is
based on many different queries from the source system. If the connection information for the source
system changes—for example, if the user name and password that are used to authenticate with the
source system must be updated—the change needs to be made in only one place for the report to
continue to operate correctly.
Note: Data sources contain no information about the data to be retrieved from the source
system. Source system queries are defined independently of the connection information, in
dataset objects. A dataset is defined separately and is linked to a data source.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 2-3
For more information about data sources, see the topic Report Data (SSRS), in the SQL Server 2016
Technical Documentation.
Report Data (SSRS)
http://aka.ms/acwxf8
You might use an embedded data source if you want to create a report that has no external dependencies
on other objects in your SSRS instance—or if a data source will only be used as the basis for a single
report.
It is recommended that you use shared data sources wherever possible. Typically, using shared data
sources will reduce the cost of administering an SSRS installation, because when connection information
needs to be amended, the change is limited to the shared data source. If you have many reports that
reference the same source system by using embedded data sources, you must edit each report definition
if the details of the actual data source change.
Another advantage of using shared data sources is that you can use the same report definition on
different SSRS instances, even if the details of the data source are different for each instance. For example,
if report development is carried out in a development environment that is isolated from your production
system, both the development and production systems could use the same data sources. Providing a
shared data source with the same name exists in both SSRS instances, report definitions that reference the
shared data source will work in both environments, even if some properties of the data source are not the
same.
You cannot create new shared data sources by using Report Builder. If you use Report Builder to design a
report and you need to define a new data source in that report, you must either use an embedded data
source or use another method to create a new shared data source that you can reference in your report.
MCT USE ONLY. STUDENT USE PROHIBITED
2-4 Reporting Services Data
When you define a data source in Report Designer, you can choose to make the data source either a
shared data source or an embedded data source. An administrator can also define shared data sources
directly by using the SSRS portal.
For more information about how to work with data sources, see the topic Data Connections, Data Sources,
and Connection Strings (Report Builder and SSRS), in the SQL Server 2016 Technical Documentation.
Data Connections, Data Sources, and Connection Strings (Report Builder and SSRS)
http://aka.ms/lmww7g
Oracle
Hyperion Essbase
Teradata
Note: You can write your own custom data processing extensions if you need to connect to
data sources that SSRS does not currently support. Doing so requires detailed programming
knowledge; this topic is beyond the scope of this course.
You must select the correct source system type when you define a data source; otherwise, the data source
is unlikely to function correctly, if it functions at all.
For more information about data processing extensions, see the topic Extensions (SSRS), in the SQL Server
2016 Technical Documentation.
Extensions (SSRS)
http://aka.ms/T2y90z
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 2-5
For a complete list of data sources that SSRS supports, see the topic Data Sources Supported by Reporting
Services (SSRS), in the SQL Server 2016 Technical Documentation.
Data Sources Supported by Reporting Services (SSRS)
http://aka.ms/Qer6ev
Demonstration Steps
Use the SSRS Portal to Create a Shared Data Source
1. Ensure that the MSL-TMG1, 10990B-MIA-DC, and 10990B-MIA-SQL virtual machines are running, and
then log on to 10990B-MIA-SQL as ADVENTUREWORKS\Student with the password Pa$$w0rd.
6. On the New Data Source page, in the Name box, type AdventureWorksDW-portal.
7. In the Type box, verify that Microsoft SQL Server is selected.
9. Click Test connection. Note that the test succeeds, and then click Create.
10. Leave Internet Explorer open for the next demonstration.
1. Start Microsoft Visual Studio®, and on the File menu, point to Open, and then click
Project/Solution.
2. In the Open Project dialog box, in D:\Demofiles\Mod02\Demo, click Demo.sln, and then click
Open. This opens a new, empty SSRS project.
3. In Solution Explorer, right-click Shared Data Sources, and then click Add New Data Source.
4. In the Shared Data Source Properties dialog box, in the Name box, type AdventureWorksDW-
SSDT.
5. In the Type box, verify that Microsoft SQL Server is selected, and then click Edit.
6. In the Connection Properties dialog box, in the Server name box, type MIA-SQL.
7. In the Select or enter a database name box, select AdventureWorksDW, and then click Test
Connection.
MCT USE ONLY. STUDENT USE PROHIBITED
2-6 Reporting Services Data
10. In the Shared Data Source Properties dialog box, on the Credentials page, point out that you can
amend the credentials that are used for the data source. Verify that Use Windows Authentication is
selected, and then click OK.
11. In Solution Explorer, expand Shared Data Sources, and then verify that the definition for the data
source has been created. Point out that the data source definition is a file with an .rds extension.
12. In Internet Explorer, on the SQL Server Reporting Services page, click Home, and then click
Designer, notice that the AdventureWorksDW-SSDT data source does not yet exist on the server; it
must be deployed.
13. In Visual Studio, in Solution Explorer, right-click AdventureWorksDW-SSDT.rds, and then click
Deploy. Wait for the deployment to succeed.
14. In Internet Explorer, on the SQL Server Reporting Services page, click Refresh.
15. Click Designer, and verify that the AdventureWorksDW-SSDT data source has now been created.
16. Leave Visual Studio and Internet Explorer open for the next demonstration.
6. In the Report Data pane, right-click Data Sources, and then click Add Data Source.
7. In the Data Source Properties dialog box, on the General page, in the Name box, type
AdventureWorksDW_embedded, and then click Use a connection embedded in my report.
8. In the Select connection type box, verify that Microsoft SQL Server is selected, and then click
Build.
9. In the Connection Properties dialog box, in the Server name box, type MIA-SQL.
10. In the Select or enter a database name list, click AdventureWorksDW, and then click Test
Connection.
13. In the Data Source Properties dialog box, on the Credentials page, point out that you can amend
the credentials that you use for the data. Note the warning message: This information is only
stored when you save the report to a report server. Verify that Use current Windows user is
selected, and then click OK.
16. In the Name box, type report_builder.rdl, and then click Save.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 2-7
17. In Internet Explorer, close the We’re opening Report Builder window, and then click DataSources.
Note that, although the report definition has been saved to the folder, there is not an independent
data source definition for the data source that is used in the report.
18. In the report_builder object, in the top-right corner, click the ellipsis (…) button, and then click
MANAGE.
19. On the Edit report_builder page, click Data sources, verify that you can amend the properties of an
embedded connection after the report is published. When you have finished examining the report
properties, click DataSources.
20. Leave Internet Explorer and Report Builder open for the next demonstration.
You want to create a data source that several reports will use. Which type of data
source should you create?
Either a shared data source or an embedded data source; it does not matter
which.
MCT USE ONLY. STUDENT USE PROHIBITED
2-8 Reporting Services Data
Lesson 2
Connection Strings
SSRS uses connection strings to locate report data sources and to correctly configure a connection to a
data source to retrieve data. This lesson describes the connection strings for the different types of system
that you might use when you configure data sources for your reports.
Lesson Objectives
At the end of this lesson, you will be able to:
property name=value;[property
name=value;…]
Although the contents of the connection string vary according to the data source type and the
environment where the connecting application is running, all connection strings can contain several
different types of information, such as:
Authentication credentials.
Authentication Credentials
Authentication credentials typically take the form of a user name and password or an instruction to use
the user’s Windows credentials. You can also configure an SSRS data source to request Windows
credentials from the user who is running a report that uses the data source. Not every type of data source
requires an authentication method to be explicitly nominated; many data providers have a default
authentication method that will be used if one is not included in the connection string. For example, a
SQL Server Native Client connection will use Windows authentication if no authentication method is
specified in the connection string.
Note: You might encounter connection strings in other data-driven applications that
include a user name and password in the connection string. Storing sensitive data, such as user
names and passwords in plain text, in a connection string, can be a security risk. Therefore, SSRS
reports only use securely stored authentication credentials that are independent of the
connection string. When SSRS connects to a data source to generate a report, the credentials are
recovered from secure storage and added to the connection string.
Additional Properties
Additional connection string properties are used to configure aspects of the connection after it is
initiated—for example, connection string properties could define the database name that the connection
should attempt to use, or whether the connection should require encryption. Although connection strings
for most source data system types require a data source location and an authentication method,
additional properties are typically optional. Each source system type will support a different number and
set of additional properties.
The following example shows how to connect to the default database engine instance that is installed on
the same computer as the SSRS instance, starting in the AdventureWorksDW database.
MCT USE ONLY. STUDENT USE PROHIBITED
2-10 Reporting Services Data
The following example shows how to connect to a named database engine instance—called SQL2—that is
installed on the same computer as the SSRS instance, starting in the AdventureWorksDW database.
The following example shows how to connect to the default database engine instance that is installed on
a different computer from the SSRS instance—called DBServer—starting in the AdventureWorksDW
database.
The following example shows how to connect to a named database engine instance—called SQL3—that is
installed on a different computer from the SSRS instance—called DBServer—starting in the
AdventureWorksDW database.
Note: When you define connections to named database engine instances in Report
Designer or Report Builder, the slash in the data source property of the connection string will be
doubled, as the following code example shows:
DBServer\\SQL3
This is to prevent the slash being interpreted as a special character. When the data source is
saved to a report server instance, the extra slash is removed.
The following example shows how to connect to an Azure SQL Database called AdventureWorksDW that
runs on an Azure SQL Database server called azuresql.
Note: Connection strings for database engine instances and Azure SQL Database can
include more than 30 optional additional parameters. For a complete list, in Report Builder or
Report Designer, in the Connection Properties window, click Advanced.
For more information about how to use SQL Server database engine connections in SSRS, see the topic
SQL Server Connection Type (SSRS), in the SQL Server 2016 Technical Documentation.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 2-11
For more information about how to use Azure SQL Database connections in SSRS, see the topic SQL Azure
Connection Type (SSRS), in the SQL Server 2016 Technical Documentation.
Multidimensional Models
The connection string for a multidimensional SSAS
data source is the same whether you plan to write queries by using the Multidimensional Expressions
(MDX) or Data Mining Extensions (DMX) language. The following examples show connection strings that
are used for multidimensional SSAS instances in typical configurations. You use these connection strings
with the Microsoft SQL Server Analysis Services data source type.
The following example shows how to connect to a multidimensional SSAS instance that is installed on the
same computer as the SSRS instance, starting in the AWCube model.
The following example shows how to connect to a multidimensional SSAS instance that is installed on a
different computer from the SSRS instance—AS_SERVER— starting in the AWCube2 model.
Tabular Models
The connection string for a tabular SSAS data source is the same as for a multidimensional SSAS data
source, with an additional optional property that helps you to define which tabular perspective to use.
You also use the Microsoft SQL Server Analysis Services data source type to connect to a tabular SSAS
model.
The following example shows how to connect to a tabular SSAS instance that is installed on a different
computer from the SSRS instance—AS_TAB_SERVER—starting in the AW3 model and using the Sales
perspective.
MCT USE ONLY. STUDENT USE PROHIBITED
2-12 Reporting Services Data
Note: Connection strings for SSAS data sources can include more than 60 optional
additional parameters. For a complete list, in Report Builder or Report Designer, in the
Connection Properties window, click Advanced.
For more information about how to use SSAS multidimensional MDX queries as SSRS data sources, see the
topic Analysis Services Connection Type for MDX (SSRS) in the SQL Server 2016 Technical Documentation.
For more information about how to use SSAS multidimensional DMX queries as SSRS data sources, see the
topic Analysis Services Connection Type for DMX (SSRS)) in the SQL Server 2016 Technical Documentation.
Oracle
To use an Oracle data source, the Oracle client software must be installed on the SSRS server.
The following example shows a connection string for an Oracle instance—AWOracle— that is defined in
the local TNSNAMES.ORA file.
Connecting to Oracle
data source=AWOracle
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 2-13
The following example shows a connection string for a report server instance that is running in native
mode—ModelServer—accessing a model called AWModel in the ReportModels folder:
The next example shows a connection string for a report server instance that is running in SharePoint
integrated mode—ModelServerSP—accessing a model called AWModel in the ReportModels folder.
SharePoint List
The connection string for a SharePoint list includes the server name, site name, and any subsite names.
The group of available lists in the site that is specified in the connection string is shown in the query
designer.
The following example shows a connection string for SharePoint lists in the AdventureWorks site on the
AWSP instance of SharePoint Server:
SAP NetWeaver BI
The following example shows a connection string for a SAP NetWeaver BI instance that runs on port 9000
of the AWSAP server:
Hyperion Essbase
The following example shows a connection string for a Hyperion Essbase instance that runs on port 13090
of the AWEssbase server and works in the AWSales database:
Teradata
To use a Teradata data source, the Teradata client software must be installed on the SSRS server.
The following example shows a connection string for a Teradata instance that runs on port 10.0.0.2 and
connects to the AWTera database:
Connecting to Teradata
data source=10.0.0.2;database=AWTera
MCT USE ONLY. STUDENT USE PROHIBITED
2-14 Reporting Services Data
XML
You can use XML that is returned from a web service, is in a file, or is embedded in a report definition as a
data source.
The following example shows a connection string for an XML document that is returned by a call to the
sales-report.aspx page on the AWReports web server:
The following example shows a connection string for the CurrentPriceList.xml document on the AWPublic
web server:
An XML document that is embedded in a report definition has no connection string when it is used as a
data source.
For more information about data source connection strings, see the topic Add Data from External Data
Sources (SSRS) in the SQL Server 2016 Technical Documentation.
Add Data from External Data Sources (SSRS)
http://aka.ms/Ge3qk9
Report Designer
Demonstration Steps
Connect to Azure SQL Database from Report Builder
1. In Report Builder, in the Report Data pane, right-click Data Sources, and then click Add Data
Source.
2. In the Data Source Properties dialog box, on the General page, in the Name box, type
AdventureWorksLT, and then click Use a connection embedded in my report.
3. In the Select connection type list, click Microsoft Azure SQL Database. Notice that two optional
properties are added to the connection string, and then click Build.
4. In the Connection Properties dialog box, in the Server name box, type the name of your Azure SQL
Database server; this needs to be the fully qualified name, ending in .database.windows.net.
5. Verify that Use SQL Server Authentication is selected, in the User name box, type Student, in the
Password box, type Pa$$w0rd.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 2-15
6. In the Select or enter a database name box, type AdventureWorksLT, and then click Test
Connection.
7. In the Test results dialog box, click OK.
2. In the Shared Data Source Properties dialog box, in the Name box, type AdventureWorksLT.
3. In the Type list, click Microsoft Azure SQL Database, and then click Edit.
4. In the Connection Properties dialog box, in the Server name box, type the name of your Azure SQL
Database server; this needs to be the fully qualified name, ending in .database.windows.net.
5. In the Authentication box, verify that SQL Server Authentication is selected, in the User name box,
type Student, in the Password box, type Pa$$w0rd.
7. In the Select or enter a database name list, click AdventureWorksLT, and then click Test
Connection.
10. In the Shared Data Source Properties dialog box, click OK.
Which of the following connection strings will configure a SQL Server connection
to connect to the AWSales database on the Sales database engine instance on a
server called SALES2?
Lesson 3
Datasets
After you have defined a connection to a source system by using a data source, you must define how the
data you want to include in your report will be retrieved from the source system; you do this by using the
dataset object. This lesson is an introduction to working with datasets.
Lesson Objectives
At the end of this lesson, you will be able to:
Describe datasets.
What Is a Dataset?
A dataset defines a result set to use as the basis for
a report. It defines a query—or other data
extraction statement—that is executed against a
data source. Therefore, the two most important
properties of a dataset are:
Data source
Query text
Data Source
The data source for a dataset must be a data source that already exists. The data source can be an
embedded data source that is included in the report definition, or it can be a shared data source on the
report server. A dataset only contains a link to the data source name; no other information about the data
source is stored in the dataset definition.
Query Text
The query text in a dataset takes the form of a query statement in a language that is appropriate to the
data source type. For example, if the data source for a dataset is a SQL Server database engine instance,
the query text is a Transact-SQL statement.
For more information about datasets, see the topic Report Datasets (SSRS) in the SQL Server 2016
Technical Documentation.
Embedded Datasets
When you use an embedded dataset, the dataset
definition is included as part of the definition of a
single report. An embedded dataset is not a
separate object on the SSRS server, and it cannot
be shared between different report definitions.
You might use an embedded dataset if you want to create a report that has no external dependencies on
other objects in your SSRS instance or if a dataset will only be used as the basis for a single report.
Note: You can create an embedded dataset by using either an embedded data source or a
shared data source.
Shared Datasets
A shared dataset is defined independently of any report definitions that reference it and is created as a
separate object on the SSRS instance. Many different report definitions can reference a single shared
dataset.
Note: A shared dataset must be based on a shared data source. A shared dataset cannot be
based on an embedded data source.
Using shared datasets can improve report performance, because the results from a shared dataset can be
temporarily stored on the report server in a cache. This means that reports that are based on the shared
dataset can be generated without the dataset query being executed for each run of the report. If a report
is frequently executed, or the dataset query takes a long time to execute, caching the results from a
shared dataset can significantly improve the responsiveness of an SSRS instance. For this reason, it is
recommended that you make use of shared datasets whenever possible.
For more information about shared and embedded datasets, see the topic Embedded and Shared Datasets
(Report Builder and SSRS) in the SQL Server 2016 Technical Documentation.
Demonstration Steps
Use Report Designer to Create a Shared Dataset
1. In Visual Studio, in Solution Explorer, right-click Shared Datasets, and then click Add New Dataset.
2. In the Shared Dataset Properties dialog box, in the Name box, type AssociatedOrders-SSDT.
3. In the Data source list, click AdventureWorksDW-SSDT, and then click Query Designer.
5. In the Add Table dialog box, on the Views tab, click vAssocSeqOrders, click Add, and then click
Close.
6. In the Diagram pane, in the vAssocSeqOrders object, select OrderNumber, CustomerKey, Region,
and IncomeGroup.
7. Click the Run button (!) to preview the results of the query. Briefly review the data in the Result pane,
click OK.
Note: There is currently an issue with SSDT. When deploying you may get this error:
The shared dataset definition is not valid. Details: The required attribute 'Name' is
missing.
To resolve it edit the D:\Demofiles\Mod02\Demo\Demo \AssociatedOrders-SSDT.rsd file in
notepad and change:
<DataSet>
To:
<DataSet Name=””>
Save and you should be able to deploy.
10. In Internet Explorer, on the SQL Server Reporting Services page, click Home, and then click
Designer. Verify that the AssociatedOrders-SSDT shared data source has been created. If the shared
data source does not appear, refresh the page.
11. Leave Visual Studio and Internet Explorer open for the next demonstration.
2. In the New Report or Dataset dialog box, click New Dataset, and then click Browse other data
sources.
3. In the Select Data Source dialog box, double-click DataSources, click AdventureWorksDW-portal,
and then click Open.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 2-19
4. In the New Report or Dataset dialog box, click Create. Report Builder will switch to the Shared
Dataset Design view.
5. In the Database view pane, expand Views, select vAssocSeqOrders, and then click Edit as Text to
switch to the Query Designer view.
6. Click the Run button (!) to preview the output of the query. Briefly examine the query results, and
then on the File menu, click Save.
7. In the Save As Dataset dialog box, verify that the value of the Look in box is http://mia-
sql/ReportServer_SQL2/DataSources, in the Name box, type AssociatedOrders-builder, and then
click OK.
8. In Internet Explorer, on the SQL Server Reporting Services page, click Home, and then click
DataSources. Verify that the AssociatedOrders-builder shared dataset appears on the report server
portal.
9. Leave Report Builder and Internet Explorer open for the next demonstration.
Verify the correctness of the statement by placing a mark in the column to the right.
Statement Answer
Lesson 4
Filters and Parameters
When you work with datasets, especially shared datasets that are used by several reports, you do not
always want to base your report on the complete set of rows that the dataset returns. SSRS supports two
methods for restricting the rows that are returned to a report from a dataset: filters and parameters.
Lesson Objectives
At the end of this lesson, you will be able to:
Describe filters.
Describe parameters.
Add parameters.
Filters are also useful when the source query for a dataset is not under your control or cannot be altered
for some other reason—for example, if the source query executes a stored procedure—but you want to
build your report on a subset of the data that the query returns.
Filter Equations
You define a filter by creating a filter equation. Only rows for which the filter equation evaluates to true
will be included in the output result set. A filter equation is built from:
An expression.
An operator.
A value.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 2-21
The following table shows an example of a simple filter—in this case, restricting the data that is returned
to rows where the value of the Region column equals Pacific.
Expressions
Expressions are used in many areas of SSRS reports. They are fragments of Microsoft Visual Basic® .NET
code that you can use to modify and calculate values, similar to the way in which you might use formulas
in a Microsoft Excel® spreadsheet. Expressions are a complex topic in their own right, so a detailed
discussion of SSRS expressions is beyond the scope of this module.
Operator
You can use the following simple operators in filter equations:
Equal
Not equal
Like
Greater than
Less than
Less than or equal
In
Between
Top N
Bottom N
Top N percent
Bottom N percent
Value
The value is compared to the output of the expression by using the operator. The value can be hard-
coded, or it can be another expression.
For more information about how to add dataset filters, see the topic Add a Filter to a Dataset (Report
Builder and SSRS) in the SQL Server 2016 Technical Documentation.
To see some examples of filter equations, see the topic Filter Equation Examples (Report Builder and SSRS)
in the SQL Server 2016 Technical Documentation.
Filter Equation Examples (Report Builder and SSRS)
http://aka.ms/M6x5ou
For more information about how to use expressions in SSRS reports, see the topic Expression Reference
(Report Builder and SSRS) in the SQL Server 2016 Technical Documentation.
Shared Dataset
When a filter is applied at the level of a shared
dataset, the filter will apply to all of the reports
that are based on the shared dataset.
Report Dataset
In a report definition, you can apply filters to
embedded datasets or references to shared datasets. When you do this, the filter applies to all references
to the dataset within the report. Applying a filter to a reference to a shared dataset has no effect on the
shared dataset itself; the filter applies only within the context of the report where the filter is defined.
Other users of the shared dataset are not affected by a filter that is applied at report level.
For more information about how to apply filters at different report levels, see the topic Filter, Group, and
Sort Data (Report Builder and SSRS) in the SQL Server 2016 Technical Documentation.
Adding a Filter
In both Report Designer and Report Builder, you
can add filters to report objects that support them
by using the Filters page of the object properties
window. The Filters page includes a structured
form where you enter the expression, data type,
operator, and value in separate boxes. An
expression editor is available to help you to
compose the expression and value.
You cannot add filters to any object type by using the SSRS portal.
For more information about how to add filters to datasets, see the topic Add a Filter to a Dataset (Report
Builder and SSRS) in the SQL Server 2016 Technical Documentation.
For more information about how to add filters to other report elements, see the topic Add a Filter (Report
Builder and SSRS) in the SQL Server 2016 Technical Documentation.
Demonstration Steps
Add a Filter to a Shared Dataset in Report Builder
2. In the Shared Dataset Properties dialog box, on the Filters page, click Add.
3. In the Expression list, click [Region]. Verify that Text is selected in the data type box, and that the
Operator box has the value =.
5. Click Run. Notice that in the Query results pane, the filter is not applied; rows with values other than
Pacific in the Region column are returned.
MCT USE ONLY. STUDENT USE PROHIBITED
2-24 Reporting Services Data
8. On the Edit AssociatedOrders-builder page, click Data Preview, and then click Load data. Observe
that only rows with a Region of Pacific are returned. Notice that the values in the IncomeGroup
column include Low, Moderate, and High.
2. In the Microsoft SQL Server Report Builder dialog box, click No.
3. In the Open Report dialog box, double-click DataSources, click report_builder, and then click
Open.
4. In the Report Data pane, right-click Datasets, and then click Add Dataset.
5. In the Dataset Properties dialog box, on the Query page, in the Name box, type
AssociatedOrders_filtered. Verify that Use a shared dataset is selected, and then click Browse.
6. In the Select Dataset dialog box, double-click DataSources, click AssociatedOrders-builder, and
then click Open.
8. In the Expression list, click [IncomeGroup]. Verify that Text is selected in the data type box, and in
the Operator list, click <>.
9. In the Value box, type High, and then click OK.
10. On the Insert tab, click Table, and then click Table Wizard.
11. In the New Table or Matrix wizard, on the Choose a dataset page, click
AssociatedOrders_filtered, and then click Next.
12. On the Arrange fields page, drag OrderNumber, CustomerKey, Region, and IncomeGroup from
the Available fields list to the Values list, and then click Next.
16. In the Enter Data Source Credentials dialog box, in the User name box, type Student, and in the
Password box, type Pa$$w0rd, and then click OK. Notice that the report includes only rows from the
Pacific region (because of the filter on the shared dataset) with an income group of Low or
Moderate (because of the filter on the report dataset).
17. Click Design, and then leave Report Builder open for the next demonstration.
2. In the Shared Dataset Properties dialog box, on the Filters page, click Add.
3. In the Expression list, click [Region]. Verify that Text is selected in the data type box, and that the
Operator box has the value =.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 2-25
6. In Internet Explorer, on the SQL Server Reporting Services page, click Home, and then click
Designer.
7. On the AssociatedOrders-SSDT shared dataset, click the ellipsis (…) button, and then click
MANAGE.
8. Click Data Preview, and then click Load data. Observe that only rows with a Region of Pacific are
returned. Notice that the values in the IncomeGroup column include Low, Moderate, and High.
1. In Visual Studio, in Solution Explorer, right-click Reports, point to Add, and then click New Item.
2. In the Add New Item - Demo dialog box, click Report, and then click Add.
3. In the Report Data pane, right-click Datasets, and then click Add Dataset.
4. In the Dataset Properties dialog box, on the Query page, in the Name box, type
AssociatedOrders_filtered. Verify that Use a shared dataset is selected, and then click
AssociatedOrders-SSDT.
6. In the Expression list, click [IncomeGroup]. Verify that Text is selected in the data type box, and in
the Operator list, click <>.
9. In the Report Data pane, drag OrderNumber to the first column of the Data row of the new table.
10. In the Report Data pane, drag Region to the second column of the Data row of the new table.
11. In the Report Data pane, drag IncomeGroup to the third column of the Data row of the new table.
12. In the Report Data pane, drag CustomerKey to the right side of the IncomeGroup column—when a
blue marker appears.
13. Click the Preview tab to preview the report. Notice that the report includes only rows from the
Pacific region (because of the filter on the shared dataset) with an income group of Low or
Moderate (because of the filter on the report dataset).
14. Click the Design tab, and then leave Visual Studio open for the next demonstration.
MCT USE ONLY. STUDENT USE PROHIBITED
2-26 Reporting Services Data
Report parameters. Parameters that are in the header of a report before the report is generated.
When they are linked to dataset parameters, report parameters enable a user to customize the range
of data that a report displays; by default, a report parameter is generated for each dataset parameter
that is detected in a report’s datasets. You can manually define report parameters that are not linked
to dataset parameters.
Note: Both dataset parameters and filters can have their value linked to a report parameter.
However, the report parameter and the link are only created automatically for dataset
parameters.
The following example shows a SQL Server Database Engine query that uses a variable—@region—in the
WHERE clause. The @region variable could be linked to a dataset parameter.
Different source system languages use different syntax to identify variables. You will need to be familiar
with the query language syntax for the source system(s) that you plan to use with dataset parameters.
For more information about report parameters, see the topic Report Parameters (Report Builder and
Report Designer) in the SQL Server 2016 Technical Documentation.
Adding a Parameter
There are two elements to configuring parameters:
Defining a parameter.
Defining a Parameter
Defining a parameter requires a change to the
source system query, so you can only configure
parameters in a dataset definition. Parameters for
shared datasets and embedded datasets are
defined by using the same tools.
There are several different methods that you can
use to add a parameter to a dataset query:
Directly edit the query text in the dataset definition. If you edit the query text on the Query page
of the dataset properties window, the parameter will be detected—depending on the context, you
might also need to click Refresh Fields. This option is available in Report Designer and Report
Builder.
Edit the query by using the Query Designer. Despite its name, you can use the Filter column of the
Query Designer Grid pane to create and manage parameters for some source system types. You can
use the Filter column to create hard-coded restrictions or parameterized restrictions on the rows that
a dataset returns. To use a parameter, the value in the Filter column should be a parameter name in
the source system query syntax.
Use the Report Builder Dataset editor. Despite its name, the Applied filters pane of the Report
Builder Dataset editor is used to create and manage parameters. You can use the Applied filters pane
to create hard-coded restrictions or parameterized restrictions on the rows that a dataset returns. If
the Parameter box is selected, a restriction is parameterized.
Use the dataset properties Parameters page. The Parameters page of the dataset properties
window includes a structured form that you can use to add and manage parameters. Parameters that
you add by editing the query text will appear on the Parameters page after the query parser has
identified them. The options that are available on the Parameters page are different for embedded
datasets and shared datasets; you have more control over parameter behavior in a shared dataset.
This option is available in Report Designer and Report Builder.
For more information about how to link dataset parameters and report parameters, see the topic
Associate a Query Parameter with a Report Parameter (Report Builder and SSRS) in the SQL Server 2016
Technical Documentation.
Associate a Query Parameter with a Report Parameter (Report Builder and SSRS)
http://aka.ms/Pc9j8o
MCT USE ONLY. STUDENT USE PROHIBITED
2-28 Reporting Services Data
Demonstration Steps
Define a Parameter for a Shared Dataset in Report Builder
2. If the Microsoft SQL Server Report Builder dialog box appears, asking to save changes, click Yes.
3. In the Open Report dialog box, in the Items of type list, click Datasets (*.rsd), click
AssociatedOrders-builder, and then click Open.
6. In the Database view pane, expand Views, and then select the vAssocSeqOrders check box.
9. In the Operator column, click is, and then click is more than or equal to.
11. Click Edit as Text to view the query text. Notice that a WHERE clause has been added to the query,
referencing a parameter named @CustomerKey, and then click Set Options.
12. In the Shared Dataset Properties dialog box, on the Parameters page, notice that an entry appears
for the @CustomerKey parameter, click Cancel, and then click the Run button (!).
13. In the Define Query Parameters dialog box, in the Parameter Value column, in the first row, type
29000, and then click OK. Notice that the parameter value is passed to the WHERE clause, and the
result set is limited to rows where CustomerKey is greater than or equal to 29,000.
2. In the Microsoft SQL Server Report Builder dialog box, asking to save changes, click Yes.
3. In the Open Report dialog box, click report_builder, and then click Open.
4. In the Report Data pane, expand Datasets, right-click AssociatedOrders_filtered, and then click
Dataset Properties.
5. In the Dataset Properties dialog box, on the Parameters page, notice that the parameter is not
listed.
6. On the Query page, click Refresh Fields, and then return to the Parameters page; an entry for the
parameter is now shown. Notice that fewer options are available in this view of the Parameters page
than were shown in the Shared Dataset Properties dialog box when the parameter was created, click
OK.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 2-29
8. In the Enter Data Source Credentials dialog box, in the User name box, type Student, and in the
Password box, type Pa$$w0rd, and then click OK. Notice that the report is not rendered
immediately; instead, a report header is shown where you can provide a value for the Customer Key
parameter.
9. In the Customer Key box, type 29000, and then click View Report.
10. Notice that the values that are shown in the report are limited both by the parameter value and by
the filters that you applied in the previous demonstration, click Design.
11. In the Report Data pane, right-click AssociatedOrders_filtered, and then click Dataset Properties.
12. In the Dataset Properties dialog box, on the Parameters page, notice that the Parameter Value
box has been automatically populated with the name of a report parameter—[@CustomerKey].
13. In the Parameter Value box, type 29000, and then click OK. This breaks the link between the report
parameter and the dataset parameter.
14. Click Run. Notice that, even though the link between the dataset parameter and the report
parameter has been broken, the report parameter has not been deleted from the report definition.
15. In the Customer Key box, type 50000, and then click View Report. There are no rows in the dataset
where CustomerKey is greater than or equal to 50000.
16. Notice that the values in the report are returned, based on the value that was hard-coded in the
dataset properties window. The value of the report parameter is ignored.
3. On the Parameters page, notice that the parameter has been detected automatically and added to
the parameter list.
5. In the Query Designer dialog box, in the Grid pane, in the CustomerKey row, in the Filter column,
notice the parameter definition, and then click the Run button (!).
6. In the Query Parameters dialog box, in the Value column, in the first row, type 29000, and then
click OK.
7. In the Results pane, scroll down to verify that the parameter value has restricted the rows that are
returned to those where CustomerKey is greater than or equal to 29000, and then click OK.
1. In the Report Data pane, under Datasets, right-click AssociatedOrders_filtered, and then click
Dataset Properties.
2. In the Dataset Properties dialog box, on the Parameters page, notice that the addition of the
parameter to the shared dataset is not reflected.
4. On the Parameters page, notice that an entry now exists in the parameters list for the @CustomerKey
parameter, and then click OK.
5. In the Report1.rdl pane, click Preview. Notice that the report is not rendered immediately; instead, a
report header is shown where you can provide a value for the Customer Key parameter.
6. In the Customer Key box, type 29000, and then click View Report.
7. Notice that the values that are shown in the report are limited both by the parameter value and by
the filters that you applied in the previous demonstration, and then click Design.
8. In the Report Data pane, right-click AssociatedOrders_filtered, and then click Dataset Properties.
9. In the Dataset Properties dialog box, on the Parameters page, notice that the Parameter Value
box has been automatically populated with the name of a report parameter—[@CustomerKey].
10. In the Parameter Value box, type 29000, and then click OK. This breaks the link between the report
parameter and the dataset parameter.
11. In the Report1.rdl pane, click Preview. Notice that, even though the link between the dataset
parameter and the report parameter has been broken, the report parameter has not been deleted
from the report definition.
12. In the Customer Key box, type 50000, and then click View Report. There are no rows in the dataset
where CustomerKey is greater than or equal to 50000.
13. Notice that the values in the report are returned, based on the value that was hard-coded in the
dataset properties dialog box. The value of the report parameter is ignored.
Definition Filters are defined independently of Parameters are defined as part of the
the source system query. source system query.
Value Filter values are not linked to a Parameter values are linked to a report
report parameter automatically. parameter automatically.
Filter values must be defined at the Parameter values for shared datasets
level that the filter is defined. can be overridden in report datasets.
Effect Filters are applied after the source Parameters are applied as part of the
system query has been executed source system query. Only rows that
and the results have been returned match the parameter conditions are
to SSRS. returned to SSRS.
Filters that are applied at one level Parameters are only applied at one
are inherited by lower levels—a level—the source system query. All of
filter on a shared dataset affects all the report datasets that are based on a
of the reports that reference the shared dataset will be affected by the
dataset; a filter on a report dataset parameter.
affects all of the data regions that
use the dataset.
Question: A dataset that is linked to a SQL Server data source has the query text that is
shown in the following code:
Does the dataset use a filter or a parameter to restrict the rows that are returned from the
DimCurrency table?
MCT USE ONLY. STUDENT USE PROHIBITED
2-32 Reporting Services Data
Objectives
After completing this lab, you will be able to use Report Builder to create shared data sources and shared
datasets.
After you configure the shared data source, you will create three shared datasets:
A shared dataset that returns all of the rows and columns from the dbo.vAllSales view.
A shared dataset that returns all of the columns from the dbo.usp_SalesTerritory stored procedure;
rows with the SalesTerritoryGroup values NA and North America should be excluded from the
results by using a filter.
A shared dataset that returns all of the columns from the dbo.vAllSales view and accepts a
parameter that restricts the results by the SalesTerritoryCountry value.
o Password: Pa$$w0rd
2. Use the Test Connection functionality to verify that you can connect to the data source.
2. Using the shared data source that you created in the previous task, create a shared dataset. The
dataset should return all of the rows and columns from the dbo.vAllSales view in the
AdventureWorksDW database.
3. Save the dataset in the Builder folder on the SSRS server. Give the dataset the name AllSales.
4. In Internet Explorer, browse to http://mia-sql/Reports_SQL2/browse/Builder to verify that the
dataset has been created.
2. Add a filter to the dataset to exclude rows from the dataset where the value of the
SalesTerritoryGroup column is NA or North America.
3. Save the dataset in the Builder folder on the SSRS server. Give the dataset the name
FilteredTerritories.
2. Add a parameter to the dataset to enable the results to be restricted to a single value of
SalesTerritoryCountry.
3. Save the dataset in the Builder folder on the SSRS server. Give the dataset the name CountrySales.
4. Run the dataset in Report Builder to verify that the parameter works as expected.
Results: At the end of this lab, a shared data source and three shared datasets will exist in the Builder
folder of the Reporting Services portal at http://mia-sql/Reports_SQL2.
MCT USE ONLY. STUDENT USE PROHIBITED
2-34 Reporting Services Data
Verify the correctness of the statement by placing a mark in the column to the right.
Statement Answer
True or false? In this exercise, you could have used a parameter instead of
a filter to restrict the values that the FilteredTerritories dataset returned
(based on the dbo.usp_SalesTerritory stored procedure).
Assume that you cannot make changes to the dbo.usp_SalesTerritory
stored procedure when you select your answer.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 2-35
Objectives
After completing this lab, you will be able to use Report Designer to create shared data sources and
shared datasets.
After you configure the shared data source, you will create three shared datasets:
A shared dataset that returns all of the rows and columns from the dbo.vAllSales view.
A shared dataset that returns all of the columns from the dbo.usp_SalesTerritory stored procedure;
rows with the SalesTerritoryGroup values NA and North America should be excluded from the
results by using a filter.
A shared dataset that returns all of the columns from the dbo.vAllSales view and accepts a
parameter that restricts the results by the SalesTerritoryCountry value.
2. Create a shared data source with the name AdventureWorksDW. Use the following information to
configure the data source:
o Password: Pa$$w0rd
3. When the data source definition is complete, deploy the shared data source to the Designer folder of
the SSRS instance at http://mia-sql/Reports_SQL2—the correct settings are configured in the project.
2. Add a filter to the dataset to exclude rows from the dataset where the value of the
SalesTerritoryGroup column is NA or North America.
2. Add a parameter to the dataset to enable the results to be restricted to a single value of
SalesTerritoryCountry.
3. Run the dataset in Query Designer to verify that the parameter works as expected.
4. Close Visual Studio, saving any changes, and then close Internet Explorer.
Results: At the end of this lab, a shared data source and three shared datasets will exist in the Designer
folder of the Reporting Services portal at http://mia-sql/Reports_SQL2.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 2-37
Verify the correctness of the statement by placing a mark in the column to the right.
Statement Answer
True or false? In this exercise, you could have used a parameter instead of
a filter to restrict the values that the FilteredTerritories dataset returned
(based on the dbo.usp_SalesTerritory stored procedure).
Assume that you cannot make changes to the dbo.usp_SalesTerritory
stored procedure when you select your answer.
MCT USE ONLY. STUDENT USE PROHIBITED
2-38 Reporting Services Data
Best Practice: To simplify the management and administration of your SSRS servers, use
shared data sources whenever possible.
Review Question(s)
Which SSRS data access object would you typically create first when you configure
data access to a source system?
An embedded dataset
A shared dataset
A parameter
A data source
A filter
MCT USE ONLY. STUDENT USE PROHIBITED
3-1
Module 3
Implementing Reports
Contents:
Module Overview 3-1
Module Overview
Now that you have learned about BI and data modeling, and how to access data from Report Designer
and Report Builder, you need to learn how to create reports. This module shows you how to create
different types of reports in both applications, in addition to using the Report Wizard.
Objectives
After completing this module, you will be able to:
Lesson 1
Creating a Report with the Report Wizard
The Report Wizard offers a quick and efficient way to develop reports in SQL Server® Data Tools and
Report Builder. In this module you will see how to create a report graphically in the Report Wizard.
Lesson Objectives
After completing this lesson, you will be able to use the Report Wizard to:
Design a query.
After the Welcome page, you will see the Select the
Data Source page where you can either select an
existing data source or create a new one.
Oracle
SAP NetWeaver BI
Hyperion Essbase
Teradata
OLE DB
ODBC
XML
You can create and register support for custom data source types on the system. You can also download
many third-party .NET Framework data providers from Microsoft and third-party developers’ sites.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 3-3
You define a data source in the Report Wizard by selecting an existing shared data source on the Select
the Data Source page or by defining a new data source connection. When defining a new data source,
you specify the connection string information and credentials to use to access the data source. You might
need to install connection drivers for some data sources before you can access them.
For more information on data sources and connection strings, see the SQL Server 2016 Technical
Documentation:
Data Connections, Data Sources, and Connection Strings (Report Builder and SSRS).
http://aka.ms/Bk1ixy
Design a Query
After selecting or configuring a new data source
connection, you must define the dataset for your
report. In the Report Wizard, on the Design the
Query page, you can type a query directly to define
the dataset. The query syntax required depends on
the type of data source you are querying. If the
data source supports it, you can use the Query
Designer graphical tool to generate the query.
For further considerations regarding queries, see the next lesson on creating datasets.
MCT USE ONLY. STUDENT USE PROHIBITED
3-4 Implementing Reports
Demonstration Steps
1. Ensure that both 10990B-MIA-DC and 10990B-MIA-SQL virtual machines are running, and then log
on to 10990B -MIA-SQL as ADVENTUREWORKS\Student with the password Pa$$w0rd.
5. On the File menu, point to Open, and then click Project/Solution. In the Open Project dialog box,
go to the D:\Demofiles\Mod03 folder, click Reports Demo.sln, and then click Open.
6. In Solution Explorer, right-click Reports, and then click Add New Report.
10. In the Query Designer dialog box, on the toolbar, click Add Table.
11. In the Add Table dialog box, click DimGeography, hold down the CTRL key, click DimReseller, click
FactResellerSales, click Add, and then click Close.
12. In the Query Designer dialog box, in the upper pane, select the following columns:
o Dim Geography.EnglishCountryRegionName
o DimGeography.StateProvinceName
o DimGeography.City
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 3-5
o DimReseller.ResellerName
o FactResellerSales.SalesOrderNumber
o FactResellerSales.OrderDate
o FaceResellerSales.SalesAmount
o EnglishCountryRegionName: Country-Region
o StateProvincename: State
o ResellerName: Reseller
16. On the Select the Report Type page, ensure that Tabular is selected, and then click Next.
17. On the Design the Table page, add all fields to the Details section then click Next.
18. On the Completing the Wizard page, in the Report name box, type Reseller Sales, and then click
Finish.
19. Click the Preview tab to view the report.
Sequencing Activity
Put the following steps in order by numbering each to indicate the correct order.
Steps
Lesson 2
Creating a Report
You can develop reports in both Report Designer and Report Builder. Report Designer is a professional
report authoring interface for the Visual Studio development environment that you can use to build and
publish reports in Visual Studio. Report Builder is a stand-alone report authoring tool aimed at business
users who prefer a Microsoft Office-style reporting environment.
This lesson describes how to use Report Designer and Report Builder to develop reports.
Lesson Objectives
After completing this lesson, you will be able to:
Publish a report.
Creating a Dataset
In the previous module in this course, you learned
how to define data sources for your reports. After
defining the data source, you must define the
datasets that contain the data to be displayed. A
dataset:
Depending on your choice of application, you can create one or more datasets for each data source in the
following ways:
Specify details for the data source on the Design the Query page of the Report Wizard.
In the Report Data pane, you can also convert an embedded dataset into a shared dataset.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 3-7
Dataset guidelines
When creating datasets, consider the following guidelines:
Include only columns required for display, sorting, or grouping in the report. Avoid using a SELECT *
statement; instead, you should list only the columns that are actually required.
Include only the rows required for the detail level of the report. For example, if you are creating a
report to show sales performance for each product, grouped by category, there is no need to include
the individual order rows. Instead, use a query with a GROUP BY clause that aggregates the orders by
product and category. Product-level aggregation in the query is then the detail level of the report.
Sort data in the query. Although you can sort data in a data region in a report, it is generally more
efficient to sort it in the query by using an ORDER BY clause.
Report body. This represents the body of your report, where you can drag items to define the layout.
Properties pane. This pane shows the properties of the selected item.
Report Data pane. This pane shows the data sources, datasets, parameters, and images you have
defined, in addition to built-in fields you can use in any report.
Toolbox. This shows the report items you can place in the report body.
Grouping pane. This pane shows the data groupings defined in your report; you can use it to define
and manage groupings to aggregate report data.
Preview tab. This tab previews the report, so you can verify how it is rendered before publishing.
Ribbon. Contains controls and tools for formatting, designing, and running reports.
Report design surface. This is the graphical report development area of Report Builder reached by
clicking Design in the Views section of the ribbon. You use this part of the interface to design a
report.
Report Data pane. This pane shows the data sources, datasets, parameters, and images you have
defined, in addition to built-in fields you can use in any report.
MCT USE ONLY. STUDENT USE PROHIBITED
3-8 Implementing Reports
Row groups/column groups pane. This pane shows the data groupings defined in your report; you
can use it to define and manage groupings to aggregate report data.
After adding a tablix data region to the report, you can specify the data it should display by dragging
fields from the Report Data pane into the appropriate space in the data region. A tablix data region can
only be bound to a single dataset; the first field you add creates this binding. Attempting to drag fields
from a second dataset into a data region results in an error.
Note: You can use lookup functions to include data from multiple related datasets in a
single data region.
Demonstration Steps
Create a Report in Report Designer
1. In Visual Studio, in Solution Explorer, right-click Reports, point to Add, and then click New Item.
2. In the Add New Item – Reports Demo dialog box, click Report, in the Name box, type Reseller
Sales 2 and then click Add.
3. In Solution Explorer, right-click Shared Datasets, and then click Add New Dataset.
4. In the Shared Dataset Properties dialog box, in the Name box, type MyDataset, in the Data source
list, click AdventureWorksDW, in the Query box, type the following code, and then click OK:
5. From the Toolbox, drag a Table item to the report design surface.
6. In the Dataset Properties dialog box, in the Name box, type MyDataset, and then in the list of
datasets, click MyDataset.
7. On the Fields page, change the Field Name values as shown in the following table, and then click OK:
Country_Region EnglishCountryRegionName
State StateProvinceName
Reseller ResellerName
8. In the Report Data pane, expand Datasets, expand MyDataset, and then drag each data item in
turn to the table header. If the available cells are full, position the item on the right-side border of the
table and a new cell will automatically appear.
9. From the Toolbox, drag a text box to the report design surface, aligning it with the top of the table.
2. On the Home page, in the toolbar, click New, then click Paginated Report.
7. In the Dataset Properties dialog box, in the Name box, type MyDataset, select Use a dataset
embedded in my report, and then click New.
8. In the Data Source Properties dialog box, in the Name box, type AdventureWorksDW, and then
click Use a connection embedded in my report.
10. In the Credentials pane, click Use current Windows user. Kerberos delegation might be required.
Then click OK.
11. In the Dataset Properties dialog box, in the Query box, type the following:
13. On the Fields page, change the Field Name values to match the following table, and then click OK.
Country_Region EnglishCountryRegionName
State StateProvinceName
Reseller ResellerName
14. On the Insert menu, click Table, and then click Insert Table.
15. Click anywhere on the report design surface to insert a new table.
16. In Report Data, expand Datasets, expand MyDataset, and then drag each data item in turn to the
table header. If the available cells are full, position the item on the right-side border of the table and
a new cell will automatically appear.
Page breaks
You can view reports online in a browser but, in
many cases, they are printed or exported to another
format for offline viewing and further analysis.
Reporting Services provides a number of ways to control how reports are divided into pages when they
are printed or rendered in a format that supports pagination. Pagination is particularly important when
working with groups; for example, you can then start a new page for each new instance of a group.
o The ResetPageNumber property causes page numbering to be restarted on the new page that
the page break generates.
o The PageName property specifies a name for the new page that the page break generates.
Some renderers, such as Microsoft Excel®, use page names to identify pages. You can set an
explicit value for this property, or you can use an expression to generate the value dynamically.
This can be used, for example, to specify the name of the employee in the grouped sales report
described in the previous topic.
o You can also set the Disabled property to disable a page break.
Setting the InitialPageName property of the report. This property defines the page name for the first
page in the report (or for all pages, if it contains no explicitly-defined page breaks).
In many cases, you might want to render the report data on multiple worksheets in Excel. One reason for
doing this is to make it easier for users to navigate the report data; for example, by creating a new
worksheet (and corresponding tab) for each employee grouping in the sales report described in the
MCT USE ONLY. STUDENT USE PROHIBITED
3-12 Implementing Reports
previous example. Another reason is that Excel enforces a maximum number of rows for each worksheet.
A very large report may not render successfully if it contains more rows than are available in a worksheet.
Setting a page break in a report causes the Excel rendering extension to generate a new worksheet. If the
page break includes a PageName property value, the worksheet is named accordingly. This means you
can design multiple-worksheet Excel-based reports that are easy to navigate.
Publishing a Report
After creating your reports, you can publish them to
a report server for viewing by users.
Property Description
Property Description
After you have set the project properties, you can publish reports, shared data sources, and shared
datasets from the project. To publish all items in the project, in Solution Explorer, right-click the project,
and then click Deploy. To publish an individual item in the project, in Solution Explorer, right-click the
item, and then click Deploy.
When you deploy a project or an individual item, the deployment status is shown in the Output pane.
Data regions
A data region displays data from a report dataset
and can be saved as a report part. When used
effectively, report parts can greatly reduce the
amount of work required to develop a reporting
solution by enabling reuse of work.
MCT USE ONLY. STUDENT USE PROHIBITED
3-14 Implementing Reports
As a document in an application: users open the report in an application, such as Microsoft Excel.
Reporting Services supports this range of options for viewing reports by using an extensible rendering
architecture, in which a report can be provided in any format, where a renderer is available. Each renderer
has its own strengths, limitations, and features, so understanding which renderers must be supported in
your reporting scenario can help optimize reports to suit the pagination, image support, and interactivity
available in your target formats. By default, Reporting Services includes renderers for the following
formats:
Microsoft Excel
Microsoft Word
XML
Web Archive
Image
Atom Feed
Note: When developing reports that might be rendered in multiple formats, test each
render format to ensure that the pagination and formatting provides the desired output.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 3-15
Demonstration Steps
Publishing a Report from Report Designer
1. In Visual Studio, in Solution Explorer, right-click Reports Demo, and then click Properties.
2. In the Reports Demo Property Pages dialog box, ensure the TargetServerURL property is set as
http://mia-sql/ReportServer_SQL2 and the TargetReportFolder property is set as Designer, and
then click OK.
3. In Solution Explorer, right-click Reseller Sales.rdl, and click Deploy. Wait for the deployment to
complete.
3. Double-click Builder and then in the Name box, type Reseller Sales, and then click Save. If the Save
As Report window appears, click Yes.
5. Click Builder, and then click Reseller Sales. Check that the report has been correctly published.
Verify the correctness of the statement by placing a mark in the column to the right.
Statement Answer
True or false? For every page break added into a report, the Excel rendering
extension will generate a new worksheet.
MCT USE ONLY. STUDENT USE PROHIBITED
3-16 Implementing Reports
Lesson 3
Show Data Graphically in a Report
While many reports contain only text and figures, some users prefer to view graphical representations of
business data. Reporting Services supports a range of data visualizations you can use to create graphical
reports that provide users with an intuitive understanding of key business metrics.
Lesson Objectives
After completing this lesson, you will be able to:
Use indicators to show trends and Key Performance Indicators (KPIs) in a report.
Images
You can enhance the appearance of a report by
including images—these are frequently used for the
following purposes:
Including a background image in a report. For example, an annual report for shareholders in a
bicycle manufacturing company might include a subtle image of the corporate headquarters as a
background watermark.
External. An image published in an external location such as a website. If you select this option, you
must specify the location of the image as a URL in the Use this image list box. Alternatively, if the
dataset used by the report includes a field containing a URL, you can select this field.
Embedded. An image that is embedded into the report. If you select this option, you can import an
image file to embed in the report.
Database. An image field in the dataset. If you choose this option, you must specify the field to bind
to the image control, and the Multipurpose Internet Mail Extension (MIME) type you want to use
when rendering the image.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 3-17
To display a background image for a report body or data region, set the following properties in the
BackgroundImage category of the Properties pane:
MIMEType. Specify the MIME type to be used for image data fields as described above.
BackgroundRepeat. Specify whether or not the image should be repeated to fill the background.
Charts
Charts provide a common way to express data
values visually. Many reports include a chart as a
visual summary of the detailed data in a table or
matrix, while others consist solely of a chart.
o Column charts
o Line charts
o Bar charts
o Area charts
o Range charts
o Scatter charts
o Polar charts
3. Select the chart to display the Chart Data pane, and then specify the fields the chart will display.
4. Add one or more data fields to the Values area to specify the fields to be plotted on the value axis of
the chart. For example, add a SalesAmount field from the dataset showing customer sales orders.
5. Add fields to the Category Groups area to create the data points for the chart. For example, add a
Year field from the sales orders dataset to show a summarized value for each year.
6. Add fields to the Series Groups area to plot values for multiple series. For example, add a Country
field from the sales orders dataset to show summarized sales values for each country.
MCT USE ONLY. STUDENT USE PROHIBITED
3-18 Implementing Reports
7. Edit the properties of the chart area and individual elements within it, such as axis titles, the chart
legend, and the chart title. You can use this to customize the appearance of the chart to suit your
requirements. You can also change the type of a chart if you later decide that the data would be
better represented using a different visualization. For example, you might change a column chart
showing sales grouped by year to a line chart displaying a trend over time more clearly.
1. On the Insert tab, click Chart and then click Insert Chart.
2. Drag an area on the design surface where you want the chart to appear.
4. Click the newly inserted chart so that the chart data drop zones appear.
5. Place the required data items from a dataset onto the chart drop zones.
Demonstration Steps
Add an Image to a Report in Report Designer
1. In Visual Studio, click Design to ensure you are in Design mode.
2. If the Toolbox is not visible, on the View menu, click Toolbox, and in the Toolbox, drag an Image
to the design surface.
3. Name the Image AdventureWorksLogo, and then click Import.
4. Go to the folder D:\Demofiles\Mod03, select the AdventureWorks.jpg image, click Open, and then
click OK.
5. Resize the image to an appropriate size and reposition it in the top right corner of the report above
the table.
2. Click the tablix data region so that the gray row and column headers appear, and click the gray box
where the row and column headers intersect at the top left to select the data region. Then drag the
multidirectional arrow handle to move the data region down about 10 centimeters.
3. If the Toolbox is not visible, on the View menu, click Toolbox, and in the Toolbox, drag a chart to
the blank area you just created above the tablix data region. Then in the Select Chart Type dialog
box, in the Shape section, select the third chart style (3-D Pie) and click OK.
4. Move and resize the chart to fit the available space above the tablix data region.
2. In the Chart Data pane, in the Values section, add the SalesAmount field.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 3-19
3. In the Chart Data pane, in the Category Groups section, add the Country_Region field.
4. Click the Preview tab and verify that the chart displays sales by country or region.
1. On the Design tab, click the Chart Title label, and press the F4 key. In the Properties pane, change
the Caption property to Reseller Sales by Geography.
2. Click a blank area just below the pie chart. Right-click the move icon (four arrows) and then click
Chart Properties.
3. In the Chart Properties dialog box, in the Color palette drop-down list, select any color palette, and
click OK.
5. Click the Export button, and then click Excel. When prompted, save the report as Reseller Sales.xlsx
in the D:\Demofiles\Mod03 folder, replacing any existing files.
6. Minimize Visual Studio, and then open the Reseller Sales.xlsx Excel workbook and view the exported
report, noting that the first worksheet contains the chart as an image. Then close Excel.
Add an Image to a Report in Report Builder
1. In Report Builder, click Design. On the Insert tab, click Image, and then click the top right corner of
the design surface, above the tablix.
3. Go to the folder D:\Demofiles\Mod03, select the AdventureWorks.jpg image, click Open, and then
click OK.
4. Resize the image to an appropriate size and reposition it in the top right corner of the report above
the tablix.
2. Click the tablix data region so that the gray row and column headers appear, and click the gray box
where the row and column headers intersect at the top left to select the data region. Then drag the
multidirectional arrow handle to move the data region down about 10 centimeters. You may have to
resize the page and footer to achieve this.
3. On the Insert tab, click Chart, click Insert Chart, and then click anywhere in the space above the
tablix.
4. In the Select Chart Type dialog, click 3-D Pie, and then click OK.
5. Resize and reposition the chart so it sits above the tablix on the left side of the page.
2. In the Chart Data pane, in the Values section, add the SalesAmount field.
3. In the Chart Data pane, in the Category Groups section, add the Country_Region field.
4. Click Run and verify that the chart displays sales by country or region.
MCT USE ONLY. STUDENT USE PROHIBITED
3-20 Implementing Reports
1. Click Design, double-click the Chart Title label, and change the chart title to Reseller Sales by
Geography.
2. Click a blank area on the report design surface, and then right-click the chart and click Chart
Properties.
3. In the Chart Properties dialog box, in the Color palette drop-down list, select any color palette, and
click OK.
4. Click Run to preview the report and view the formatted chart.
5. Click Export, and then click Excel. When prompted, save the report as Reseller Sales Builder.xlsx in
the D:\Demofiles\Mod03 folder.
6. Minimize Report Builder, and then open the Reseller Sales Builder.xlsx Excel workbook and view the
exported report, noting that the first worksheet contains the chart as an image. Then close Excel.
Although data bars and sparklines are similar, the key differences between them are:
You can use data bars to show multiple data points, but you typically use them to show a single value,
such as an annual sales total. You can include a data bar at any level of a table or matrix.
You can use sparklines to display multiple data points that are grouped by categories, such as sales
totals for a range of months. They work with aggregated data, and you can only use them in a group
level of a table or matrix.
1. In Report Designer: drag a data bar or sparkline item from the Toolbox and place it in an appropriate
cell in a table or matrix.
2. In Report Builder: on the Insert menu, click Sparkline, and then click in the appropriate cell in a table
or matrix.
o You can use sparklines to display most kinds of chart, including column, bar, line, area, pie, and
range charts. Only pie charts can be shown in three-dimensional (3-D) format.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 3-21
o You can only use data bars to display column or bar charts. These can be basic (in which each bar
or column represents a single value); stacked (in which multiple values are shown as different
colored ranges in the same bar or column); or 100 percent stacked (in which the bar or column
fills the available space and multiple values are shown as proportionally sized color ranges).
4. Select the data bar or sparkline to display the Chart Data pane, and then specify the fields to display.
5. Add one or more data fields to the Values area to specify the series and fields you want to show in
the chart. You can add multiple series and fields for each series. For example, you can create a
sparkline showing an employee’s monthly sales totals, together with their monthly sales quota.
However, you should bear in mind that the benefit of data bars and sparklines is that they are
compact. If you try to display too much data in such a small chart, you may confuse, rather than
inform, report users.
6. Add fields to the Category Groups area to outline the grouping that defines the categories for the
chart. For data bars showing only a single value, a category group is not required. For sparklines
where you want to show the value (for example, sales total) across a range of categories (for example,
months), you need to specify the field on which you want to aggregate the data.
7. Add fields to the Series Groups area to add a further grouping of the data. For example, for a
sparkline that shows sales grouped by month, you can add a series group to show monthly sales
grouped by product. Generally, series groups are more effective in full charts than they are in data
bars and sparklines.
In addition to the data settings, you can set a wide range of properties to format the colors and style of
the data bar or sparkline.
By default, the plot points and scale you use in an individual instance of a data bar or sparkline are
consistent only within the chart itself. For example, a sparkline might show that a salesperson had sales in
two months of the year and achieved substantially higher figures for one of those months than in the
other.
However, if you compare this salesperson with another in the same report, the individual plot locations of
the months may not align. This is because the first salesperson only started working two months ago, but
the other has been employed since the beginning of the year. If the months in the sparkline are not
aligned, users cannot make a month-by-month comparison between the two salespeople. Additionally,
the scale used to show the sales volume may vary between the sparklines—a large value for one month in
the first sparkline might not indicate the same volume of sales as a similarly-sized value in the second.
To resolve this issue, you can align the horizontal and vertical axes of the charts based on the data
grouping in which the charts are displayed. This ensures that the data is plotted on the same scale for all
instances of the sparkline or data bar in the grouping, which enables like-with-like comparisons.
MCT USE ONLY. STUDENT USE PROHIBITED
3-22 Implementing Reports
Indicators
Indicators are minimal gauges you can use to show
a particular icon in a report. They are commonly
used to show:
Ratings. For example, you can display a star that is proportionally filled to show customer satisfaction
levels.
Indicators are a useful way to show how various aspects of the business are performing against key goals
or metrics in a form that users can see quickly.
As a report author, you can use indicators in two ways by choosing the measurement unit on which you
want to base the indicator:
Numeric. The indicator icon is based on a numerical value. You must define the range of values to be
used, to determine how the indicator will be displayed, by specifying a start value and an end value
for each icon in the indicator set. These start and end values can either be absolute numbers or
derived at run time from an expression. Numeric indicators are useful when you want to show how a
particular data value compares to a target value; for example, to show how a salesperson’s sales total
compares to a quota.
Percentage. The indicator icon is based on a percentile across a specified data group. You must
specify the start and end values for each icon in the percentage range (usually 0 to 100). The indicator
will show the appropriate icon based on where, in that percentile range, a particular instance of a
data value falls across the grouping. The percentage scale is determined by the minimum and
maximum values specified for the indicator. In most cases, this is determined automatically by taking
the lowest value for the specified data field in the grouping as the minimum and the highest value as
the maximum. If you override the minimum and maximum values, any rows with a value outside the
range you specify will not have an indicator icon displayed. Percentage indicators are useful when you
want to show how rows in a data grouping compare with one another; for example, to grade
salespeople by the volume of sales they have achieved.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 3-23
Demonstration Steps
Add a Data Bar in Report Designer
1. Switch to Visual Studio. In Solution Explorer, expand Reports and then double-click the USA Sales by
State report.
2. Click Preview and observe that the report displays Sales values by state and year.
3. Click Design, right-click the [SalesYear] column on the tablix, point to Insert Column and then click
Outside Group – Left.
4. Double-click the header row of the new column and type Sales Volume.
5. From the Toolbox, drag a Data bar onto the report, in the detail cell under Sales Volume.
6. In the Select Data Bar Type dialog, select Bar, and then click OK.
7. Double-click the newly added Data bar and in the Chart Data dialog, click the plus symbol next to
Values, and then click SalesAmount.
2. Double-click the header row of the new column and type Trend.
3. From the Toolbox, drag a Sparkline onto the report, in the detail cell under Trend.
4. In the Select Sparkline Type dialog box, click Line, and then click OK.
5. Double-click the newly added sparkline, click the plus symbol next to Values, and then click
SalesAmount.
6. Click the plus symbol next to Category Groups, and then click SalesYear.
7. Click Preview to show the report with the newly added trend sparkline.
1. In Report Builder, click Design, click File, and then click Open.
2. In the Microsoft SQL Server Report Builder dialog box, click Yes.
3. Go to the Builder folder on the server and open the USA Sales by State report.
4. Click Run and observe that the report shows yearly sales values for each USA state.
5. Click Design, right-click the [SalesYear] header row, point to Insert Column, and then click Outside
Group – Left.
6. Double-click the header row of the new column and type Sales Volume.
7. Select the cell under Sales Volume, and on the Insert tab, double-click Data bar.
8. In the Select Data Bar Type dialog box, click Bar, and then click OK.
MCT USE ONLY. STUDENT USE PROHIBITED
3-24 Implementing Reports
9. Double-click the newly added Data bar and in the Chart Data dialog box, click the plus symbol next
to Values, and then click SalesAmount.
1. In Report Builder, click Design, right-click the [SalesYear] column on the tablix, point to Insert
Column, and then click Outside Group – Right.
2. Double-click the header row of the new column and type Trend.
3. Select the cell under Trend and on the Insert tab, double-click Sparkline.
4. In the Select Sparkline Type dialog box, click Line, and then click OK.
5. Double-click the newly added sparkline, click the plus symbol next to Values, and then click
SalesAmount.
6. Click the plus symbol next to Category Groups, and then click SalesYear.
Maps
You can display geographical data in a report by
adding a map that consists of one or more layers.
Each layer can define:
1. Drag a Map item from the Toolbox to the report body. This starts the New Map Layer wizard.
2. In the New Map Layer wizard, on the Choose a source of spatial data page, select a source for the
spatial data that will be used to define the map. This will define points, lines, or polygons that
represent spatial locations and features. You can obtain the spatial data for a map layer from:
o The map gallery provided with SQL Server Reporting Services. This contains a number of maps of
the United States.
4. On the Choose map visualization page, select the type of map you want to create. The options
available are:
o Basic map. This map shows spatial elements with no analytical data. Typically, a basic map shows
polygons that represent geographical areas, such as states or sales territories.
o Color analytical map. You can add analytical data to a basic map and use it to format areas in
different colors to represent the analytical values. For example, you can compare figures in
multiple sales territories by coloring or shading each territory, based on the sales value.
o Bubble map. You can use different sized bubbles to indicate analytical values for each area
shown by the map. For example, each sales territory can have a bubble at its center, with the size
of the bubble indicating the relative sales volume for that territory.
5. If you choose a map visualization that requires analytical data, on the Choose the analytical dataset
page, select an existing dataset or add a new one that includes the analytical data you want to
display. The analytical dataset must include a field in common with the spatial dataset, so you can
relate each instance of the analytical values to a spatial feature or location. For example, you might
define a map layer containing spatial data from a Transact-SQL query that returns the ID and
geographical location of each store, and analytical data from a query that returns the store ID and
total sales. You can then use the common field (the store ID) to match the analytical data (the total
sales) to the spatial data (the geographical location). Alternatively, you might create a map layer using
a US state map from the map gallery and add an analytical dataset that includes sales volumes
grouped by state code. You can then match the state code field in the analytical dataset to the United
States Postal Service (USPS) state code attribute in the US state map dataset.
6. In the New Map Layer wizard, on the Choose color theme and data visualization page, select a
visual theme and specify which field to visualize on the map. For example, you could visualize sales
data in an analytical dataset using a color rule that colors states on the map as a shade of green,
yellow, or red, depending on the sales volume for each state.
After you have added a map, you can add additional map layers, including Bing Maps imagery, by using
the Map Layer Wizard.
2. In the New Map wizard, on the Choose a source of spatial data page, select a source for the spatial
data that will be used to define the map. This will define points, lines, or polygons that represent
spatial locations and features. You can obtain the spatial data for a map layer from:
o The map gallery provided with SQL Server Reporting Services. This contains a number of maps of
the United States.
3. On the Choose spatial data and map view options page, select an appropriate map resolution and
size, and optionally add a Bing Maps layer to overlay the map with geographical imagery.
4. On the Choose map visualization page, select the type of map you want to create. The options
available are:
o Basic map. This map shows spatial elements with no analytical data. Typically, a basic map shows
polygons that represent geographical areas, such as states or sales territories.
MCT USE ONLY. STUDENT USE PROHIBITED
3-26 Implementing Reports
o Color analytical map. You can add analytical data to a basic map and use it to format areas in
different colors to represent the analytical values. For example, you can compare figures in
multiple sales territories by coloring or shading each territory based on the sales value.
o Bubble map. You can use different-sized bubbles to indicate analytical values for each area
shown by the map. For example, each sales territory can have a bubble at its center, with the size
of the bubble indicating the relative sales volume for that territory.
5. If you choose a map visualization that requires analytical data, on the Choose the analytical dataset
page, select an existing dataset or add a new one that includes the analytical data you want to
display. The analytical dataset must include a field in common with the spatial dataset, so you can
relate each instance of the analytical values to a spatial feature or location. For example, you might
define a map layer containing spatial data from a Transact-SQL query that returns the ID and
geographical location of each store, and analytical data from a query that returns the store ID and
total sales. You can then use the common field (the store ID) to match the analytical data (the total
sales) to the spatial data (the geographical location). Alternatively, you might create a map layer using
a US state map from the map gallery, and add an analytical dataset that includes sales volumes
grouped by state code. You can then match the state code field in the analytical dataset to the United
States Postal Service (USPS) state code attribute in the US state map dataset.
6. In the New Map wizard, on the Choose color theme and data visualization page, select a visual
theme, and specify which field to visualize on the map. For example, you could visualize sales data in
an analytical dataset using a color rule that colors states on the map as a shade of green, yellow, or
red, depending on the sales volume for each state.
After you have added a map, you can add additional map layers, including Bing Maps imagery, by using
the Map Layer Wizard.
Note: You can only use Bing Maps layers when connected to the Internet.
Demonstration Steps
Add a Map to a Report in Report Designer
1. Switch to Visual Studio, click Design, click the tablix data region so that the gray row and column
headers appear, and click the gray box where the row and column headers intersect at the top left to
select the data region. Then drag the multidirectional arrow handle to move the data region down
about 10 centimeters.
2. From the Toolbox, drag a Map item onto the report design surface above the tablix.
3. In the New Map Layer dialog box, click USA by State Exploded, and then click Next.
4. In the Choose spatial data and map view options dialog box, click Next.
5. In the Choose map visualization dialog box, click Bubble Map, and then click Next.
6. In the Choose the analytical dataset dialog box, click MyDataset, and then click Next.
7. In the Specify the match fields for spatial and analytical data dialog box, click the check box in
the Match Fields column next to STATENAME, in the Select a field drop-down list, select State, and
then click Next.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 3-27
8. In the Choose color theme and data visualization dialog box, clear Use bubble sizes to visualize
data, check the Use polygon colors to visualize data. In the Data field, select
[Sum(SalesAmount)], in the Color rule, select Red-Yellow-Green and then click Finish.
9. Rearrange the map and tablix on the design surface so the map is directly above the tablix.
10. Double-click Map Title and then, in the Properties pane set the (Text) property to Sales by State.
11. Double-click the map legend and then, in the Properties pane, change the (Hidden) property to
True.
12. Double-click the Map Distance Scale and then, in the Properties pane, change the (Hidden)
property to True.
13. Double-click the Map Color Scale and reposition in the bottom right of the map.
2. Click the tablix data region so that the gray row and column headers appear, and click the gray box
where the row and column headers intersect at the top left to select the data region. Then drag the
multidirectional arrow handle to move the data region down about 10 centimeters.
3. On the Insert tab, click Map, and then click Map Wizard.
4. In the Choose a source of spatial data dialog box, click USA by State Exploded, and then click
Next.
5. In the Choose spatial data and map view options dialog box, click Next.
6. In the Choose map visualization dialog box, click Bubble Map and then click Next.
7. In the Choose the analytical dataset dialog box, click SalesByRegion and then click Next.
8. In the Specify the match fields for spatial and analytical data dialog box, click the check box in
the Match Fields column next to STATENAME; in the Select a field drop-down list, select State, and
then click Next.
9. In the Choose color theme and data visualization dialog box, clear Use bubble sizes to visualize
data, check the Use polygon colors to visualize data; in the Data field select [Sum(SalesAmount)],
in the Color rule, select Red-Yellow-Green, and then click Finish.
10. Rearrange the map and tablix on the design surface so that the map is directly above the tablix.
11. Double-click Map Title, delete the text Map Title, and type Sales by State.
14. Double-click the Map Color Scale and reposition in the bottom right of the map.
Which object can you use to visually display aggregated data on a report?
Image
Chart
Data bar
Sparkline
Indicator
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 3-29
To accomplish this, you will create a report that includes a chart and add a map to an existing report.
Objectives
After completing this lab, you will be able to:
Create a report.
Password: Pa$$w0rd
2. Create a new shared dataset named InternetSales using the following query to retrieve data from
the AdventureWorksDW data source. (You can import this query from the
D:\Labfiles\Lab03\Starter\Sales Query.sql):
3. Create a tabular report named Internet Sales using the InternetSales dataset that includes the Year,
Month, ProductCategory, ProductSubcategory, Product, SalesOrderNumber, OrderDate, and
SalesAmount fields in the details section.
o To format text, select the text or text box in which it is displayed and use the formatting buttons
on the toolbar.
o To apply a number or date format, right-click the text box containing the data field and click
Text Box Properties. Then on the Number tab, select an appropriate format.
Results: After this exercise, you should have a report that shows product sales data from the
AdventureWorksDW database.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 3-31
1. Add a Chart
2. Add a chart to the report above the tablix data region. The chart should be a stacked column chart,
and you should resize it to fit the space above the tablix data region.
o Values: SalesAmount
o Category Groups: Month
o Series: ProductCategory
2. Edit the properties of the Month field in the Category Groups section so that the group is sorted by
the MonthNo field.
Results: After completing this exercise, you will have a report that includes a chart and an Excel output.
MCT USE ONLY. STUDENT USE PROHIBITED
3-32 Implementing Reports
2. Modify the report by adding a map item showing USA states colored based on their total sales values.
Results: After this exercise, you should have created a report that shows Internet sales by US state on a
map.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 3-33
To accomplish this, you will create a report that includes a chart and add a map to an existing report.
Objectives
After completing this lab, you will be able to:
Create a report.
Password: Pa$$w0rd
2. Using Report Builder, create a new data source named AdventureWorksDW connecting to the
AdventureWorksDW database.
MCT USE ONLY. STUDENT USE PROHIBITED
3-34 Implementing Reports
3. Create an embedded dataset named InternetSales using the following query to retrieve data from
the AdventureWorksDW data source. (You can import this query from the
D:\Labfiles\Lab03\Starter\Sales Query.sql):
4. Create a tabular report named Internet Sales using the InternetSales dataset that includes the Year,
Month, ProductCategory, ProductSubcategory, Product, SalesOrderNumber, OrderDate, and
SalesAmount fields in the details section.
2. Format the report to improve its visual style and legibility. Use the following formatting techniques as
required:
o To format text, select the text or text box in which it is displayed and use the formatting buttons
on the toolbar.
o To change column widths, drag the edges of the column headers.
o To apply a number or date format, right-click the text box containing the data field and click
Text Box Properties. Then on the Number tab, select an appropriate format.
Results: After this exercise, you should have a report that shows product sales data from the
AdventureWorksDW database.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 3-35
1. Add a Chart
2. Add a chart to the report above the tablix data region. The chart should be a stacked column chart,
and you should resize it to fit the space above the tablix data region.
o Values: SalesAmount
o Category Groups: Month
o Series: ProductCategory
2. Edit the properties of the Month field in the Category Groups section so that the group is sorted by
the MonthNo field.
Results: After completing this exercise, you will have a report that includes a chart and an Excel output.
MCT USE ONLY. STUDENT USE PROHIBITED
3-36 Implementing Reports
2. Using Report Builder, open the Internet Sales by State report which can be found in the server
path mia-sql/ReportServer_SQL2/Reports.
3. Modify the report by adding a map item showing USA states colored based on their total sales values.
2. Move the color scale to the bottom right of the map so it is not covering any state.
3. Run the report to view the chart. It may take a few minutes to load the data.
4. Close Report Builder without saving any changes, and then close Internet Explorer.
Results: After this exercise, you should have created a report that shows Internet sales by US state on a
map.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 3-37
Review Question(s)
Question: What considerations can you think of for including graphical elements in a
report?
MCT USE ONLY. STUDENT USE PROHIBITED
MCT USE ONLY. STUDENT USE PROHIBITED
4-1
Module 4
Configuring Reports
Contents:
Module Overview 4-1
Lab A: Create and Publish Reports That Include Parameters with Report
Designer 4-22
Lab B: Create and Publish Reports That Include Parameters with Report Builder 4-28
Module Review and Takeaways 4-34
Module Overview
It is very common for the requirements from businesses to continually change regarding the information
they require and how they need it to be presented. On viewing a detailed report, it is probable that senior
management will make requests for higher level, summarized, and filtered versions of the same report.
Report Builder and Report Designer support these scenarios via filtering, sorting, drilldowns, grouping and
the parameterizing of reports.
In this module, you will see how it’s possible to update existing reports to make them more dynamic and
useful to business users.
Objectives
After completing this module, you will be able to:
Lesson 1
Implementing Filters and Parameters
One of the simplest ways of making data more meaningful is to focus on specific datasets within that
data. The key to this simplification is to filter large amounts of data so that information can be derived
from it. SQL Server Reporting Services (SSRS) provides two complementary features, filtering and
parameters, to support filtering, and both are covered in this lesson.
Lesson Objectives
After completing this lesson, you will be able to:
Create parameters.
Dataset Filters
The simplest way to apply a filter is to add a WHERE clause to the query that is returning data. This
ensures that only the required data is being provided to the report. For example, on SQL Server,
additional indexes or stored procedures could be added to improve the performance of the query on the
source of the data.
Report Filters
Reports can have filters applied in a number of locations. You should consider where and how filters will
be used. For example, a filter could be added:
On a shared dataset. Set a filter on a dataset when you want multiple data regions or charts bound
to the same dataset to be filtered in the same way.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 4-3
On a data region. Set a filter on the data region when you want one or more data regions that are
bound to the same dataset to be filtered differently and therefore provide a different view of the
same dataset.
On a row or column group in a tablix. Set a filter on a group when you want to include or exclude
certain values for a group expression to control which group values appear in the table, matrix, or list.
On a detail group in a tablix. Set a filter on the details group when you have multiple detail groups
for a data region, and want each detail group to display a different set of data from the same dataset.
On the series or category groups in a chart. Set a filter on a series or category group when you
want to include or exclude certain values for a group expression to control which values appear in the
chart.
All of the above could use static data to filter the datasets. However, a far more common use of filters is to
use a value chosen, or entered, by the user of the report. Combining these user selected values
(parameters) with filters enables a single report to provide multiple different views of the same data. This
then increases the usability, and utility, of any reports that make use of them. Parameters are discussed in
detail in the rest of this lesson.
Dataset Parameters
Also referred to as a query parameter, the
purpose of a dataset parameter is to filter the
data returned by a SQL query.
Report Parameters
Report parameters can be associated with
dataset parameters, although they do not have
to be. If a report parameter is set to be visible, its
main purpose is to allow report users to interact
with the report.
As discussed in the previous topic, parameters can be used in conjunction with filters to provide different
views of the same data. However, report parameters can also be used in other ways as follows:
Select a value from one parameter, which determines the values that are available in another
parameter.
Run the report with a default parameter so that a user doesn’t have to select a value and click View
Report.
In summary, parameters control the data contained in a report—they can connect related reports
together—and enable a report user to vary the presentation of a report.
MCT USE ONLY. STUDENT USE PROHIBITED
4-4 Configuring Reports
Creating Parameters
Automatically
Parameters can be created automatically by
adding a query parameter to a dataset. This
dataset can either be a shared or embedded
dataset.
Using the previous query for a dataset would automatically create a @Year parameter in Report Designer
or Report Builder.
Manually
Within both Report Designer and Report Builder, it is possible to create report parameters. This can be
achieved by right-clicking the Parameters folder in the Report Data pane, and then clicking Add
Parameter. A dialog box then enables you to choose the properties for this new parameter.
Property Description
Name This is the name that will be used to dereference this parameter. It cannot
contain spaces. If this parameter has been automatically created, it will match
the defined query parameter.
Prompt The text shown in the report viewer toolbar of the running report.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 4-5
Property Description
Allow multiple If selected, the report user will see check boxes in the drop-down list of
values available values.
Available values The list of values that can be selected for this parameter.
Default values Default values can be hard coded, or selected via a query. If a default value
has been supplied, the report will run automatically when viewed.
These values are set in the Report Properties dialog box in both Report Designer and Report Builder. A
property not mentioned above has the ability to make a property hidden or internal. As a report designer,
you might choose to hide a parameter so that it can only be set via a URL, or on a published report on a
report server.
Whether a default value is used, and in some circumstances the value can be set. If the default value
is based on a query, then it is not possible to set the value.
Should this parameter be hidden, internal or visible?
Having the ability to modify parameters on published reports means the same report can be published to
different locations and have different default values. Consider the example of a Human Resources report
that shows all the employees of a department. If the department parameter is hidden, and the report is
deployed to each department’s SharePoint site, it could be hard coded to the correct department. The
report would load, showing only the employees for that department—there would be no way for the
report users to amend that parameter.
Demonstration Steps
Add a Parameter Automatically
4. On the USA Sales by State report, click the ellipsis (…) button, and then click MANAGE.
7. In the USA Sales by State - Microsoft SQL Server Report Builder window, in the Report Data pane,
expand Parameters, and then expand Datasets.
13. In the Year box, type 2010, and then click View Report.
Add Available Values to a Parameter
2. In the Report Data pane, right-click Datasets, then click Add Dataset.
3. In the Name box, type AvailableYears, then click Use a dataset embedded in my report.
6. Click OK.
7. In the Report Data pane, in Parameters, right-click Year, then click Parameter Properties.
8. In the Report Parameter Properties dialog box, on the Available Values page, click Get values
from a query.
12. On the Default Values page, click Get values from a query.
13. In the Dataset: (Warning: Possible performance impact) drop-down, select AvailableYears.
14. In the Value field drop-down, select Year, and then click OK.
16. Note that the report runs automatically and shows the figures for 2013.
You want to filter report data. Where is the most efficient place to specify the
filter?
On a row in a tablix.
On a data region.
Lesson 2
Implementing Sorting and Grouping
The majority of reports have some level of grouping. Most reports will aggregate detailed data to give
aggregates for each category of data. Aggregations can be created at different levels to provide subtotals
and totals.
Sorting data ensures that specific information can be found in a straightforward manner.
Lesson Objectives
After completing this lesson, you will be able to:
A typical sort expression will consist of a column to sort on and the direction of sorting—for example, A to
Z.
You can also sort on a value that isn’t contained in the source data. The sorting options on a tablix data
region offer the possibility of using a complex expression as the sort order.
For example:
If the previous example was used as a sort expression, sorting would be on the product name in the
“Product” dataset matching on a given ProductID.
For examples of complex expressions, see the SQL Server 2016 Technical Documentation:
You will see further examples of how to apply sorting in the next demonstration.
Interactive sorting
For some reports, it may be desirable to allow the report users to sort data contained in the tablix. Any
text box contained in a table can be set to have interactive sorting. Using this setting allows a report user
to click that text box in a rendered report and sort all the data in that column.
MCT USE ONLY. STUDENT USE PROHIBITED
4-10 Configuring Reports
Group expressions can also be manually created by specifying a grouping criteria. It is possible to change
a group expression after it has been created, whether that be automatically or manually.
Data can be grouped by a single field, multiple fields or parameters, conditional statements, or even
custom code. Once created, a group will be given a name, and this name can then be used to specify the
scope of aggregate calculations, or used to define the parent and child nodes in a drill-down report. Once
a report has groups defined within it, these groups can be used to add page breaks.
Details Group
The details group is the only group that has no
group expression. It represents the equivalent of
executing the dataset query against the
database. This group will contain a row for every
row in the query’s result set, and all the fields
specified by the query. Every table and list in a
report will usually contain a details group.
It is also possible to add a details group to an already existing report. When adding a group, selecting the
show detail data option enables the creation of a detail group.
The organization report would contain a table, associated with the previously described dataset. There
would be at least a details row group, grouped by employee ID. The recursive parent would then be set to
the manager ID.
A common way to display the hierarchical relationship in a table is to indent a field by the level where it is
in the hierarchy. A text box can use an expression to define the padding within a report.
In this padding expression example, the left padding for each level will be indented by 22 points.
MCT USE ONLY. STUDENT USE PROHIBITED
4-12 Configuring Reports
Demonstration Steps
Add Groups to an Existing Report
2. Navigate to D:\Demofiles\Mod04.
4. In the Sorting and Grouping.rdl[Design] design surface, click the Preview tab.
5. Note the table contains a row for each order in the InternetSales dataset.
6. In the Sorting and Grouping.rdl[Design] design surface, click the Design tab.
7. In the Row Groups pane at the bottom of the screen, right-click (Details), click Add Group, then click
Parent Group.
8. In the Tablix group dialog box, in the Group by drop-down, select [EnglishProductName].
9. Click OK.
10. In the Row Groups pane at the bottom of the screen, right-click [EnglishProductName], click Add
Group, then click Parent Group.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 4-13
11. In the Tablix group dialog box, in the Group by drop-down, select
[EnglishProductSubcategoryName].
12. Click OK.
13. In the Row Groups pane at the bottom of the screen, right-click
[EnglishProductSubcategoryName], click Add Group, then click Parent Group.
14. In the Tablix group dialog box, in the Group by drop-down, select
[EnglishProductCategoryName].
16. In the Sorting and Grouping.rdl[Design] design surface, click the Preview tab.
17. Note the grouping that has been applied, and the extra fields that are no longer required.
18. In the Sorting and Grouping.rdl[Design] design surface, click the Design tab.
19. On the report, in the table, click the cell containing Category. Right-click the gray button above the
Category cell.
21. Click the cell containing Subcategory. Right-click the gray button above the Subcategory cell.
23. Click the cell containing Product. Right-click the gray button above the Product cell.
24. Click Delete Columns.
25. In the Sorting and Grouping.rdl[Design] design surface, click the Preview tab.
1. In the Sorting and Grouping.rdl[Design] design surface, click the Design tab.
2. In the Row Groups pane at the bottom of the screen, right-click (Details), click Group Properties.
3. In the Group Properties dialog box, click Sorting in the left pane.
4. Click Add.
6. In the Sorting and Grouping.rdl[Design] design surface, right-click the top left cell containing
English Product Category Name. Click Text Box Properties.
7. In the Text Box Properties dialog box, click Interactive Sorting in the left pane.
11. In the Sorting and Grouping.rdl[Design] design surface, click the Preview tab.
12. Note that the orders are sorted by Order Date, and that interactive sorting is available on product
category.
13. Leave Visual Studio open for the next demonstration.
MCT USE ONLY. STUDENT USE PROHIBITED
4-14 Configuring Reports
In the Report Wizard, select Enable Drilldown in the Choose the Table Layout page for a tabular report
containing groups.
In an existing report containing groups, right-click a child group in the Groupings pane and click Group
Properties. In the Group Properties dialog box, on the Visibility tab, select Hide, select Display can be
toggled by this report item, and select the field in the parent group that you want viewers to use to
show or hide the group.
RenderFormat.IsInteractive. You can use this variable to determine if the render format supports
interactivity, such as drill-down functionality to show hidden groups.
RenderFormat.Name. You can use this variable to determine the specific rendering extension being used
and apply format-specific settings.
For example, the following expression could be used to set the Hidden property of a group in a tablix
data region. The group would then be hidden when rendered to an interactive format, but visible in
formats that do not support interactivity:
=Sum(Fields!SalesAmount.Value)
In any group level, you can use an aggregation function with a named scope to aggregate a field
value at another group level. For example, you could use the following expression in a Subcategory
group to show the total sales for each subcategory and how that compares with the total sales for the
Product_Category parent group:
Defining page breaks in tablix data regions, groups, and rectangles. You can define explicit behaviors for
page breaks by setting the BreakLocation, ResetPageNumber, and PageName properties in the
PageBreak category.
The BreakLocation property specifies where the page break should occur. For data regions and
rectangles, this can be before, after, or before and after the report element on which the page break is
defined. For groups, you can also specify that the page break should occur between instances. For
example, you can force a new page for each employee in a report that shows sales grouped by employee.
MCT USE ONLY. STUDENT USE PROHIBITED
4-16 Configuring Reports
The ResetPageNumber property causes page numbering to be restarted on the new page that the page
break generates.
The PageName property specifies a name for the new page that the page break generates. Some
renderers, such as Microsoft Excel, use page names to identify pages. You can set an explicit value for this
property, or you can use an expression to generate the value dynamically. This can be used, for example,
to specify the name of the employee in the grouped sales report described in the previous topic.
You can also set the Disabled property to disable a page break.
Setting the InitialPageName property of the report. This property defines the page name for the first
page in the report (or for all pages, if it contains no explicitly defined page breaks).
In many cases, you might want to render the report data on multiple worksheets in Excel. One reason for
doing this is to make it easier for users to navigate the report data; for example, by creating a new
worksheet (and corresponding tab) for each employee grouping in the sales report described in the
previous topic. Another reason is that Excel enforces a maximum number of rows for each worksheet. A
very large report may not render successfully if it contains more rows than are available in a worksheet.
Setting a page break in a report causes the Excel rendering extension to generate a new worksheet. If the
page break includes a PageName property value, the worksheet is named accordingly. This enables you
to design multiple-worksheet, Excel-based reports that are easy to navigate.
Demonstration: Implementing
Drillthrough Actions
In this demonstration, you will see how to add drillthrough actions to an existing report.
Demonstration Steps
Add a Drillthrough to a Summary Report
1. In the Reports Demo - Microsoft Visual Studio window, in the Solution Explorer pane on the right,
double-click Adding drillthrough actions.rdl.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 4-17
2. Right-click the bottom left cell in the table, and then click Text Box Properties.
3. In the Text Box Properties dialog box, in the left pane, click Action.
4. Click Go to report.
6. Click Add.
9. Click OK.
10. In the Adding drillthrough actions.rdl design surface, click the Preview tab.
11. In the report, click Accessories, and note that the report drills down to a summary report for
accessories.
12. In the Adding drillthrough actions.rdl design surface, click the Design tab.
13. On the design surface, right-click the cell containing [SalesOrderNumber], and then click Text Box
Properties.
14. In the Text Box Properties dialog box, in the left pane, click Action.
16. In the Specify a report field, in the drop-down, select Order Detail.
21. In the Adding drillthrough actions.rdl design surface, click the Preview tab.
22. Click SO51380, and note that an order detail report is shown for the clicked order.
You will mostly want to display data by country but, occasionally, you will want to
expand a country and display the data for regions within a country. What is the
most straightforward way to implement this?
Create a drillthrough action for each country that you might want to expand.
Create groupings by country and add a drilldown for the country column.
Lesson 3
Publishing a Report
Once you have created a report, it needs to be published to make it available to consumers. Before
publishing, it is useful to preview the report to ensure that it meets your requirements.
Lesson Objectives
After completing this lesson, you will be able to:
Preview reports.
View reports.
Previewing Reports
It is useful to preview reports before publishing.
Previewing reports is straightforward in both
Report Builder and Report Designer. Follow the
steps below and specify any required parameters:
Report Builder
To preview a report, click Run. If you preview the
report again it will use a cached copy of the data
to improve performance. To update the data,
click Refresh.
Report Designer
To preview a report in Report Designer, click the
Preview tab.
You can either publish an individual report or publish a project including all of the reports that it contains.
In Report Builder, you should specify the report server location when saving the report.
Report Builder
You should save the report in the SharePoint site.
Paths to external items must lead to items on the
report server and cannot reference the file
system. Using a fully qualified URL will ensure
that the reference to external items is correct.
Report Designer
To publish a report to a SharePoint site, you need
to alter the project properties. All URLs that you set must be fully qualified.
OverwriteDataSources. Should be set to True or attempts to publish a data source with the same
name as an existing data source will fail.
Viewing Reports
After a report has been deployed, users can view
it by performing the following steps:
2. Click the report. If the report has no parameters, or all parameters have default values, it will be
rendered in the browser.
3. Enter parameter values to filter the report as required, and click View Report to render it with the
specified parameters.
4. Use the Report Viewer toolbar to navigate the report by scrolling through pages or searching for a
specified text value.
5. Export the report to a file or click the feed icon to download the report as an atom feed.
Demonstration Steps
Publishing with Report Designer
2. Navigate to D:\Demofiles\Mod04.
4. In the Reports Demo - Microsoft Visual Studio window, in the Solution Explorer pane on the right,
right-click Reports Demo, then click Properties.
5. Ensure the TargetDatasetFolder is set to http://mia-sql/sites/adventureworks/Reports/Datasets.
11. In the Reports Demo - Microsoft Visual Studio window, in the Solution Explorer pane on the right,
right-click Reports Demo, then click Deploy.
15. Note that all the reports in the project have been deployed.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 4-21
When you are publishing a report to a SharePoint site with Report Builder, what
needs to be specified?
TargetReportFolder
TargetDataSourceFolder
TargetDatasetFolder
MCT USE ONLY. STUDENT USE PROHIBITED
4-22 Configuring Reports
Objectives
After completing this lab, you will have:
Your manager has requested that you enhance this report so that it can be limited to show data from a
specific year. Your manager would also like the report to open, by default, with the most recent year’s
data.
The main tasks for this exercise are as follows:
3. If the Visual Studio Just-In-Time Debugger dialog box appears, click No, cancel debugging.
Note: The crash is a symptom of the Virtual Machine environment and is linked to
restarting IIS. It can be ignored.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 4-23
2. Add a parameter to the report and set the available values equal to the AvailableYears dataset you
just created. Name the parameter Year. Set the prompt for the parameter to Choose a reporting
year.
3. Add a filter to the InternetSales dataset that equals the Year parameter you just created.
4. Preview the report and select 2012 as the year. Note that the chart and tabular data are filtered on
the chosen year.
2. Add a default value to the Year parameter and set it to the CurrentYear dataset.
3. Run the report and note that the report now opens with 2014 selected, and the results are displayed
without the need to click View Report.
2. In the footer, show when the report ran, and who ran the report. It should be Report created:
[&Execution Time] Created by: [&User ID].
3. Export the report into Excel and save it in the D:\Labfiles\Lab04 folder.
Enhanced an existing report to display the selected parameter, and used some built-in SSRS fields.
MCT USE ONLY. STUDENT USE PROHIBITED
4-24 Configuring Reports
You have been tasked to group the report by month, product category and subcategories. The report
should enable drilling down to specific sales orders, or viewing summary information by month.
Additionally, sales totals for each of these groups are required.
2. Add Grouping
3. Remove Unnecessary Report Items
3. When adding the groups, also add a footer to contain aggregation information you will add in
following steps.
1. By default, Report Designer will have added the text Total to several cells where it isn’t required.
2. After previewing the report delete all unnecessary cells containing the text Total.
2. Also add a page break before the group—this will create a summary worksheet when the report is
exported to Excel.
3. Change the properties of the group and set the PageName property to =Fields!Month.Value.
5. Close Excel.
Enhanced the Excel export so that the worksheets are named correctly.
4. Add a Sparkline
2. Set the values for the data bar to be SalesAmount, and the category group to be ProductCategory.
3. Preview the data bar by running the report and viewing page 2.
4. Edit the properties of the [Sum(SalesAmount)] to show the product category as a tooltip.
2. The sparklines should be for SalesAmount against OrderDate, with the interval set to Days.
2. Wait for Visual Studio to confirm it has successfully deployed the reports.
Results: After completing this exercise, you will have published and viewed an SSRS report in SharePoint.
MCT USE ONLY. STUDENT USE PROHIBITED
4-28 Configuring Reports
Objectives
After completing this lab, you will have:
Your manager has requested that you enhance this report so that it can be limited to show data from a
specific year. Your manager would also like the report to open, by default, with the most recent year’s
data.
The main tasks for this exercise are as follows:
Note: The crash is a symptom of the Virtual Machine environment and is linked to
restarting IIS. It can be ignored.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 4-29
2. View the current Internet Sales report, and note that the data starts at 2010.
2. Add a parameter to the report and set the available values equal to the AvailableYears dataset you
just created. Name the parameter Year, and set the prompt for the parameter to Choose a reporting
year.
3. Add a filter to the InternetSales dataset that equals the Year parameter you just created.
4. Run the report and select 2012 as the year. Note that the chart and tabular data are filtered on the
chosen year.
2. Add a default value to the Year parameter and set it to the CurrentYear dataset.
3. Run the report and note that the report now opens with 2014 selected, and the results are displayed
without the need to click View Report.
2. Add a footer to the report to show when the report ran, and who ran the report. It should be Report
created: [Execution Time] Created by: [User ID].
3. Export the report into Excel and save it in the D:\Labfiles\Lab04 folder.
Enhanced an existing report to display the selected parameter, and used some built-in SSRS fields.
MCT USE ONLY. STUDENT USE PROHIBITED
4-30 Configuring Reports
You have been tasked to group the report by month, product category and subcategories. The report
should enable drilling down to specific sales orders, or viewing summary information by month.
Additionally, sales totals for each of these groups are required.
2. Add Grouping
3. Remove Unnecessary Report Items
3. When adding the groups, also add a footer to contain aggregation information you will add in the
following steps.
Note: Hint: if you are unable to see the Row Group pane at the bottom of the window, use
the View menu to add a Grouping view.
2. Also add a page break before the group—this will create a summary worksheet when the report is
exported to Excel.
3. Change the properties of the group and set the PageName property to =Fields!Month.Value.
Enhanced the Excel export so that the worksheets are named correctly.
4. Add a Sparkline
2. Set the values for the data bar to be SalesAmount, and the category group to be ProductCategory.
3. Preview the data bar by running the report and viewing page 2.
4. Edit the properties of the [Sum(SalesAmount)] to show the product category as a tooltip.
Created a header.
Added a data bar to an existing report.
2. Click the ellipsis (…) next to InternetSales, then click the ellipsis (…) again, then click Manage Data
Sources.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 4-33
3. Connect to AdventureWorks.
5. Click the ellipsis (…) next to Visual Internet Sales, then click the ellipsis (…) again, then click Manage
Shared Datasets.
Results: After completing this exercise, you will have published and viewed an SSRS report to SharePoint.
MCT USE ONLY. STUDENT USE PROHIBITED
4-34 Configuring Reports
Report Builder and Report Designer support these scenarios via filtering, sorting, drilldowns, grouping and
the parameterizing of reports.
In this module, you have seen how it is possible to update existing reports to make them more dynamic
and useful for business users.
MCT USE ONLY. STUDENT USE PROHIBITED
5-1
Module 5
Create Mobile Reports
Contents:
Module Overview 5-1
Module Overview
This module introduces the design and publication of reports intended for consumption on mobile
devices, such as smartphones and tablets. Microsoft® SQL Server® 2016 Reporting Services (SSRS) includes
support for mobile reports, although different tools are used to design and publish mobile reports than
are used for the SSRS reports, discussed in the earlier modules of this course.
Objectives
After completing this module, you will be able to:
Use SQL Server Mobile Report Publisher to design and publish mobile reports.
MCT USE ONLY. STUDENT USE PROHIBITED
5-2 Create Mobile Reports
Lesson 1
Overview of SQL Server Mobile Reports
Designing mobile reports requires careful planning, due to the limitations of the mobile devices that they
will be viewed on. Traditional SSRS reports are likely to be difficult to interpret on a mobile device. You
also have to consider whether to use a data-first or design-first approach for your reports.
Lesson Objectives
After completing this lesson, you will be able to:
For more information about the visual components supported by mobile reporting, see the topic
Configuring Visualizations in the SQL Server 2016 Technical Documentation:
Configuring Visualizations
http://aka.ms/M4i2ah
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 5-3
For more information about the mobile reporting data model, see the topic Data model for SSRS mobile
reports in the SQL Server 2016 Technical Documentation:
Shared datasets
Mobile reports can use data drawn from Excel files, or from SSRS shared datasets. After a shared dataset is
created on your Reporting Services server, you can use it as the basis for a mobile report. In its current
version, the Mobile Report Publisher does not have the capability to create new shared datasets; you must
use Report Manager or SQL Server Data Tools (SSDT) to define new shared datasets. After data is
imported into the Mobile Report Publisher application, it is treated in the same way, whatever its source.
When a report based on a shared dataset has been published to SSRS, by default the report will query the
latest data from the data source each time the report is run. You can optionally configure caching for the
shared dataset; this causes SSRS to cache a copy of the query results and use the cached values to serve
the report. The report data in the cache is refreshed on a schedule that you define.
Note: Using an Excel file as a data source for a mobile report is covered in the next lesson
of this module.
MCT USE ONLY. STUDENT USE PROHIBITED
5-4 Create Mobile Reports
For more information about working with shared data sources in mobile reports, see the topic Work with
shared data sources in SQL Server Mobile Report Publisher in the SQL Server 2016 Technical
Documentation:
Work with shared data sources in SQL Server Mobile Report Publisher
http://aka.ms/Wcdrf0
You can also use the design-first approach to guide you when creating your data sources. The schema
and format of the simulated test data is a useful guide to the format that the final data source for the
report element should use. You can export the simulated data generated by Mobile Report Publisher to
an Excel file, which can be used to guide the creation of actual datasets.
For more information about design-first and data-first approaches to mobile report design, see Design
first or data first when creating SQL Server mobile reports in the SQL Server 2016 Technical
Documentation:
Design first or data first when creating SQL Server mobile reports
http://aka.ms/Lum3e7
For more information about working with simulated data in the design-first approach, see the topic Work
with simulated data in the SQL Server 2016 Technical Documentation:
Value. The value for the KPI. Can be set manually or be drawn from a dataset field.
Goal. The KPI goal. Optional. Can be not set, set manually, or drawn from a dataset field.
Status. The KPI status: Red, Amber, or Green (RAG). Optional. Can be not set, set manually, or drawn
from a dataset field.
Trend set. Comma separated values used to generate a trend line. Optional. Can be not set, set
manually, or drawn from a dataset field. If a dataset is used, it must be a column of numeric values.
Visualization. A trend line visualizing the trend set data. Can be none, a bar graph, a line graph, a
stepped line graph, or an area graph.
In common with other Reporting Services objects, you can configure object-level security to control which
users have permission to view the KPI.
Demonstration Steps
1. Ensure that the 10990B-MIA-DC and 10990B-MIA-SQL virtual machines are both running, and then
log on to 10990B-MIA-SQL as ADVENTUREWORKS\Student with the password Pa$$w0rd.
3. If a Visual Studio Just-In-Time Debugger dialog box shows an error relating to w3wp.exe, click No,
cancel debugging.
4. When setup steps are complete, open Internet Explorer, navigate to mia-sql/Reports_SQL2, click
MobileReports, and notice the two KPIs in the folder.
5. In the Sales Total KPI, click the ellipsis (…), and then click MANAGE. Notice that the KPI is
configured from a mixture of dataset data and manual data.
8. Click the title bar of the Total Sales KPI Linear gauge report element. Notice that the element
expands to fill the whole view. Click the title bar of the Total Sales KPI Linear gauge report element
again to return to the default view. This facility makes it easier to view detailed charts on small
screens.
11. In the Scorecard grid 1 region of the report, click Simulated Item A2. Notice that the values of all
the other reporting elements on the page change to reflect the subtotals for the simulated data item.
12. In the Scorecard grid 1 region of the report, click Simulated Item B1. Notice that the other
reporting elements again change to reflect your selection.
13. In the Scorecard grid 1 region of the report, click All to return to the overall summary view.
16. Notice that the All section of the time navigator (the unlabeled element in the top left of the report)
is selected. Notice that the other bar graph shows data by year.
17. In the time navigator click 2013. Notice that the bar graph changes to show values by month. Also
notice that the values on the Sales by State map update; the map now shows aggregated data for
the previous year.
20. On the left, click Media and demonstrate that the tree map adjusts to show data related to Media.
Verify the correctness of the statement by placing a mark in the column to the right.
Statement Answer
True or false? When you follow the design-first approach to mobile report
development, you configure your data sources before designing your report.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 5-7
Lesson 2
Preparing Data for Mobile Reports
SQL Server mobile reports can determine links between datasets and filter data accordingly, but this
ability is reliant on report data being properly formatted. Report performance can be significantly affected
by the amount of data aggregation that must be carried out when the report is generated. This lesson
introduces some considerations for preparing data for use in mobile reports, including formatting and the
pre-aggregation of data.
Lesson Objectives
After completing this lesson, you will be able to:
Aggregated datasets can be substantially smaller in size than the source data from which they are drawn.
The smaller the dataset, the faster the report can be generated.
When you use SSRS datasets as sources for your mobile reports, it will typically be more efficient to carry
out aggregations as part of the source query, rather than relying on Reporting Services to perform the
aggregation. Aggregation in the source query gives you the opportunity to address query performance
issues by indexing, or other performance tuning techniques. Minimizing the aggregation performed by
Reporting Services also helps you to make the most of dataset caching; you can configure Reporting
Services shared datasets to cache their results for a period of time before re-querying for the original data
source. Report performance is at its best if the cached data can be used in reports that require no further
aggregation.
MCT USE ONLY. STUDENT USE PROHIBITED
5-8 Create Mobile Reports
There is, however, a trade-off between optimizing your reports by aggregating data at source, and
creating datasets that are reusable for multiple reports—the more aggregated the data in a dataset, the
less likely it is that you can use it for multiple reports. You should be prepared to produce aggregated
datasets for your most commonly used queries.
04/02/2016
2016-04-02
04/02/2009 16:57:32.8
2016-04-02 16:57:32.8
2016-04-02T16:57:32.8375298-04:00
When you use a shared dataset from a data source that uses date and time data types—such as a SQL
Server database or an Analysis Services cube—dates and times will normally be presented in a suitable
format by default, providing that the date and time data types are used in the source data. You will
typically have to consider date formatting when working with data that isn’t typed, or data from Excel
files.
Correct date and time formatting is most important for reports filtered by a time navigator.
For example, the following data could use country or region as a filter key, but not a combination of
country and region:
Country Region
Benin Africa
Botswana Africa
Armenia CIS
Belarus CIS
Andorra Europe
You can also define hierarchical key filters for use with a Selection List navigator. To use this facility,
prepare a lookup table that describes the hierarchy as an adjacency list, with a column for the filter key
and a second column for the parent filter key.
For example, the following table shows the country and region data from the previous example formatted
as a lookup table describing a hierarchy:
Key ParentKey
Africa
Arab States
CIS
Europe
North America
South/Latin America
Benin Africa
Botswana Africa
MCT USE ONLY. STUDENT USE PROHIBITED
5-10 Create Mobile Reports
Key ParentKey
Armenia CIS
Belarus CIS
Andorra Europe
For more information about formatting data, see the topic Prepare data for SQL Server mobile reports in
the SQL Server 2016 Technical Documentation:
You can have more than one worksheet with the same name, but Mobile Report Publisher will
rename them when they are imported. For example, if you have two worksheets named SalesData,
the imported datasets will be named SalesData0, and SalesData1.
Use the first row of each worksheet for column headers, and name the columns appropriately.
Although having a column header is not a necessity, any unnamed columns will be named
automatically on import with the Excel naming convention of A, B, C ... AA, BB, and so on.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 5-11
When importing data from Excel, Mobile Report Publisher compares the data types of the first two
rows in each column to detect the data type. If you have a numeric column name, prefix this with a
string value before importing the data, so that Mobile Report Publisher can determine this to be the
header.
Keep the data type the same within each column. Mobile Report Publisher scans each column to
establish the data type; this process can fail or cause issues if you have mixed types.
Consider where you store the Excel files that you use to import data. The location does not matter,
but if you move or delete a report, you will not be able to refresh the data if it changes.
If you have formulas in your worksheets, make sure all cells in the column are calculated using the
same formula.
Custom objects such as PivotTables, visualizations, and images, will not be imported into Mobile
Report Publisher.
Always use Microsoft Excel 2007 or later, so that files are saved with the .xlsx extension.
For more information about preparing Excel files for use in mobile reports, see the topic Prepare Excel
data for SQL Server mobile reports in the SQL Server 2016 Technical Documentation:
Firewall settings
You should confirm that firewall settings on your
report server and on your network infrastructure
can accept the connections you wish to support. To
provide access to mobile reports from mobile
devices outside your network, you should make one
or more Reporting Services HTTP endpoints
accessible from the public Internet. Access to
mobile reports requires no further firewall settings
in addition to those required to permit connections
to Reporting Services.
For more information about configuring firewalls to grant access to Reporting Services, see the topic
Configure a Firewall for Report Server Access in the SQL Server 2016 Technical Documentation:
Native mode
Access to mobile reports through the Power BI app is only supported by a Reporting Services instance
running in native mode. Power BI access is not supported by a Reporting Services instance running in
SharePoint® Integrated mode.
Basic authentication
For access through the Power BI app, Reporting Services must be configured to accept basic
authentication. Basic authentication is disabled by default, and is enabled by adding a section to the
<Authentication> section of the RSReportServer.config file.
When you use basic authentication, user names and passwords are sent to the server in plain text; for this
reason, you should configure SSL for Reporting Services instances. After SSL is configured, connections to
Reporting Services can be made over HTTPS, meaning that all reporting traffic is encrypted.
Note: It is not necessary to register a Reporting Services instance for Power BI to provide
access to mobile reports through the Power BI app.
For more information about configuring Reporting Services for access to mobile reports, see the topic
Enable a report server for Power BI Mobile access in the SQL Server 2016 Technical Documentation:
For more information about enabling basic authentication, see the topic Configure Basic Authentication on
the Report Server in the SQL Server 2016 Technical Documentation:
For more information about configuring SSL, see the topic Configure SSL Connections on a Native Mode
Report Server in the SQL Server 2016 Technical Documentation:
How many datasets should you have per Excel worksheet, for use as a data source for
a mobile report?
One
Two
Any number
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 5-13
Lesson 3
SQL Server Mobile Report Publisher
This lesson introduces the SQL Server Mobile Report Publisher application, and how you use it to
configure, design, and publish mobile reports.
Lesson Objectives
After completing this lesson, you will be able to:
Accessing SSMRP
SSMRP is not installed as part of SQL Server setup.
You access SSMRP by downloading it from the
Microsoft website, either directly, or from the link in
the Reporting Services portal.
Data. Manage datasets and configure how datasets link to visual components and to each other on
the Data tab. Unlike other SSRS tools, such as Report Builder and Report Designer, SSMRP does not
include tools for writing queries against data sources. You must import source data from Excel files or
from Reporting Services shared datasets.
Settings. Configure settings for the report, such as the report name, currency code, and first day of
the week on the Settings tab.
Preview. Use the Preview tab to interact with a preview of the published report.
MCT USE ONLY. STUDENT USE PROHIBITED
5-14 Create Mobile Reports
Adding Datasets
SSMRP uses a simple data model whereby data is
imported into the report as a collection of data
views. You do not have to establish formal
relationships between data views, and providing the
key values match, lookups between one data view
and another will work. The mobile report runtime
can match date and time aggregations between
different data views, even when the granularity is
different between the views.
SSRS dataset. Create a server connection to one or more instances of Reporting Services. Browse the
list of datasets published on the server, and choose one to add. You can add further datasets
separately. The data from Reporting Services will always be up to date, so you do not have to refresh
it. The supported data sources comprise those supported by Report Builder and SQL Server Data
Tools, including but not limited to Microsoft Azure SQL Database, Microsoft SQL Server Analysis
Services for MDX, Tabular, Microsoft Power Pivot, and DMX models, Oracle, Teradata, Microsoft
SharePoint List, and XML.
For a complete list of supported data sources and more detailed information, see the topic Data Sources
Supported by Reporting Services (SSRS) in the SQL Server 2016 Technical Documentation:
You import datasets using the Add Data button on the Data tab of SSMRP.
Demonstration Steps
Format Excel Data for Use in a Mobile Report
1. Using File Explorer, navigate to D:\Demofiles\Mod05, and then double-click report_data.xlsx to
open the workbook in Excel. To make the data in the Sheet1 worksheet suitable for use in mobile
reports, each dataset be moved to a separate worksheet.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 5-15
2. On the Home tab, in the Cells group, click the Insert drop-down arrow, and then click Insert Sheet.
A new sheet called Sheet2 is added to the workbook.
3. In Sheet1, select the cell range F4:G11, right-click the highlighted area, and then click Copy.
4. In Sheet2, click cell A1, right-click the highlighted area, and then click Paste.
5. Repeat steps 2 and 4 to copy the data in Sheet1!A1:D36 to a new worksheet called Sheet3.
1. On the Start page, type Microsoft SQL Server Mobile Report Publisher, and then press Enter. The
application opens with an empty report.
2. On the Data tab, click Add data, and then click Excel.
3. In the Open dialog box, navigate to D:\Demofiles\Mod05, and then double-click report_data.xlsx.
4. In the Add data window, select the Sheet1, Sheet2, and Sheet3 check boxes, and then click Import.
The data from the three sheets is imported to SSMRP.
5. Click Sheet1 and scroll right to demonstrate that all the data from the different regions on the
worksheet has been imported, making it unsuitable for use in a mobile report.
6. On the Sheet1 tab, click the cog icon, and then click Remove.
2. On Sheet2, click cell B7, type Rebecca Green, and then press Enter.
4. In SSMRP, click Sheet2, then click Refresh all data. Notice that the dataset updates to reflect the
changes you made in the Excel file.
2. If the Connect to a server dialog box appears, in the Server address box, type mia-
sql/Reports_SQL2.
3. Clear the Use secure connection check box, and then click Connect.
4. In the Add data from server dialog box, click mia-sql/Reports_SQL2, click Builder, and then click
SalesByRegionAndYear. The result set will be imported.
5. Leave SSMRP open for the next demonstration.
MCT USE ONLY. STUDENT USE PROHIBITED
5-16 Create Mobile Reports
Designing Reports
You design a mobile report using the Layout tab in
SSMRP, by dragging report elements from the
gallery on the left of the tab onto the design grid
on the right. Report elements divide into two
categories—navigators and visualizations.
Navigators
Navigators are controls that can filter the values
displayed on a report to a subset of the dataset,
either by selecting a range of values or an
individual value. A report can include more than
one navigator, in which case they can be used to
create multiple filters. Three types of navigator are
available:
Time navigator. Use to filter report data by a time range. By default, any dataset in the report with a
date and time column will be filtered by the time navigator. If a dataset contains more than one date
and time column, the first column will be used for filtering.
Selection list. Use to filter report data by a string or a numeric value. You configure a key column
and a label column from your source data for the selection list—these can be the same column. After
the key column is defined, you can link other datasets in the report to be filtered on the key. Values
that match the selected key will be displayed on the report. The key data for a selection list can be
hierarchical.
Scorecard grid. Like a selection list, you can use a scorecard grid to filter report data by a string or a
numeric value; the key column, label column, and filtered datasets are defined in the same way as for
a selection list. A scorecard grid can also display value columns and score indicators for each row; by
default, two scores are displayed (Status and Trend), but you can add or remove scores and values as
required by your report.
For more information about configuring mobile report navigators, see the topic Configuring navigators in
the SQL Server 2016 Technical Documentation:
Configuring navigators
http://aka.ms/Se0mbf
Visualizations
Visualizations are report elements that display data from one or more report datasets. They are not
interactive, although the data they display can be filtered by one or more navigators on the report. The
following types of visualization are available:
Gauges. Gauges display a single numeric value, or a numeric value in comparison to a second
numeric value. SSMRP provides 11 types of gauge. Gauges can be configured to carry out
aggregation calculations if the source dataset contains more than one row; the aggregation operators
that are available include sum, count, average, minimum, and maximum. Some gauge types can also
be configured to show RAG status, or a trend indicator.
Charts. Mobile report charts are configured in a similar fashion to charts in Excel. One or more data
series can define the x-axis and the y-axis. The following chart types are available:
o Time chart. The x-axis is the first date and time column in the source dataset.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 5-17
o Totals chart. The sum of each group in the main data series is presented as a bar on the chart.
Groups can be configured based on rows or on columns in the source dataset.
o Comparison chart. Time charts, category charts, and totals charts can optionally be configured
with a secondary data series against which the values from the main series are compared.
Pie and funnel charts. A segmented view of the dataset, which can be configured by rows or by
columns.
TreeMap. Values from the dataset are compared by relative area. Color can be used to indicate a
comparison against a second series of data values. TreeMaps can be configured to display a hierarchy,
where the members of each group appear together on the grid.
Maps. SSMRP includes 10 geographical maps; you can upload custom maps using ESRI shapefiles.
When you use a map visualization, rows in your dataset must match the values of the region names in
the map definition. Maps can be used as the basis of three different types of visualization:
o Gradient heat map. Data series values are mapped to a color gradient, which is used to shade
map regions.
o Bubble map. Data series values control the radius of a circle shown over the center of each map
region.
o Range stop heat map. The main data series is compared against a secondary data series. You
define a gradient that determines whether a region will be red, amber, or green, based on the
main series data value as a percentage of the secondary series data value.
DataGrids. DataGrids show data in a tabular form. Three types of DataGrid are available:
o Indicator DataGrid. A tabular representation of the dataset, with one or more indicator columns
for each row based on the delta between two values in the source dataset. The indicator column
can be configured to use one of several visualizations.
o Chart DataGrid. A tabular representation of the dataset. One or more indicators can be included
as in an indicator DataGrid. The DataGrid can also include one or more chart columns, which
indicate trend data; the data for the chart is typically derived from a second dataset.
For more information about configuring visualizations in mobile reports, see the topic Configuring
Visualizations in the SQL Server 2016 Technical Documentation:
Configuring Visualizations
http://aka.ms/M4i2ah
For more information about using maps in mobile reports, see the topic Maps in SQL Server mobile
reports in the SQL Server 2016 Technical Documentation:
Demonstration Steps
1. In SSMRP, click Settings, in the Report title box, type Regional Sales.
2. On the Layout tab, click and drag a Selection List navigator from the gallery onto the top left cell of
the design grid.
3. Grab the sizer and expand the selection list to fill two grids across and three down.
4. In the Visual properties region, in the Title box, type Region Selector.
5. On the Data tab, under Report elements, click Region Selector.
7. In the Filter these details when a selection is made region, select the Sheet2 and Sheet3 check
boxes.
9. On the Layout tab, notice that the contents of the selection list now reflect the values from the
dataset.
10. Click and drag a Simple data grid from the gallery onto the first empty cell at the top left of the
design grid to the right of the selection list.
11. Grab the sizer and expand the Data Grid to fill three grids across and three down.
12. In the Visual properties region, in the Title box, type Sales Person.
15. In the Data properties region, in the Data for the grid view list, click Sheet2.
16. On the Preview tab, in the Region Selector list, click on each region name and notice that the
content of the Sales Person grid does not change, and then click the back button.
18. In the Data properties region, click Options, select the Region Selector check box, and then click
Done.
19. On the Preview tab, in the Region Selector list, click on each region name and notice that the
content of the Sales Person changes according to the selected region, and then click the back
button.
20. On the Layout tab, click and drag a Radial gauge from the gallery onto the first empty cell under the
selection list in the design grid.
21. Grab the sizer and expand the gauge to fill two grids across and two down.
22. In the Visual properties region, in the Title box, type Total Value.
25. In the Neutral start box, type 90.00 %, and then click Done.
27. In the Data properties region, in the Main value list, click Sheet3, and in the adjacent list, click
Actual.
28. In the Comparison value list, click Sheet3, and in the adjacent list, click Estimated. Notice that the
comparison value does not have to come from the same dataset as the main value.
29. On the Layout tab, on the design grid, click the Total Value gauge, click the cog icon at the top right
of the gauge, and then click Copy.
30. Click the top left empty cell beneath the Sales Person data grid, click the cog icon at the top right of
the cell, and then click Paste.
31. In the Visual properties region, in the Title box, type Regional Value.
32. On the Data tab, click Regional Value.
33. In the Data properties region, next to the Main value lists, click Options, ensure that Region
Selector is selected, and then click Done.
34. Next to the Comparison value lists, click Options, ensure that Region Selector is selected, and then
click Done.
35. On the Preview tab, click on each region name in the Region Selector list, and notice that the Total
Value gauge always displays the same value (because it is not filtered by the selection list). By
contrast, the Regional Value gauge changes to reflect the currently selected region, and then click
the back button.
36. Leave SSMRP open for the next demonstration.
Master view
The master view is the default design grid that you
see when you create a new mobile report. By
default, the master view grid is 10 cells wide by five cells high. The master view is typically used by client
browsers using 16:9 or 16:10 aspect ratios. The master view is the only view where you can add new
elements to the report.
Tablet view
Tablet view is presented to devices running in an aspect ratio close to 3:4—these are typically tablet
devices. By default, the design grid for tablet view is six cells wide by eight cells high.
MCT USE ONLY. STUDENT USE PROHIBITED
5-20 Create Mobile Reports
Phone view
Phone view is presented to devices running in an aspect ratio close to 3:2—these are typically mobile
devices running in portrait mode. By default, the design grid for phone view is four cells wide by six cells
high.
Customizing views
You can change the grid sizes for all three report views using the column and row sliders in the top right
of the Design tab.
Demonstration Steps
Define Tablet View
1. In SSMRP, demonstrate that the view in which you have been working is the master view.
2. On the Layout tab, in the top right of the window, in the view drop-down list, click Tablet. Notice
that the design grid is empty, and the element gallery has been replaced with the Control Instances
gallery.
3. Click and drag the Total Value gauge from the gallery onto the top left cell of the design grid. Grab
the sizer and expand the gauge to fill three grids across and three down.
4. Click and drag the Regional Value gauge from the gallery onto the first empty cell to the top right of
the Total Value gauge. Grab the sizer and expand the gauge to fill three grids across and three
down.
5. Click and drag the Region Selector list from the gallery onto the top left empty cell below the Total
Value gauge. Grab the sizer and expand the selection list to fill six grids across and five down.
6. On the Preview tab, click the Regional Value text to expand the Regional Value gauge to fill the
screen.
7. Click the Regional Value text to return to tablet view, and then click the back button to return to the
Layout tab.
1. On the Layout tab, in the top right of the window, in the view drop-down list, click Phone.
2. Customize the phone view by changing the value of the Grid rows slider to 5.
3. Click and drag the Region Selector list from the gallery onto the top left cell of the design grid. Grab
the sizer and expand the selection list to fill four grids across and one down.
4. Click and drag the Total Value gauge from the gallery onto the top left empty cell below the Region
Selector list. Grab the sizer and expand the gauge to fill two grids across and two down.
5. Click and drag the Regional Value gauge from the gallery onto the first empty cell to the top right of
the Total Value gauge. Grab the sizer and expand the gauge to fill two grids across and two down.
6. Click and drag the Sales Person DataGrid into the top left empty cell. Grab the sizer and expand the
grid to fill four grids across and two down.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 5-21
7. On the Preview tab, notice that the selection list is rendered as a drop-down box, and then click the
back button to return to the Layout tab.
Color palette
You can change the overall color palette of your
report by using the color palette selector, found in
the top right of the Layout tab. You have 30
predefined palettes to choose from.
Publishing
Mobile report definitions can be saved to a file in the Windows file system, with an .rsmobile extension.
You can publish your mobile reports to an SSRS 2016 instance that you have permission to write to. After
publishing, mobile reports are accessible to users through the new Reporting Services portal.
You can open a mobile report definition from the file system or from SSRS using SSMRP.
Note: The .rsmobile file written to the file system is a ZIP archive of several different files
that make up the mobile report definition. Using suitable software, you can open an .rsmobile file
to better understand how mobile reports function.
Demonstration Steps
Set Palette and Publish Report
1. On SSMRP, on the Layout tab, click the color palette selector, click the Green palette, and then click
Done.
3. In the Save mobile report as dialog box, click Save to file system.
MCT USE ONLY. STUDENT USE PROHIBITED
5-22 Create Mobile Reports
4. In the Save As dialog box, in the File name box, type D:\Demofiles\Mod05\Regional
Sales.rsmobile, and then click Save.
5. On the menu bar, click Save mobile report as.
6. In the Save mobile report as dialog box, click Save to Server, in the Location box, type
/MobileReports, and then click Save.
7. Close SSMRP.
4. In Internet Explorer, click 520x730 - tablet. This starts a new browser window in a tablet aspect ratio.
5. In the new browser window, click Regional Sales. This is the tablet view of the report. Close the tablet
view window.
6. Click 400x640 - phone. This starts a new browser window in a phone aspect ratio. In the new
browser window, click Regional Sales. This is the phone view of the report. Close all Internet Explorer
windows.
Verify the correctness of the statement by placing a mark in the column to the right.
Statement Answer
True or false? You use SSMRP to write queries that define datasets for a
mobile report.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 5-23
Objectives
After completing this lab, you will be able to:
Password: Pa$$w0rd
2. Import all three worksheets in the Excel file call_center_data.xlsx in the D:\Labfiles\Lab05\Starter
folder into the mobile report as datasets.
Results: At the end of this exercise, you will have defined datasets for your new report.
MCT USE ONLY. STUDENT USE PROHIBITED
5-24 Create Mobile Reports
4. Add Numbers
2. On the Data tab, connect Time Navigator 1 to the AbandonedCalls dataset. Use Calls and
AbandonedCalls as the measures for the series for the background chart. Use AbandonedCalls as
the measure for the comparison series. Preview the report when you have finished configuring the
time navigator.
o Show Legend: On
2. On the Data tab, connect Abandoned Calls to the AbandonedCalls dataset. Use Calls and
AbandonedCalls as the measures for the main series for the background chart. Preview the report
when you have completed configuring the pie chart.
2. On the Data tab, connect Call Center Staff to the SalesEmployees dataset. Use BusinessEntityID as
the list of keys and Employee as the list of labels. Configure Call Center Staff to filter the
PhoneSalesCommission and SalesTarget tables, on the BusinessEntityId column.
2. Add another number, below the first number, that is one cell high and two cells wide. This number
should have the following visual properties:
3. On the Data tab, connect Total Sales to the PhoneSalesCommission dataset. Use SalesAmount as
the number value.
4. Connect Sales Target to the SalesTarget dataset. Use SalesTarget as the number value.
o Range Stops:
Maximum: 150%
Neutral End: 100%
Neutral Start: 90%
Minimum: 0%
2. On the Data tab, connect the main value of Sales Target Progress to the PhoneSalesCommission
dataset, using SalesAmount as the main value. Connect the comparison value of Sales Target
Progress to SalesTarget, using SalesTarget as the comparison value. Ensure that both values are
filtered by Call Center Staff. Preview the report when you have finished configuring the progress bar.
Leave SSMRP open for the next exercise.
Results: At the end of this exercise, you will have created the master view of a mobile report definition,
and linked the view to datasets.
MCT USE ONLY. STUDENT USE PROHIBITED
5-26 Create Mobile Reports
2. Save the report to a local file called Call Center Metrics.rsmobile in D:\Labfiles\Lab05\Starter.
3. Save the report to the MobileReports folder of the mia-sql/Reports_SQL2 reporting server.
4. Close SSMRP.
2. Use the browser to open browser_size.html in D:\Labfiles\Lab05\Starter. Use the buttons in the
page to view the report in mobile and tablet views. Close all Internet Explorer windows when you
have finished using the report.
Results: At the end of this exercise, you will have published a mobile report to the MobileReports folder
on the http://mia-sql/Reports_SQL2 reporting server.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 5-27
2. Observe the new mobile KPI in the folder, then close Internet Explorer.
Results: At the end of this exercise, you will have created a KPI on the server.
MCT USE ONLY. STUDENT USE PROHIBITED
5-28 Create Mobile Reports
Which type of visual component of mobile reports do you use to filter data?
Gauges
Navigators
Graphs
DataGrids
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 5-29
Unfortunately, due to the virtual nature of the lab environment, you haven’t been able to see the mobile
reports in Microsoft’s Power BI mobile app.
Review Question(s)
Question: Is mobile reporting important to your organization? How will SQL Server mobile
reports change your approach to publishing reports?
MCT USE ONLY. STUDENT USE PROHIBITED
5-30 Create Mobile Reports
Course Evaluation
Your evaluation of this course will help Microsoft understand the quality of your learning experience.
Please work with your training provider to access the course evaluation form.
Microsoft will keep your answers to this survey private and confidential and will use your responses to
improve your future learning experience. Your open and honest feedback is valuable and appreciated.
MCT USE ONLY. STUDENT USE PROHIBITED
L1-1
3. In the User Account Control dialog box, click Yes, and then wait for the script to finish.
4. In the Visual Studio Just-In-Time Debugger dialog box, click No, cancel debugging. The crash is a
symptom of the Virtual Machine environment and is linked to restarting IIS. It can be ignored.
3. In Object Explorer, expand Databases, expand AdventureWorksDW, and then expand Database
Diagrams.
4. In the Microsoft SQL Server Management Studio dialog box, click Yes.
2. In the Open File dialog box, navigate to D:\Labfiles\Lab01\Starter, and then double-click
SalesQuery.sql.
3. Review the query, and click Execute.
4. Note that the total sales for the employee David Campbell is $106,380.438.
3. In Object Explorer, expand the MIA-SQL Analysis Server, expand Databases, expand
AdventureWorksDW, and then expand Cubes.
5. On the Metadata tab, expand Measures, and expand Fact Reseller Sales.
6. Drag Sales Amount to the query pane.
2. Drag Full Name to the query pane to the left of the Sales Amount column. A blue bar should
highlight the location.
3. Resize the Full Name column so that you can see the names.
4. You can now see total sales for each employee. Note the sales amount for David R. Campbell.
3. Click the Filter Expression column and click the drop-down button.
4. Expand All, expand 2013, then select April and click OK.
5. Note that the total sales for the employee David R. Campbell is $106,380.438.
4. In the PivotTable Fields pane, scroll down to Fact Reseller Sales, and then select the Sales Amount.
This will add the Sales Amount to the VALUES layout on the Pivot Table.
5. In the PivotTable Fields pane, scroll down to Dim Employee, and then expand More Fields, select
the Full Name. This will add the Full Name to the ROWS layout on the Pivot Table.
6. In the PivotTable Fields pane, scroll down to Order Date, then select Order Date.Calendar. This will
add the Order Date.Calendar to the COLUMNS layout in the Pivot Table.
7. On the spreadsheet, in the Column Labels filter, clear all the values apart from April 2013, and then
click OK.
8. Note that the total sales for the employee David R. Campbell is the amount $106,380.438.
MCT USE ONLY. STUDENT USE PROHIBITED
L1-3
4. In the Employee_Sales_Summary report, click the ellipses, and then click Manage.
5. In the toolbar, click Edit in Report Builder.
9. Note that you can filter by Employee, Date, and Category. The default view shows all categories for
David Campbell in April 2013.
10. Scroll down and view the sales data for David Campbell.
11. Note that the bottom row of the first table lists total sales of $106,380.
12. Experiment with changing the filters at the top of the report and click View Report to refresh the
data.
3. In the User Account Control dialog box, click Yes to run the command file, and then wait for the
script to finish.
4. On the New data source page, in the Name box, type AdventureWorksDW.
8. In the Type of credentials list, click Database user name and password.
9. In the User name box, type reporting.
10. In the Password box, type Pa$$w0rd, and then click Test connection. Note that the test succeeds.
5. In the Select Data Source dialog box, double-click Builder, click AdventureWorksDW, and then
click Open.
7. In the Enter Data Source Credentials dialog box, in the Password box, type Pa$$w0rd.
8. Select the Save password with connection check box, and then click OK.
MCT USE ONLY. STUDENT USE PROHIBITED
L2-2 Analyzing Data with SQL Server Reporting Services
9. In the Database view pane, expand Views, select vAllSales, and then click Run Query.
12. In the Name box, type AllSales, and then click OK.
13. In Internet Explorer, browse to mia-sql/Reports_SQL2/browse/Builder to verify that the dataset has
been created.
2. In the New Report or Dataset dialog box, click New Dataset, and then click Create.
3. In the Database view pane, expand Stored Procedures, select usp_SalesTerritory, and then click
Run Query. Notice that there are six rows in the output where the value of the SalesTerritoryGroup
column is North America, and one row where the value is NA, and then click Set Options.
4. In the Shared Dataset Properties dialog box, on the Filters page, click Add.
8. In the filter list, in the new section, in the Expression list, click [SalesTerritoryGroup].
11. Click Run Query. Notice that the filter is not applied.
14. In the Name box, type FilteredTerritories, and then click OK.
17. On the Edit FilteredTerritories page, click Data Preview, and then click Load data. Notice that the
filter is applied and only four rows are returned.
2. In the Microsoft SQL Server Report Builder dialog box, click No.
3. In the New Report or Dataset dialog box, click New Dataset, and then click Create.
4. In the Database view pane, expand Views, select vAllSales, and then click Run Query.
6. In the Field name column, click Year, and then click SalesTerritoryCountry.
7. In the Parameter column, select the check box, and then click Edit as Text.
8. In the Query Designer pane, scroll down, notice that a WHERE clause has been added to the query,
and then click Set Options.
MCT USE ONLY. STUDENT USE PROHIBITED
L2-3
9. In the Shared Dataset Properties dialog box, on the Parameters page, notice that an entry for the
@SalesTerritoryCountry parameter has been created, and then click Cancel.
10. On the File menu, click Save.
12. In the Name box, type CountrySales, and then click OK.
14. In the Define Query Parameters dialog box, in the Parameter Value column, in the first row, type
Australia, and then click OK. Check the results of the query to confirm that only rows that match the
parameter have been returned.
Results: At the end of this lab, a shared data source and three shared datasets will exist in the Builder
folder of the Reporting Services portal at http://mia-sql/Reports_SQL2.
MCT USE ONLY. STUDENT USE PROHIBITED
L2-4 Analyzing Data with SQL Server Reporting Services
3. In the User Account Control dialog box, click Yes to run the command file, and then wait for the
script to finish.
2. In Visual Studio, on the File menu, point to Open, and then click Project/Solution.
3. In the Open Project dialog box, browse to D:\Labfiles\Lab02\Starter\Project, click Project.sln, and
then click Open.
4. In Solution Explorer, right-click Shared Data Sources, and then click Add New Data Source.
5. In the Shared Data Source Properties dialog box, in the Name box, type AdventureWorksDW.
6. In the Type box, verify that Microsoft SQL Server is selected, and then click Edit.
7. In the Connection Properties dialog box, in the Server name box, type MIA-SQL.
10. In the Select or enter a database name list, click AdventureWorksDW, and then click Test
Connection.
13. In the Shared Data Source Properties dialog box, on the Credentials page, confirm that the
credentials that you entered in step 9 are being used, and then click OK.
14. In Solution Explorer, expand Shared Data Sources, and then verify that the definition for the data
source has been created.
2. In the Shared Dataset Properties dialog box, on the Query page, in the Name box, type AllSales.
4. In the Query box, type the following code, and then click OK:
5. In Solution Explorer, expand Shared Datasets, right-click AllSales.rsd, and then click Deploy.
There is currently an issue with SSDT. When deploying you may get this error:
The shared dataset definition is not valid. Details: The required attribute 'Name' is missing.
<DataSet>
To:
<DataSet Name=””>
7. In Internet Explorer, browse to mia-sql/Reports_SQL2, click Designer, and verify that the data
source and dataset have been created on the SSRS server.
2. In the Shared Dataset Properties dialog box, on the Query page, in the Name box, type
FilteredTerritories.
6. Click Query Designer and then click the Run button (!). Notice that there are six rows in the output
where the value of the SalesTerritoryGroup column is North America, and one row where the value
is NA, and then click Cancel.
11. In the Value box, type North America, and then click Add.
14. In the Value box, type NA, and then click OK.
15. In Solution Explorer, expand Shared Datasets, right-click FilteredTerritories.rsd, and then click
Deploy.
There is currently an issue with SSDT. When deploying you may get this error:
The shared dataset definition is not valid. Details: The required attribute 'Name' is missing.
<DataSet>
To:
<DataSet Name=””>
17. On the FilteredTerritories object, click the ellipsis (…) button, and then click MANAGE.
18. On the Edit FilteredTerritories page, click Data Preview, and then click Load Data. Notice that the
filter is applied and only four rows are returned.
2. In the Shared Dataset Properties dialog box, in the Name box, type CountrySales.
3. In the Data source list, ensure AdventureWorksDW is selected, and then click Query Designer.
4. In the Query Designer dialog box, edit the text in the SQL pane to match the following code:
SELECT *
FROM dbo.vAllSales
5. Click in any other pane. Notice that the column list is automatically expanded in the SQL pane, and
the Diagram and Grid panes are automatically populated.
6. In the Grid pane, scroll down to locate the row for SalesTerritoryCountry.
7. In the SalesTerritoryCountry row, in the Filter column, type the following code, and then press Tab:
= @Country
Notice that the query text in the SQL pane is updated to include a WHERE clause.
9. In the Query Parameters dialog box, in the Value column, in the first row, type Australia, and then
click OK. The rows returned in the Result pane include only those with a SalesTerritoryCountry value
of Australia.
11. In the Shared Dataset Properties dialog box, on the Parameters page, notice that an entry for the
@Country parameter has been created, and then click OK.
Results: At the end of this lab, a shared data source and three shared datasets will exist in the Designer
folder of the Reporting Services portal at http://mia-sql/Reports_SQL2.
MCT USE ONLY. STUDENT USE PROHIBITED
L3-1
3. Click Yes when prompted to confirm you want to run the command file, and wait for the script to
finish. If a Visual Studio Just-In-Time Debugger dialog box shows an error relating to w3wp.exe,
click No, cancel debugging.
2. Go to the folder D:\Labfiles\Lab03\Starter folder; click the Reports.sln file and then click Open.
3. In Solution Explorer, right-click Shared Datasets, click Add New Dataset and on the Shared Dataset
Properties page, name the dataset InternetSales, click Import, select the Sales Query.sql Transact-
SQL script file in the D:\Labfiles\Lab03\Starter folder, and click OK.
4. In Solution Explorer, right-click Reports, point at Add, and then click New Item.
5. In the Add New Item – Reports page, click Report, in the Name box type Internet Sales, and then
click Add.
6. In the Toolbox, click Text Box, and then click anywhere near the top left of the report design
surface.
9. In the Choose a data source and create a query dialog box, in the Name box, type InternetSales,
click InternetSales in the list of shared datasets, and then click OK.
10. If Report Data is not visible, on the View menu, click Report Data.
11. In Report Data, expand Datasets and from the InternetSales dataset, drag the fields onto the table
in the following order, in the next available column, from left to right:
Year
Month
ProductCategory
ProductSubcategory
Product
SalesOrderNumber
OrderDate
MCT USE ONLY. STUDENT USE PROHIBITED
L3-2 Analyzing Data with SQL Server Reporting Services
SalesAmount
2. In the Report Designer, click the Design tab, and then click in any blank space under the report to
ensure no elements are selected. Note that the report contains two elements—a text box containing
the report title, and a tablix containing the report data.
3. Click the border of the text box containing the report title (Internet Sales) and use the formatting
buttons on the toolbar to increase its size to 14pt and make it bold. Resize the text box if necessary to
ensure all text is displayed.
4. Click the table containing the report data, so that the gray column and row headers are displayed,
and then click the gray cell where the column and row headers intersect at the top left to select the
table. When the table is selected, click and drag its selection handle (a small square containing four
directional arrows) to move the table down, so it is positioned about 1 centimeter below the text box.
5. Click the table containing the report data, so that the gray column and row headers are displayed,
and click the row header for the first row (which contains the column titles). Then use the formatting
buttons on the toolbar to make the column titles bold, change the background color to light gray,
and align the column titles to the left.
6. Click the row header for the details row and use the formatting buttons on the toolbar to align the
cells to the left.
7. Right-click the [OrderDate] detail cell and click Text Box Properties. On the Number tab, select the
Date category and the 31-Jan-00 format. Then click OK.
8. Right-click the [SalesAmount] detail cell and click Text Box Properties. On the Number tab, select
the Currency category, specify 2 decimal places, select Use 1000 separator, and select the
($12,345.00) format. Then click OK.
9. Drag the borders of the column headings to resize the columns so that the values in the table fit
them. Switch back and forth between the Preview and Design tabs to check your work.
Results: After this exercise, you should have a report that shows product sales data from the
AdventureWorksDW database.
2. If the Toolbox is not visible, on the View menu, click Toolbox. In the Toolbox, click and drag the
Chart item to the space you have created above the table.
3. In the Select Chart Type dialog box, select the Stacked Column chart type (point the mouse over
the chart icons to display a tooltip with the name of the chart type). Then click OK.
4. Use the resize and selection handles to fit the chart into the space created when you moved the table.
MCT USE ONLY. STUDENT USE PROHIBITED
L3-3
2. In the Chart Data pane, in the Values section, click the Add field button (a green plus symbol) and
click SalesAmount.
3. In the Category Groups section, click the drop-down button for the (Details) group and click
Month. Then in the Category Groups section, click the drop-down button for Month and click
Category Group Properties.
4. In the Category Group Properties dialog box, on the Sorting tab, in the Sort by drop-down list,
select MonthNo. Then click OK.
5. In the Chart Data pane, in the Series Groups section, click the Add field button and click
ProductCategory.
2. In the Chart Properties dialog box, in the Color palette drop-down list, select a color palette for the
chart. Then click OK.
3. Right-click the Chart Title text box and click Delete Title.
4. Right-click any of the numbers in the vertical axis and click Vertical Axis Properties.
5. In the Vertical Axis Properties dialog box, in the Number tab, select Currency. Select 0 decimal
places, and then select the Use 1000 separator check box and click OK.
6. Click the Preview tab and note that the first page of the report contains the chart.
7. Click the Design tab to return to the report designer. Keep Visual Studio open for the next exercise.
Results: After completing this exercise, you will have a report that includes a chart and an Excel output.
2. In the Internet Sales by State report, click the table containing the report data, so that the gray
column and row headers are displayed, and then click the gray cell where the column and row
headers intersect at the top left to select the table. When the table is selected, click and drag its
selection handle to move the table down about 10 centimeters.
3. If the Toolbox is not visible, on the View menu, click Toolbox. Then in the Toolbox, click and drag
the Map item to the space you have created above the table.
4. In the Choose a source of spatial data dialog box, click USA by State Exploded, and then click
Next.
5. In the Choose spatial data and map view options dialog box, click Next.
6. In the Choose map visualization dialog box, click Color Analytical Map, and then click Next.
MCT USE ONLY. STUDENT USE PROHIBITED
L3-4 Analyzing Data with SQL Server Reporting Services
7. In the Choose the analytical dataset dialog box, choose DataSet1 and click Next.
8. On the Specify the match fields for spatial and analytical data dialog box, click the check box for
STUSPS, and then, in the Analytical Dataset Fields column, in the Select a field drop-down list,
click StateProvinceCode, and then click Next.
9. On the Choose color theme and data visualization dialog box, in the Field to Visualize, choose
[Sum(SalesAmount)], in the Color rule drop-down list choose Red-Yellow-Green, and then click
Finish.
10. If necessary, rearrange the map and the tablix item so that the map appears directly above the tablix.
3. Right-click the map distance scale and click Show Distance Scale to remove the distance scale.
4. Double-click the map color scale, and then, using the selection handle, move the map color scale to
the bottom right corner of the map.
Results: After this exercise, you should have created a report that shows Internet sales by US state on a
map.
MCT USE ONLY. STUDENT USE PROHIBITED
L3-5
3. Click Yes when prompted to confirm that you want to run the command file, and wait for the script
to finish. If a Visual Studio Just-In-Time Debugger dialog box shows an error relating to w3wp.exe,
click No, cancel debugging.
2. Start Report Builder, click the cross on the Getting Started dialogue box and in Report Data right-
click Data Sources, and then click Add Data Source.
3. In the Data Source Properties dialog box, in the Name box type AdventureWorksDW, and then
click Browse.
5. Click AdventureWorksDW, click Open, and then, in the Data Source Properties pane, click OK.
6. In Report Data, right-click Datasets, click Add Dataset and on the Dataset Properties page, name
the dataset InternetSales. Click Use a dataset embedded in my report, select
AdventureworksDW, in the Data Source drop-down list, click Import.
7. Select the Sales Query.sql file in the D:\Labfiles\Lab03\Starter folder, and click OK.
8. Double-click the text Click to add title and type Internet Sales.
9. On the Insert tab, click Table, click Insert Table, and then click on the report design surface.
10. In Report Data, expand Datasets and from the InternetSales dataset drag the fields onto the table
in the following order, in the next available column, from left to right:
Year
Month
ProductCategory
ProductSubcategory
Product
SalesOrderNumber
OrderDate
SalesAmount
MCT USE ONLY. STUDENT USE PROHIBITED
L3-6 Analyzing Data with SQL Server Reporting Services
2. Click Design, and then click in any blank space under the report to ensure no elements are selected.
Note that the report contains two elements—a text box containing the report title, and a tablix
containing the report data.
3. Click the border of the text box containing the report title (Internet Sales) and use the formatting
buttons on the toolbar to set the text size to 14pt and make it bold. Resize the text box if necessary to
ensure all text is displayed.
4. Click the table containing the report data, so that the gray column and row headers are displayed,
and then click the gray cell where the column and row headers intersect at the top left to select the
table. When the table is selected, click and drag its selection handle (a small square containing four
directional arrows) to move the table down so it is positioned about 1 centimeter below the text box.
5. Click the table containing the report data, so that the gray column and row headers are displayed,
and click the row header for the first row (which contains the column titles). Then use the formatting
buttons on the toolbar to make the column titles bold, change the background color to light gray,
and align the column titles to the left.
6. Click the row header for the details row and use the formatting buttons on the toolbar to align the
cells to the left.
7. Right-click the [OrderDate] detail cell and click Text Box Properties. On the Number tab, select the
Date category and the 31-Jan-00 format. Then click OK.
8. Right-click the [SalesAmount] detail cell and click Text Box Properties. On the Number tab, select
the Currency category, specify 2 decimal places, select Use 1000 separator, and select the
($12,345.00) format. Then click OK.
9. Drag the borders of the column headings to resize the columns so that the values in the table fit
them. Switch back and forth between the Run and Design views to check your work.
Results: After this exercise, you should have a report that shows product sales data from the
AdventureWorksDW database.
2. On the Insert tab, click Chart, click Insert Chart, and then click the space you have created above the
table.
3. In the Select Chart Type dialog box, select the Stacked Column chart type (point the mouse over
the chart icons to display a tooltip with the name of the chart type). Then click OK.
4. Use the resize and selection handles to fit the chart into the space created when you moved the table.
MCT USE ONLY. STUDENT USE PROHIBITED
L3-7
2. In the Chart Data pane, in the Values section, click the Add field button (a green plus symbol) and
click SalesAmount.
3. In the Category Groups section, click the drop-down button for the (Details) group and click
Month. Then in the Category Groups section, click the drop-down button for Month and click
Category Group Properties.
4. In the Category Group Properties dialog box, on the Sorting tab, in the Sort by drop-down list,
select MonthNo. Then click OK.
5. In the Chart Data pane, in the Series Groups section, click the Add field button and click
ProductCategory.
2. In the Chart Properties dialog box, in the Color palette drop-down list, select a color palette for the
chart. Then click OK.
3. Right-click the Chart Title text box and click Delete Title.
4. Right-click any of the numbers in the vertical axis and click Vertical Axis Properties.
5. In the Vertical Axis Properties dialog box, in the Number tab, select Currency. Select 0 decimal
places, check the Use 1000 separator check box and click OK.
6. Click Run and note that the first page of the report contains the chart.
Results: After completing this exercise, you will have a report that includes a chart and an Excel output.
2. Start Report Builder, click the cross on the Getting Started dialogue box and then on the File menu,
click Open, select Recent Sites and Servers and select mia-sql/ReportServer_SQL2, double click
Reports, click Internet Sales by State, and then click Open.
3. In the Internet Sales by State report, click the table containing the report data, so that the gray
column and row headers are displayed, and then click the gray cell where the column and row
headers intersect at the top left to select the table. When the table is selected, click and drag its
selection handle to move the table down about 10 centimeters.
4. On the Insert tab, click Map, and then click Map Wizard.
5. In the Choose a source of spatial data dialog box, click USA by State Exploded, and then click
Next.
6. In the Choose spatial data and map view options dialog box, click Next.
MCT USE ONLY. STUDENT USE PROHIBITED
L3-8 Analyzing Data with SQL Server Reporting Services
7. In the Choose map visualization dialog box, click Color Analytical Map, and then click Next.
8. In the Choose the analytical dataset dialog box, choose DataSet1 and click Next.
9. In the Specify the match fields for spatial and analytical data dialog box, click the check box for
STUSPS, and then, in the Analytical Dataset Fields column, in the Select a field drop-down list,
click StateProvinceCode, and then click Next.
10. On the Choose color theme and data visualization dialog box, in the Field to Visualize, choose
[Sum(SalesAmount)], in the Color rule drop-down list choose Red-Yellow-Green, and then click
Finish.
11. If necessary, rearrange the map and the tablix item so that the map appears directly above the tablix.
4. Click the map color scale and then, using the selection handle, move the map color scale to the
bottom right corner of the map.
5. Click Run to view the report. It may take a few minutes to load the data.
6. Close Report Builder without saving any changes, and then close Internet Explorer.
Results: After this exercise, you should have created a report that shows Internet sales by US state on a
map.
MCT USE ONLY. STUDENT USE PROHIBITED
L4-1
3. In the User Account Control dialog box, click Yes, and then wait for the script to finish.
4. If the Visual Studio Just-In-Time Debugger dialog box appears, click No, cancel debugging.
Note: The crash is a symptom of the Virtual Machine environment and is linked to
restarting IIS. It can be ignored.
3. In the Open Project dialog box, browse to D:\Labfiles\Lab04\Starter, click Reports.sln, and then
click Open.
4. In Solution Explorer, under Reports, double-click Internet Sales.rdl.
2. In the Save File As dialog box, in the File name box, type Internet Sales by Year.rdl, and then click
Save.
4. In the Report Data pane, right-click Datasets, and then click Add Dataset.
5. In the Dataset Properties dialog box, in the Name box, type AvailableYears.
Select CalendarYear
from FactInternetSales
inner join DimDate on DimDate.DateKey = FactInternetSales.OrderDateKey
group by CalendarYear
order by CalendarYear desc;
MCT USE ONLY. STUDENT USE PROHIBITED
L4-2 Analyzing Data with SQL Server Reporting Services
9. Click OK.
10. In the Report Data pane, right-click Parameters, click Add Parameter.
11. In the Report Parameter Properties, in the Name box, type Year.
14. On the Available Values page, select Get values from a query.
15. In the Dataset: (Warning: Possible performance impact) list, click AvailableYears.
18. In the Report Data pane, expand Datasets, right-click InternetSales, and then click Dataset
Properties.
19. In the Dataset Properties dialog box, on the Filters page, click Add.
Note: Ensure that you click fx next to the Value box, not next to the Expression box.
22. In the Expression dialog box, in the Set Expression for: Value box, type Parameters!Year.Value,
and then click OK.
25. In the Choose a reporting year list, click 2012, and then click View Report.
26. Note that the chart and tabular data is now filtered to match the chosen year.
2. In the Name box, type CurrentYear. Click Use a dataset embedded in my report.
3. In the Data source list, click AdventureWorksDW, and in the Query box type the following:
4. Click OK.
5. In the Report Data pane, expand Parameters, right-click Year, click Parameter Properties.
9. In the Value field list, click CurrentYear, and then click OK.
MCT USE ONLY. STUDENT USE PROHIBITED
L4-3
11. Note that the report now opens with 2014 selected, and the results are displayed without the need to
click View Report.
2. In the Report Data pane, expand Parameters, drag [@Year] to after Internet Sales by text. The title
should now be Internet Sales by [@Year].
3. In the Toolbox pane, click Text Box, then click in the footer under the report.
4. Drag the resize handles to make the text box the full width of the page.
7. In the Report Data pane, expand Built-in Fields, and drag Execution Time to the text box. The text
box should now be Report created: [&Execution Time].
8. Click the text box, and add the text Created by:. The text should now be Report created:
[&ExecutionTime] Created by:.
9. In the Report Data pane, in Built-in Fields, drag User ID to the text box. The text box should now be
Report created: [&ExecutionTime] Created by: [&UserID].
11. On the toolbar of the report, click Export, and then click Excel.
12. In the Save As dialog box, navigate to D:\Labfiles\Lab04, and then click Save.
Enhanced an existing report to display the selected parameter, and used some built-in SSRS fields.
2. In the Save File As dialog box, in the File name box, type Grouped Internet Sales.rdl, and then click
Save.
2. At the bottom of the screen, in the Row Groups pane, right-click (Details), point to Add Group, then
click Parent Group.
MCT USE ONLY. STUDENT USE PROHIBITED
L4-4 Analyzing Data with SQL Server Reporting Services
3. In the Tablix group dialog box, in the Group by drop-down, click [Month].
4. Select the Add group footer check box, and then click OK.
5. In the Row Groups pane, right-click Month, point to Add Group, and then click Child Group.
6. In the Tablix group dialog box, in the Group by drop-down, click [ProductCategory].
7. Select the Add group footer check box, and then click OK.
8. In the Row Groups pane, right-click ProductCategory, point to Add Group, and then click Child
Group.
9. In the Tablix group dialog box, in the Group by drop-down, click [ProductSubcategory].
10. Select the Add group footer check box, and then click OK.
11. In the Row Groups pane, right-click ProductSubcategory, point to Add Group, and then click Child
Group.
12. In the Tablix group dialog box, in the Group by drop-down, click [Product].
13. Select the Add group footer check box, and then click Add group footer, and then click OK.
2. Click the Year cell (fifth column) in the table on the report. Click the blank gray column header above
to select the whole column.
3. Right-click the header, then click Delete Columns.
4. Click the blank gray column header above the Month cell (fifth column) to select the whole column.
6. Click the blank gray column header above the ProductCategory cell (fifth column) to select the
whole column.
8. Click the blank gray column header above the ProductSubcategory cell (fifth column) to select the
whole column.
12. Click the blank gray row selection button to the left of the Month on the header row. This will select
the whole header row of the table.
2. Click the cell under [SalesAmount], then click the small field chooser that appears in the top right of
the cell.
3. Click SalesAmount.
MCT USE ONLY. STUDENT USE PROHIBITED
L4-5
6. In the Expression dialog box, in the Set expression for: Value box, after the equals sign, type the
following:
Count(Fields!SalesOrderNumber.Value)
7. Click OK.
9. Select the three cells below, right-click, and then click Paste.
2. In the Row Groups pane, at the bottom of the window, click (Details).
3. In the Properties pane on the right, under Visibility, change the Hidden property from False to True.
4. Change the ToggleItem from blank to Product1.
5. In the Row Groups pane, at the bottom of the window, click Product.
6. In the Properties pane, under Visibility, change the Hidden property from False to True.
8. In the Row Groups pane, at the bottom of the window, click ProductSubcategory.
9. In the Properties pane, under Visibility, change the Hidden property from False to True.
10. Change the ToggleItem from blank to ProductCategory1.
11. In the Row Groups pane, at the bottom of the window, click ProductCategory.
12. In the Properties pane, under Visibility, change the Hidden property from False to True.
2. Click the second cell containing the text Total below [Product]. Press Delete.
3. Click the third cell containing the text Total below [Product]. Press Delete.
4. Click the second cell containing the text Total below [ProductSubcategory]. Press delete.
5. Click the gray column cell above [SalesAmount] to select the column containing amounts.
6. In the Properties pane on the right, in the Number section. Change the Format property from blank
to contain C.
2. In the Row Groups pane, right-click Month, then click Group Properties.
MCT USE ONLY. STUDENT USE PROHIBITED
L4-6 Analyzing Data with SQL Server Reporting Services
3. On the Page Breaks page, select the Between each instance of a group check box.
8. In the Properties pane, in the Group section, expand Group, and then change the PageName
property to be:
=Fields!Month.Value
10. On the toolbar of the report, click the Export button, then click Excel.
11. In the Save As dialog box, navigate to D:\Labfiles\Lab04, then click Save.
Enhanced the Excel export so that the worksheets are named correctly.
2. In the Save File As dialog box, in the Name box, type Visual Internet Sales.rdl, and then click Save.
2. Right-click a blank area of the report, point to Insert, and then click Page Header.
3. Select the text box containing Internet Sales for [@Year], then drag it into the new header section.
2. Right-click in the empty cell above [ProductCategory], point to Insert, and then click Data Bar.
MCT USE ONLY. STUDENT USE PROHIBITED
L4-7
3. In the Select Data Bar Type dialog box, click the first Data Column, and then click OK.
4. Click the cell containing the data bar, in the Chart Data pop-up box, in the Values group, click the +
icon, and then click SalesAmount.
5. In the Category Groups, click the + icon, and then click ProductCategory.
9. Double-click the data bar, right-click [Sum(SalesAmount)], then click Series Properties.
10. In the Series Properties dialog box, in the Category field, click ProductCategory.
11. In the Tooltip box, click [Count(ProductCategory)], and then click OK.
12. On the Visual Internet Sales.rdl [Design] tab, click Preview.
13. On the Preview tab, move to page 3. Move your mouse over the data bar to see what each bar
represents.
2. Click the cell containing the text Total below the [ProductSubcategory] cell.
3. Press Delete.
4. Right-click this empty cell, point to Insert, and then click Sparkline.
5. In the Select Sparkline Type dialog box, in the left pane, click Line, click the Stepped Line, and then
click OK.
6. Click the cell containing the sparkline, in the Chart Data pop-up, in the Values section, click the +
icon, and then click SalesAmount.
7. In the Category Groups section, click the + icon, and then click OrderDate.
8. Right-click the new sparkline, then click Horizontal Axis Properties.
9. In the Horizontal Axis Properties dialog box, in the Axis range and interval section, select the
Align axes in check box, and then in the box, type Month.
11. In the Interval type box, type Days, and then click OK.
13. Right-click the Total cell below [ProductCategory], and then click Paste.
14. Right-click the sparkline under [ProductCategory], then click Horizontal Axis Properties.
15. In the Horizontal Axis Properties dialog box, clear the Align axes in check box, and then click OK.
16. On the Visual Internet Sales.rdl [Design] tab, click Preview. Move to page 2. Expand the groupings
to see the sparklines.
MCT USE ONLY. STUDENT USE PROHIBITED
L4-8 Analyzing Data with SQL Server Reporting Services
Created a header.
2. In the Reports Property Pages dialog box, under Deployment, verify the TargetServerURL box is
set to http://mia-sql/sites/adventureworks.
5. In the User Name box, type adventureworks\serviceacct, in the Password box, type Pa$$w0rd.
6. Select the Use as Windows credentials check box, and then click OK.
7. In the Reports window, scroll down and click Visual Internet Sales.
Results: After completing this exercise, you will have published and viewed an SSRS report in SharePoint.
MCT USE ONLY. STUDENT USE PROHIBITED
L4-9
3. In the User Account Control dialog box, click Yes, and then wait for the script to finish.
4. If the Visual Studio Just-In-Time Debugger dialog box appears, click No, cancel debugging.
Note: The crash is a symptom of the Virtual Machine environment and is linked to
restarting IIS. It can be ignored.
5. On the Internet Sales page, scroll down and view the returned data. Note that the report data starts
at 2010.
5. In the Internet Sales - Microsoft SQL Server Report Builder window, on the File tab, click Save As.
6. In the Save As Report dialog box, in the Name box, type Internet Sales by Year, and then click
Save.
7. In the Report Data pane, right-click Datasets, and then click Add Dataset.
8. In the Dataset Properties dialog box, in the Name box, type AvailableYears, and then click Use a
dataset embedded in my report.
Select CalendarYear
from FactInternetSales
inner join DimDate on DimDate.DateKey = FactInternetSales.OrderDateKey
group by CalendarYear
order by CalendarYear desc;
12. In the Report Data pane, right-click Parameters, and then click Add Parameter.
13. In the Report Parameter Properties dialog box, in the Name box, type Year.
14. In the Prompt box, type Choose a reporting year.
16. On the Available Values page, click Get values from a query.
17. In the Dataset: (Warning: Possible performance impact) list, click AvailableYears.
19. In the Label field list, click CalendarYear, and then click OK.
20. In the Report Data pane, expand Datasets, right-click InternetSales, and then click Dataset
Properties.
21. In the Dataset Properties dialog box, on the Filters page, click Add.
Note: Ensure that you click fx next to the Value box, not next to the Expression box.
24. In the Expression dialog box, in the Set Expression for: Value box, type Parameters!Year.Value,
and then click OK.
27. In the Choose a reporting year list, click 2012, and then click View Report. Note that the chart and
tabular data is now filtered to match the chosen year.
2. In the Dataset Properties dialog box, in the Name box, type CurrentYear, and then click Use a
dataset embedded in my report.
3. In the Data source list, click AdventureWorksDW, and in the Query box, type the following:
4. Click OK.
5. In the Report Data pane, expand Parameters, right-click Year, then click Parameter Properties.
MCT USE ONLY. STUDENT USE PROHIBITED
L4-11
6. In the Report Parameter Properties dialog box, on the Default Values page, click Get values from
a query.
8. In the Value field list, click CurrentYear, and then click OK.
2. In the Report Data pane, expand Parameters, drag Year to after the Internet Sales by text. The title
should now be Internet Sales by [@Year].
3. On the Insert tab, click Text Box, then click in the footer.
4. Drag the resize handles to make the text box the full width of the page.
5. On the Home tab, in the Paragraph section, click Center.
7. In the Report Data pane, expand Built-in Fields, and drag Execution Time to the text box. The text
box should now be Report created: [&Execution Time].
8. In the text box, add the text Created by:. The text should now be Report created:
[&ExecutionTime] Created by:.
9. In the Report Data pane, in Built-in Fields, drag User ID to the text box. The text box should now
be Report created: [&ExecutionTime] Created by: [&UserID].
12. In the Save As dialog box, navigate to D:\Labfiles\Lab04, then click Save.
Enhanced an existing report to display the selected parameter, and used some built-in SSRS fields.
MCT USE ONLY. STUDENT USE PROHIBITED
L4-12 Analyzing Data with SQL Server Reporting Services
3. In the Name box, type Grouped Internet Sales, and then click Save.
2. At the bottom of the screen, in the Row Groups pane, right-click Details, point to Add Group, and
then click Parent Group.
3. In the Tablix group dialog box, in the Group by list, click [Month].
4. Select the Add group footer check box, then click OK.
5. In the Row Groups pane, right-click Month, point to Add Group, and then click Child Group.
6. In the Tablix group dialog box, in the Group by list, click [ProductCategory].
7. Select the Add group footer check box, then click OK.
8. In the Row Groups pane, right-click ProductCategory, point to Add Group, then click Child Group.
9. In the Tablix group dialog box, in the Group by list, click [ProductSubcategory].
10. Select the Add group footer check box, then click OK.
11. In the Row Groups pane, right-click ProductSubcategory, point to Add Group, then click Child
Group.
12. In the Tablix group dialog box, in the Group by list, click [Product].
13. Select the Add group footer check box, then click OK.
3. Click the blank gray column header above the Month cell (fifth column) to select the whole column.
5. Click the blank gray column header above the ProductCategory cell (fifth column) to select the
whole column.
7. Click the blank gray column header above the ProductSubcategory cell (fifth column) to select the
whole column.
8. Right-click the header, then click Delete Columns.
9. Click the blank gray column header above the Product cell (fifth column) to select the whole column.
11. Click the blank gray row selection button to the left of the Month on the header row. This will select
the whole header row of the table.
2. Click the cell under [SalesAmount], click the small field chooser that appears in the top right of the
cell, and then click SalesAmount.
9. In the Expression dialog box, in the Set expression for: Value box, after the equals sign, type the
following:
Count(Fields!SalesOrderNumber.Value)
4. In the Properties pane, under Visibility, change the Hidden property from False to True.
7. In the Properties pane, under Visibility, change the Hidden property from False to True.
10. In the Properties pane, under Visibility, change the Hidden property from False to True.
11. Change the ToggleItem from blank to ProductCategory1.
13. In the Properties pane, under Visibility, change the Hidden property from False to True.
14. Change the ToggleItem from blank to Month1.
MCT USE ONLY. STUDENT USE PROHIBITED
L4-14 Analyzing Data with SQL Server Reporting Services
2. In the Row Groups pane, right-click Month, and then click Group Properties.
3. In the Group Properties dialog box, on the Page Breaks page, select the Between each instance of
a group check box.
4. Select the Also at the start of a group check box.
5. On the Sorting page, change the Sort by field to [MonthNo], and then click OK.
6. In the Properties pane, in the Group section, expand Group, and in the PageName property, type:
=Fields!Month.Value
Enhanced the Excel export so that the worksheets are named correctly.
2. In the Save As Report dialog box, in the Name box, type Visual Internet Sales, and then click Save.
2. Select the text box containing Internet Sales by [@Year], then drag it into the new header section.
MCT USE ONLY. STUDENT USE PROHIBITED
L4-15
2. Right-click in the empty cell above [ProductCategory], point to Insert, and then click Data Bar.
3. In the Select Data Bar Type dialog box, click the first Data Column, and then click OK.
4. Click the cell containing the data bar, in the Chart Data pop-up box, in the Values group, click the +
icon, and then click SalesAmount.
5. In the Category Groups, click the + icon, and then click ProductCategory.
7. On the Run tab, in the Navigation group, click Next. Note that you should see a data bar next to the
cell containing January.
9. Double-click the data bar, right-click [Sum(SalesAmount)], then click Series Properties.
10. In the Series Properties dialog box, in the Category field list, click ProductCategory.
=Fields!ProductCategory.Value
14. On the Run tab, in the Navigation section, click Next. Move the cursor over the data bar to see what
each bar represents.
2. Right-click below the [ProductSubcategory] cell, point to Insert, then click Sparkline.
3. In the Select Sparkline Type dialog box, in the left pane, click Line, click the Stepped Line, and then
click OK.
4. Click the cell containing the sparkline, in the Chart Data pop-up, in the Values section, click the +
icon, and then click SalesAmount.
5. In the Category Groups section, click the + icon, and then click OrderDate.
7. In the Horizontal Axis Properties dialog box, in the Axis range and interval section, select the
Align axes in check box, and then in the box, type Month.
9. In the Interval type box, type Days, and then click OK.
10. Right-click the new sparkline, click Copy.
11. Right-click the empty cell below [ProductCategory], and then click Paste.
12. Right-click the sparkline under [ProductCategory], then click Horizontal Axis Properties.
13. In the Horizontal Axis Properties dialog box, clear the Align axes in check box, and then click OK.
15. On the Run tab, in the Navigation section, click Next. Expand the groupings to see the sparklines.
Created a header.
6. In the Do you want to open or save Visual Internet Sales message box, click the down arrow next
to Save, then click Saves as.
8. Click the Home link in the top left of the SQL Server Reporting Services Reports window.
9. On the SQL Server Reporting Services page, click Reports.
10. In the InternetSales datasets, click the ellipses (…), and then click MANAGE.
12. In the Do you want to open or save InternetSales message box, click the down arrow next to Save,
then click Saves as.
13. In the Save As dialog box, navigate to D:\Labfiles\Lab04, then click Save.
5. In the Choose File to Upload dialog box, navigate to D:\Labfiles\Lab04, click Visual Internet
Sales.rdl, click Open, and then click OK.
7. On the Files tab at the top of the page, in the New section, click Upload Document.
9. In the Choose File to Upload dialog box, navigate to D:\Labfiles\Lab04, click InternetSales.rsd,
click Open, and then click OK.
2. On the Data Source Properties page, in the Name box, type AdventureWorksDW.
5. In the User Name box, type adventureworks\serviceacct, in the Password box, type Pa$$w0rd.
6. Select the Use as Windows credentials check box, and then click OK.
10. On the DataSetDataSource: InternetSales page, click the ellipsis (…) under Cancel.
11. On the Select an Item - Webpage dialog box, click AdventureWorksDW, then click OK.
15. In the Visual Internet Sales.rdl pop-up list, click the ellipsis (…), then click Manage Data Sources.
16. On the Manage Data Sources: Visual Internet Sales page, click AdventureWorksDW.
17. On the AdventureWorksDW: Visual Internet Sales page, click the ellipsis (…) under Cancel.
18. On the Select an Item - Webpage Dialog, click AdventureWorksDW, then click OK.
21. In the Internet Explorer window, click the ellipsis (…) next to Visual Internet Sales.
22. In the Visual Internet Sales.rdl popup, click the ellipsis (…), then click Manage Shared Dataset.
23. On the Manage Datasets: Visual Internet Sales page, click InternetSales.
24. On the InternetSales: Visual Internet Sales page, click the ellipsis (…) under Cancel.
25. On the Select an Item -- Webpage Dialog dialog box, click InternetSales, then click OK.
28. On the Reports page, click Visual Internet Sales to view the report on SharePoint.
Results: After completing this exercise, you will have published and viewed an SSRS report to SharePoint.
MCT USE ONLY. STUDENT USE PROHIBITED
MCT USE ONLY. STUDENT USE PROHIBITED
L5-1
2. In the User Account Control dialog box, click Yes, and then wait for the script to finish.
3. On the Data tab, click Add data, and then click Excel.
4. In the Open dialog box, navigate to D:\Labfiles\Lab05\Starter, click call_center_data.xlsx, and then
click Open.
5. In the Add data dialog box, select the PhoneSalesCommission, SalesTarget, and AbandonedCalls
check boxes, and then click Import. Notice that all three datasets are imported onto the data tab.
2. In the Add data from server dialog box, click mia-sql/Reports_SQL2, click AdventureWorks
Sample Reports, and then click SalesEmployees. The result set will be imported.
3. Leave SSMRP open for the next exercise.
Results: At the end of this exercise, you will have defined datasets for your new report.
2. In the Visual properties area, in the Time Levels list, ensure only the Months, Weeks, and Days
check boxes selected.
3. In the Time range presets list, ensure only All is selected. Clear Last year, Last 6 months, and Last
quarter.
6. Click the Show comparison delta switch so that its value is On.
Note: Note that you may need to scroll to the right in the Visual properties area to find all the
properties you should configure.
9. In the Data properties region, in the Series for background chart list, click AbandonedCalls.
10. In the adjacent list, select the Calls, and AbandonedCalls check boxes.
11. In the Comparison series for tiles data list, click AbandonedCalls.
12. In the adjacent list, clear the Calls check box, and then select the AbandonedCalls check box.
13. On the Preview tab, click the different date ranges (month, week, day) in the time navigator to make
sure you understand how it works. When you have finished previewing, click the back button to
return to the Data tab.
2. Grab the sizer and expand the pie chart to fill three grids across and five down.
3. In the Visual properties area, in the Title box, type Abandoned Calls.
4. In the Number format list, click General.
Note: Note that you may need to scroll the Visual properties area to find all the properties you
should configure.
9. In the Data properties region, in the Main Series list, click AbandonedCalls.
10. In the adjacent list, select the Calls and AbandonedCalls check boxes.
11. On the Preview tab, click values in the time navigator, notice that the values on the pie chart change
to reflect the data you have selected. When you have finished previewing, click the back button to
return to the Data tab.
2. Grab the sizer and expand the selection list to fill two grids across and five down.
3. In the Visual properties area, in the Title box, type Call Center Staff.
8. In the Filter these datasets when a selection is made area, select the PhoneSalesCommission
check box, and in the adjacent list, click BusinessEntityId.
MCT USE ONLY. STUDENT USE PROHIBITED
L5-3
9. Select the SalesTarget check box, and in the adjacent list, click BusinessEntityId.
2. Grab the sizer and expand the number to fill two grids across and one down.
3. In the Visual properties area, in the Title box, type Total Sales.
5. Click and drag Number from the element gallery to the top left empty cell of the design grid,
adjacent to the selection list you placed in the previous step.
6. Grab the sizer and expand the number to fill two grids across and one down.
7. In the Visual properties area, in the Title box, type Sales Target.
Note: Note that you may need to scroll the Visual properties area to find all the properties you
should configure.
2. Grab the sizer and expand the progress bar to fill two grids across and two down.
3. In the Visual properties area, in the Title box, type Sales Target Progress.
8. In the Neutral Start box, type 90%, and then click Done.
Note: Note that you may need to scroll the Visual Properties area to find all the properties you
should configure.
10. In the Data properties region, in the Main value list, click PhoneSalesCommission.
11. In the adjacent list, click SalesAmount, and then click Options.
12. Ensure the Call Center Staff and Time navigator 1 check boxes are selected, and then click Done.
14. In the adjacent list, click SalesTarget, and then click Options.
15. Ensure the Call Center Staff check box are selected, and then click Done.
16. On the Preview tab, click the different names in the Call Center Staff list to get a view of each staff
member’s progress towards their sales target. Notice that you can use the time navigator in
combination with the selection list to view sales for a time range. When you have finished previewing,
click the back button to return to the Data tab. Leave SSMRP open for the next exercise.
Results: At the end of this exercise, you will have created the master view of a mobile report definition,
and linked the view to datasets.
2. Click and drag the Time navigator 1 element from the Report elements gallery to the top left cell of
the design grid.
3. Grab the sizer and expand the time navigator to fill six grids across and five down.
4. Click and drag the Total Sales element from the Control Instances gallery to the top leftmost empty
cell of the design grid, below the time navigator.
5. Grab the sizer and expand the time navigator to fill three grids across and three down.
6. Click and drag the Abandoned Calls element from the Control Instances gallery to the top leftmost
empty cell of the design grid, below the time navigator.
7. Grab the sizer and expand the time navigator to fill three grids across and three down.
8. On the Preview tab, preview the tablet view. When you have finished previewing, click the back
button to return to the Layout tab.
2. Click and drag the Call Center Staff element from the Report elements gallery to the top left cell of
the design grid.
3. Grab the sizer and expand the time navigator to fill four grids across and four down.
4. Click and drag the Sales Target Progress element from the Report elements gallery to the top
leftmost empty cell of the design grid, below the selection list.
5. Grab the sizer and expand the time navigator to fill four grids across and two down.
6. On the Preview tab, preview the phone view. When you have finished previewing, click the back
button to return to the Layout tab.
3. In the Save mobile report as dialog box, click Save to file system.
MCT USE ONLY. STUDENT USE PROHIBITED
L5-5
7. In the Save mobile report as dialog box, in the Location box, type /MobileReports, and then click
Save.
8. Close SSMRP.
4. Click 520x730 - tablet. This starts a new browser window in a tablet aspect ratio. In the new browser
window, click Call Center Metrics. This is the tablet view of the report. Close the tablet view window.
5. Click 400x640 - phone. This starts a new browser window in a phone aspect ratio. In the new
browser window, click Call Center Metrics. This is the phone view of the report. Close all Internet
Explorer windows.
Results: At the end of this exercise, you will have published a mobile report to the MobileReports folder
on the http://mia-sql/Reports_SQL2 reporting server.
2. On the New KPI page, in the KPI name box, type Production Line Stoppages.
3. In the Value list, ensure that Set manually is selected, and then in the Enter value box, type 5.
4. In the Status list, ensure that Set manually is selected, and then in the Enter Status list, click -1
(bad).
5. In the Trend set list, ensure that Set manually is selected, and then in the Enter trend set box, type
5;0;1;0;0;6;5;1, and then click Create.
6. Observe the new mobile KPI in the folder, then leave Internet Explorer open for the next task.
2. On the New KPI page, in the KPI name box, type Total Sales.
6. In the Choose a dataset window, click the AdventureWorks Sample Reports folder, and then click
SalesByStateByMonth.
7. In the Choose a field from SalesByStateByMonth window, in the Aggregation list, click Sum, click
ActualSales, and then click OK.
10. In the Choose a dataset window, click the AdventureWorks Sample Reports folder, and then click
SalesByStateByMonth.
11. In the Choose a field from SalesByStateByMonth window, in the Aggregation list, click Sum, click
Sum, click TargetSales, and then click OK.
17. In the Choose a mobile report window, click the MobileReports folder, click Call Centre Metrics,
and then click OK.
19. Observe the new mobile KPI in the folder, then close Internet Explorer.
Results: At the end of this exercise, you will have created a KPI on the server.