Вы находитесь на странице: 1из 226

MCT USE ONLY.

STUDENT USE PROHIBITED


O F F I C I A L M I C R O S O F T L E A R N I N G P R O D U C T

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.

Microsoft and the trademarks listed at


http://www.microsoft.com/about/legal/en/us/IntellectualProperty/Trademarks/EN-US.aspx are trademarks of
the Microsoft group of companies. All other trademarks are property of their respective owners

Product Number: 10990B

Part Number (if applicable): X21-24685

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.

a. If you are a Microsoft IT Academy Program Member:


i. Each license acquired on behalf of yourself may only be used to review one (1) copy of the Microsoft
Instructor-Led Courseware in the form provided to you. If the Microsoft Instructor-Led Courseware is
in digital format, you may install one (1) copy on up to three (3) Personal Devices. You may not
install the Microsoft Instructor-Led Courseware on a device you do not own or control.
ii. For each license you acquire on behalf of an End User or Trainer, you may either:
1. distribute one (1) hard copy version of the Microsoft Instructor-Led Courseware to one (1) End
User who is enrolled in the Authorized Training Session, and only immediately prior to the
commencement of the Authorized Training Session that is the subject matter of the Microsoft
Instructor-Led Courseware being provided, or
2. provide one (1) End User with the unique redemption code and instructions on how they can
access one (1) digital version of the Microsoft Instructor-Led Courseware, or
3. provide one (1) Trainer with the unique redemption code and instructions on how they can
access one (1) Trainer Content,
provided you comply with the following:
iii. you will only provide access to the Licensed Content to those individuals who have acquired a valid
license to the Licensed Content,
iv. you will ensure each End User attending an Authorized Training Session has their own valid licensed
copy of the Microsoft Instructor-Led Courseware that is the subject of the Authorized Training
Session,
v. you will ensure that each End User provided with the hard-copy version of the Microsoft Instructor-
Led Courseware will be presented with a copy of this agreement and each End User will agree that
their use of the Microsoft Instructor-Led Courseware will be subject to the terms in this agreement
prior to providing them with the Microsoft Instructor-Led Courseware. Each individual will be required
to denote their acceptance of this agreement in a manner that is enforceable under local law prior to
their accessing the Microsoft Instructor-Led Courseware,
vi. you will ensure that each Trainer teaching an Authorized Training Session has their own valid
licensed copy of the Trainer Content that is the subject of the Authorized Training Session,
MCT USE ONLY. STUDENT USE PROHIBITED
vii. you will only use qualified Trainers who have in-depth knowledge of and experience with the
Microsoft technology that is the subject of the Microsoft Instructor-Led Courseware being taught for
all your Authorized Training Sessions,
viii. you will only deliver a maximum of 15 hours of training per week for each Authorized Training
Session that uses a MOC title, and
ix. you acknowledge that Trainers that are not MCTs will not have access to all of the trainer resources
for the Microsoft Instructor-Led Courseware.

b. If you are a Microsoft Learning Competency Member:


i. Each license acquired on behalf of yourself may only be used to review one (1) copy of the Microsoft
Instructor-Led Courseware in the form provided to you. If the Microsoft Instructor-Led Courseware is
in digital format, you may install one (1) copy on up to three (3) Personal Devices. You may not
install the Microsoft Instructor-Led Courseware on a device you do not own or control.
ii. For each license you acquire on behalf of an End User or Trainer, you may either:
1. distribute one (1) hard copy version of the Microsoft Instructor-Led Courseware to one (1) End
User attending the Authorized Training Session and only immediately prior to the
commencement of the Authorized Training Session that is the subject matter of the Microsoft
Instructor-Led Courseware provided, or
2. provide one (1) End User attending the Authorized Training Session with the unique redemption
code and instructions on how they can access one (1) digital version of the Microsoft Instructor-
Led Courseware, or
3. you will provide one (1) Trainer with the unique redemption code and instructions on how they
can access one (1) Trainer Content,
provided you comply with the following:
iii. you will only provide access to the Licensed Content to those individuals who have acquired a valid
license to the Licensed Content,
iv. you will ensure that each End User attending an Authorized Training Session has their own valid
licensed copy of the Microsoft Instructor-Led Courseware that is the subject of the Authorized
Training Session,
v. you will ensure that each End User provided with a hard-copy version of the Microsoft Instructor-Led
Courseware will be presented with a copy of this agreement and each End User will agree that their
use of the Microsoft Instructor-Led Courseware will be subject to the terms in this agreement prior to
providing them with the Microsoft Instructor-Led Courseware. Each individual will be required to
denote their acceptance of this agreement in a manner that is enforceable under local law prior to
their accessing the Microsoft Instructor-Led Courseware,
vi. you will ensure that each Trainer teaching an Authorized Training Session has their own valid
licensed copy of the Trainer Content that is the subject of the Authorized Training Session,
vii. you will only use qualified Trainers who hold the applicable Microsoft Certification credential that is
the subject of the Microsoft Instructor-Led Courseware being taught for your Authorized Training
Sessions,
viii. you will only use qualified MCTs who also hold the applicable Microsoft Certification credential that is
the subject of the MOC title being taught for all your Authorized Training Sessions using MOC,
ix. you will only provide access to the Microsoft Instructor-Led Courseware to End Users, and
x. you will only provide access to the Trainer Content to Trainers.
MCT USE ONLY. STUDENT USE PROHIBITED
c. If you are a MPN Member:
i. Each license acquired on behalf of yourself may only be used to review one (1) copy of the Microsoft
Instructor-Led Courseware in the form provided to you. If the Microsoft Instructor-Led Courseware is
in digital format, you may install one (1) copy on up to three (3) Personal Devices. You may not
install the Microsoft Instructor-Led Courseware on a device you do not own or control.
ii. For each license you acquire on behalf of an End User or Trainer, you may either:
1. distribute one (1) hard copy version of the Microsoft Instructor-Led Courseware to one (1) End
User attending the Private Training Session, and only immediately prior to the commencement
of the Private Training Session that is the subject matter of the Microsoft Instructor-Led
Courseware being provided, or
2. provide one (1) End User who is attending the Private Training Session with the unique
redemption code and instructions on how they can access one (1) digital version of the
Microsoft Instructor-Led Courseware, or
3. you will provide one (1) Trainer who is teaching the Private Training Session with the unique
redemption code and instructions on how they can access one (1) Trainer Content,
provided you comply with the following:
iii. you will only provide access to the Licensed Content to those individuals who have acquired a valid
license to the Licensed Content,
iv. you will ensure that each End User attending an Private Training Session has their own valid licensed
copy of the Microsoft Instructor-Led Courseware that is the subject of the Private Training Session,
v. you will ensure that each End User provided with a hard copy version of the Microsoft Instructor-Led
Courseware will be presented with a copy of this agreement and each End User will agree that their
use of the Microsoft Instructor-Led Courseware will be subject to the terms in this agreement prior to
providing them with the Microsoft Instructor-Led Courseware. Each individual will be required to
denote their acceptance of this agreement in a manner that is enforceable under local law prior to
their accessing the Microsoft Instructor-Led Courseware,
vi. you will ensure that each Trainer teaching an Private Training Session has their own valid licensed
copy of the Trainer Content that is the subject of the Private Training Session,
vii. you will only use qualified Trainers who hold the applicable Microsoft Certification credential that is
the subject of the Microsoft Instructor-Led Courseware being taught for all your Private Training
Sessions,
viii. you will only use qualified MCTs who hold the applicable Microsoft Certification credential that is the
subject of the MOC title being taught for all your Private Training Sessions using MOC,
ix. you will only provide access to the Microsoft Instructor-Led Courseware to End Users, and
x. you will only provide access to the Trainer Content to Trainers.

d. If you are an End User:


For each license you acquire, you may use the Microsoft Instructor-Led Courseware solely for your
personal training use. If the Microsoft Instructor-Led Courseware is in digital format, you may access the
Microsoft Instructor-Led Courseware online using the unique redemption code provided to you by the
training provider and install and use one (1) copy of the Microsoft Instructor-Led Courseware on up to
three (3) Personal Devices. You may also print one (1) copy of the Microsoft Instructor-Led Courseware.
You may not install the Microsoft Instructor-Led Courseware on a device you do not own or control.

e. If you are a Trainer.


i. For each license you acquire, you may install and use one (1) copy of the Trainer Content in the
form provided to you on one (1) Personal Device solely to prepare and deliver an Authorized
Training Session or Private Training Session, and install one (1) additional copy on another Personal
Device as a backup copy, which may be used only to reinstall the Trainer Content. You may not
install or use a copy of the Trainer Content on a device you do not own or control. You may also
print one (1) copy of the Trainer Content solely to prepare for and deliver an Authorized Training
Session or Private Training Session.
MCT USE ONLY. STUDENT USE PROHIBITED
ii. You may customize the written portions of the Trainer Content that are logically associated with
instruction of a training session in accordance with the most recent version of the MCT agreement.
If you elect to exercise the foregoing rights, you agree to comply with the following: (i)
customizations may only be used for teaching Authorized Training Sessions and Private Training
Sessions, and (ii) all customizations will comply with this agreement. For clarity, any use of
“customize” refers only to changing the order of slides and content, and/or not using all the slides or
content, it does not mean changing or modifying any slide or content.

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.

3. LICENSED CONTENT BASED ON PRE-RELEASE TECHNOLOGY. If the Licensed Content’s subject


matter is based on a pre-release version of Microsoft technology (“Pre-release”), then in addition to the
other provisions in this agreement, these terms also apply:

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.

11. APPLICABLE LAW.


a. United States. If you acquired the Licensed Content in the United States, Washington state law governs
the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of laws
principles. The laws of the state where you live govern all other claims, including claims under state
consumer protection laws, unfair competition laws, and in tort.
MCT USE ONLY. STUDENT USE PROHIBITED
b. Outside the United States. If you acquired the Licensed Content in any other country, the laws of that
country apply.

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.

This limitation applies to


o anything related to the Licensed Content, services, content (including code) on third party Internet
sites or third-party programs; and
o claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence,
or other tort to the extent permitted by applicable law.

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.

LIMITATION DES DOMMAGES-INTÉRÊTS ET EXCLUSION DE RESPONSABILITÉ POUR LES


DOMMAGES. Vous pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de dommages
directs uniquement à hauteur de 5,00 $ US. Vous ne pouvez prétendre à aucune indemnisation pour les autres
dommages, y compris les dommages spéciaux, indirects ou accessoires et pertes de bénéfices.
Cette limitation concerne:
• tout ce qui est relié au le contenu sous licence, aux services ou au contenu (y compris le code)
figurant sur des sites Internet tiers ou dans des programmes tiers; et.
• les réclamations au titre de violation de contrat ou de garantie, ou au titre de responsabilité
stricte, de négligence ou d’une autre faute dans la limite autorisée par la loi en vigueur.
MCT USE ONLY. STUDENT USE PROHIBITED
Elle s’applique également, même si Microsoft connaissait ou devrait connaître l’éventualité d’un tel dommage. Si
votre pays n’autorise pas l’exclusion ou la limitation de responsabilité pour les dommages indirects, accessoires
ou de quelque nature que ce soit, il se peut que la limitation ou l’exclusion ci-dessus ne s’appliquera pas à votre
égard.

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.

Revised July 2013


MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services xi
MCT USE ONLY. STUDENT USE PROHIBITED
xii Analyzing Data with SQL Server Reporting Services

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 – Content Developer

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.

John Daisley – Content Developer


John Daisley is a mixed vendor Business Intelligence and Data Warehousing contractor with a wealth of
data warehousing and Microsoft SQL Server database administration experience. Having worked in the
Business Intelligence arena for over a decade, John has extensive experience of implementing business
intelligence and database solutions using a wide range of technologies and across a wide range of
industries including airlines, engineering, financial services, and manufacturing.

Nick Anderson – Content Developer


Nick Anderson MBCS MISTC has been a freelance Technical Writer since 1987 and Trainer since 1999. Nick
has written internal and external facing content in many business and technical areas including
development, infrastructure and finance projects involving SQL Server, Visual Studio and similar tools.
Nick provides services for both new and existing document processes from knowledge capture to
publishing.

Phil Stollery – Content Developer


Phil has been providing IT consultancy to South West England since graduating in Computer Science. He
has worked with small and large organizations to improve their use of SQL Server, predominantly focusing
on business information and surrounding technologies such as SharePoint. Most recently, Phil worked
with the National Health Service in Gloucestershire on a custom intranet built on SharePoint. A trusted
partner, he can communicate at all levels, from technical staff to senior management. Phil brings a wealth
of experience that enhances any project.

Rachel Horder – Content Developer


Rachel Horder graduated with a degree in Journalism and began her career in London writing for The
Times technology supplement. After discovering a love for programming, Rachel became a full-time
developer, and now provides SQL Server consultancy services to businesses across a wide variety of
industries. Rachel is MCSA certified, and continues to write technical articles and books, including What's
New in SQL Server 2012. As an active member of the SQL Server community, Rachel organizes the Bristol
SQL Server Club user group, runs the Bristol leg of SQL Relay, and is a volunteer at SQLBits.

Geoff Allix – Technical Reviewer


Geoff Allix is a Microsoft SQL Server subject matter expert and professional content developer at Content
Master—a division of CM Group Ltd. As a Microsoft Certified Trainer, Geoff has delivered training courses
on SQL Server since version 6.5. Geoff is a Microsoft Certified IT Professional for SQL Server and has
extensive experience in designing and implementing database and BI solutions on SQL Server
technologies, and has provided consultancy services to organizations seeking to implement and optimize
database solutions.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services xiii

Lin Joyner – Technical Reviewer


Lin is an experienced Microsoft SQL Server developer and administrator. She has worked with SQL Server
since version 6.0 and previously as a Microsoft Certified Trainer, delivered training courses across the UK.
Lin has a wide breadth of knowledge across SQL Server technologies, including BI and Reporting Services.
Lin also designs and authors SQL Server and .NET development training materials. She has been writing
instructional content for Microsoft for over 15 years.
MCT USE ONLY. STUDENT USE PROHIBITED
xiv Analyzing Data with SQL Server Reporting Services

Contents
Module 1: Introduction to Business Intelligence and Data Modeling
Module Overview 1-1 

Lesson 1: Introduction to Business Intelligence 1-2 

Lesson 2: The Microsoft Business Intelligence Platform 1-8 

Lesson 3: Introduction to Reporting Services 1-13 

Lab: Exploring a BI Solution 1-20 

Module Review and Takeaways 1-23 

Module 2: Reporting Services Data


Module Overview 2-1 
Lesson 1: Data Sources 2-2 

Lesson 2: Connection Strings 2-8 

Lesson 3: Datasets 2-16 


Lesson 4: Filters and Parameters 2-20 

Lab A: Configuring Data Access with Report Builder 2-32 

Lab B: Configuring Data Access with Report Designer 2-35 


Module Review and Takeaways 2-38 

Module 3: Implementing Reports


Module Overview 3-1 

Lesson 1: Creating a Report with the Report Wizard 3-2 


Lesson 2: Creating a Report 3-6 

Lesson 3: Show Data Graphically in a Report 3-16 

Lab A: Creating a Report with Report Designer 3-29 


Lab B: Creating a Report with Report Builder 3-33 

Module Review and Takeaways 3-37 

Module 4: Configuring Reports


Module Overview 4-1 

Lesson 1: Implementing Filters and Parameters 4-2 

Lesson 2: Implementing Sorting and Grouping 4-8 

Lesson 3: Publishing a Report 4-18 

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 


MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services xv

Module 5: Create Mobile Reports


Module Overview 5-1 

Lesson 1: Overview of SQL Server Mobile Reports 5-2 

Lesson 2: Preparing Data for Mobile Reports 5-7 

Lesson 3: SQL Server Mobile Report Publisher 5-13 

Lab: Working with Mobile Reports 5-23 

Module Review and Takeaways 5-29 

Lab Answer Keys


Module 1 Lab: Exploring a BI Solution L01-1

Module 2 Lab A: Configuring Data Access with Report Builder L02-1

Module 2 Lab B: Configuring Data Access with Report Designer L02-4

Module 3 Lab A: Creating a Report with Report Designer L03-1

Module 3 Lab B: Creating a Report with Report Builder L03-5


Module 4 Lab A: Create and Publish Reports That Include Parameters with
Report Designer L04-1

Module 4 Lab B: Create and Publish Reports That Include Parameters with
Report Builder L04-9

Module 5 Lab: Working with Mobile Reports L05-1


MCT USE ONLY. STUDENT USE PROHIBITED
MCT USE ONLY. STUDENT USE PROHIBITED
About This Course i

About This Course


This section provides a brief description of the course, audience, suggested prerequisites, and course
objectives.

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:

 20761A/B: Querying Data with Transact-SQL

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

 Create reports with report designer and/or report designer

 Configure reports with report designer and/or report builder

 Create SQL Server mobile reports

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.

o Lab Answer Keys: provide step-by-step lab solution guidance.

Additional Reading: Course Companion Content on the


http://www.microsoft.com/learning/en/us/companion-moc.aspx Site: searchable, easy-to-
browse digital content with integrated premium online resources that supplement the Course
Handbook.

 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®.

Additional Reading: Student Course files on the


http://www.microsoft.com/learning/en/us/companion-moc.aspx Site: includes the
Allfiles.exe, a self-extracting executable file that contains all required files for the labs and
demonstrations.

 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.

o To provide additional comments or feedback on the course, send an email to


support@mscourseware.com. To inquire about the Microsoft Certification Program, send an
email to mcphelp@microsoft.com.
MCT USE ONLY. STUDENT USE PROHIBITED
About This Course iii

Virtual Machine Environment


This section provides the information for setting up the classroom environment to support the business
scenario of the course.

Virtual Machine Configuration


In this course, you will use Microsoft® Hyper-V™ to perform the labs.

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:

Virtual machine Role

10990B-MIA-DC MIA-DC1 is a domain controller.

10990B-MIA-SQL MIA-SQL has SQL Server 2016 CTP 3.3 installed

MSL-TMG1 TMG1 is used to access the internet

Software Configuration
The following software is installed on the virtual machines:

 Windows Server 2012 R2

 SQL2016

 Microsoft Office 2016

 SharePoint 2013 SP1

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.

Course Hardware Level


To ensure a satisfactory student experience, Microsoft Learning requires a minimum equipment
configuration for trainer and student computers in all Microsoft Certified Partner for Learning Solutions
(CPLS) classrooms in which Official Microsoft Learning Product courseware is taught.

 Intel Virtualization Technology (Intel VT) or AMD Virtualization (AMD-V) processor

 Dual 120-gigabyte (GB) hard disks 7200 RM Serial ATA (SATA) or better

 16 GB of random access memory (RAM)

 DVD drive

 Network adapter

 Super VGA (SVGA) 17-inch monitor

 Microsoft mouse or compatible pointing device


MCT USE ONLY. STUDENT USE PROHIBITED
iv About This Course

 Sound card with amplified speakers

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 

Lesson 1: Introduction to Business Intelligence 1-2 

Lesson 2: The Microsoft Business Intelligence Platform 1-8 

Lesson 3: Introduction to Reporting Services 1-13 

Lab: Exploring a BI Solution 1-20 

Module Review and Takeaways 1-23 

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:

 Describe the trends in BI.


 Explain the options available in the Microsoft BI platform.

 Give an overview of Reporting Services.


MCT USE ONLY. STUDENT USE PROHIBITED
1-2 Introduction to Business Intelligence and Data Modeling

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.

 Describe the project roles within BI.

 Explain how enterprise BI data models work.

Business Intelligence Scenarios


Big data has been big news for a while now. Since
the rise of the Internet, social media, and the rapid
growth of e-commerce, more and more data is
being generated, gathered, and analyzed.
Supermarkets and retail outlets offer store cards,
loyalty cards, or reward cards—depending on which
label they use—because they want to track
spending habits and use this data to sell you more.
They gather this data, analyze what you like to buy,
and then offer incentives to entice you to buy more
of the same, or similar. Meanwhile, your online
habits are monitored by cookies, and
advertisements show up on sites, tempting you to buy something you might have searched for earlier.

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.

Trends in Business Intelligence


The possibilities for analysis grow in line with the
increasing number of data sources, and expanding
volumes of data. With Microsoft SQL Server® 2016
offering in-memory analytics, data does not have to
be moved outside of the database, and
organizations can perform real-time operational
analytics. The BI trend is moving away from
analyzing past data only, to analyzing real-time
data, and using historical data to predict the future.

Self-Service Reporting and Analysis


It could be argued that self-service BI has been
around since spreadsheets first entered the software
market, enabling users to crunch numbers at their desks. The almost universal adoption of Microsoft Excel
has enabled this trend to continue. With the recent integration of the four power tools—PowerPivot,
Power Query, Power View, and Power Map—Excel users can acquire data from a myriad of sources, and
then model, transform, and present that data in sophisticated visualizations. The attraction of Excel and its
power tools is the independence it offers to business users. If users can access the data they need, they
can immediately begin shaping and formatting that data, and designing reports to their own
specification.
MCT USE ONLY. STUDENT USE PROHIBITED
1-4 Introduction to Business Intelligence and Data Modeling

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.

Increasing Adoption of BI by a Wider Range of Organizations


BI is no longer the reserve of large organizations with large budgets to throw at data warehousing
projects. Any business operating on the web gathers information about their customers’ spending habits,
the products they viewed, and their buying decisions. It now seems that our online presence, enhanced
through the proliferation of mobile devices, is continuously monitored, with all our moves and
preferences stored for analysis. To be more efficient, and therefore more competitive, organizations of all
sizes must gather data to some extent. However, gathering this data is of no use unless it is converted to
actionable information. Along with increasing volumes of data, the availability of cheaper, easier to use
solutions has helped drive the market, meaning organizations with even the smallest of budgets can
devote some level of resource to BI.

Availability of Out-of-the-Box Solutions


Organizations can license sophisticated BI solutions from the major vendors in the market, including
Tableau, Qlik, Pyramid Analytics, Microsoft, Oracle, IBM, SAP, SAS, and more. You can use these solutions
to create highly visual reports. With the ability to connect to a variety of data sources, you can create
reports and dashboards. However, depending on the vendor, many of the major solutions require
expensive server and client licenses, in addition to trained users who can create the reports.

Business Intelligence Project Roles


Developing a BI solution requires upfront planning
and designing to ensure the project stays on target,
and comes to fruition without major issues. The BI
project team comprises a number of roles, with the
following typically being the minimum required. If it
is a new project, the program or project manager
may hire and instruct a data architect and a
technical architect—after much of their planning is
complete, BI developers will be hired. This depends
on the organization, how many projects are in the
pipeline, and if contract staff are to provide extra
resource.

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:

 Acquiring funding for projects.


 Creating budgets.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 1-5

 Engaging with stakeholders to determine requirements.

 Analyzing the impact of the project going into production.

 Communicating vision to end users and stakeholders.

 Being responsible for building teams and hiring new employees.

 Undertaking risk assessment and management.

 Setting standards and ensuring these are met.

 Establishing project priorities, and creating deadlines.

 Managing the expectations of both users and stakeholders.

 Providing status updates.

 Measuring project performance and outcomes.

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:

 Developing the data architecture of the organization.

 Analyzing data requirements and planning for future change requirements.


 Performing logical data modeling.

 Resolving issues between different systems and different data sources.

 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:

 Assessing the existing BI environment.

 Evaluating development technologies.

 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.

 Communicating with operations and DBA teams.

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.

 Ensuring the data being used is fit for purpose.

 Documenting the origin and sources of data on each metadata element.


MCT USE ONLY. STUDENT USE PROHIBITED
1-6 Introduction to Business Intelligence and Data Modeling

 Auditing data practices to ensure business compliance.

 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.

 Establishing data access security requirements.

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.

 Helping to identify and assess potential data sources.

 Recommending appropriate scope of requirements and priorities.


 Validating that BI meets requirements and service level agreements.

 Working with end users to coordinate prototype reviews and user acceptance.

 Gathering and explaining prototype feedback.

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:

 Designing ETL packages to load data into a staging area.


 Building ETL packages that perform data transformations in the staging area.

 Writing ETL packages to load the transformed data into the data warehouse.

 Creating and managing ETL job schedules.


 Monitoring the ETL process for performance issues and failures.

 Debugging issues in the ETL process.

 Developing the data warehouse database.

 Resolving data issues.

 Building cubes.

 Designing and developing reports.

 Writing code to extract data from the data warehouse.

 Creating a schedule for publishing and distributing reports.


MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 1-7

Enterprise BI Data Models


Enterprise data modeling involves the creation of a
consistent view of data elements and their
relationships in the organization. When more than
one data modeler is working on the model, it is
important that standards and naming conventions
are created and adhered to. Data might be
imported from different systems, so naming
conventions are likely to vary across sources.

This inconsistency should be addressed during the


modeling process. If the model comprises a data
warehouse, naming conventions should be used for
fact, lookup, and history tables. Also, conventions
can be applied to columns to denote keys, codes, and identifiers. The model can consist of a number of
subject areas, reflecting different departments in the organization.

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:

 Describe the Microsoft BI platform technologies.

 Explain the BI semantic models.


 List the installation requirements for common scenarios.

 Describe SharePoint configuration considerations.

Microsoft Business Intelligence Technologies


The Microsoft BI platform consists of a number of
technologies that provide a versatile, robust, and
thorough BI solution.

SQL Server 2016, Azure SQL Database,


and Azure SQL Data Warehouse
Data is central to BI and SQL Server provides a data
platform with the performance, reliability, and
security required for a mission critical system.
Furthermore, Azure SQL Database and Azure SQL
Data Warehouse extend this capability to the cloud
and add secure global access, and scalability on the
fly, in addition to built-in data protection and high
availability.

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 Power BI™


Power BI includes both Power BI on the Internet and Power BI Desktop for Windows®. You use these
systems to develop rich visualizations and dashboards for consumption through web browsers or mobile
apps.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 1-9

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:

Comparing Tabular and Multidimensional Solutions (SSAS)


http://aka.ms/grgoyo
MCT USE ONLY. STUDENT USE PROHIBITED
1-10 Introduction to Business Intelligence and Data Modeling

Installation Requirements for Common Scenarios


The number of servers required for a BI deployment
varies with the size of the system, both in amount
of data and amount of use, and the functionality
required.

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.

Considerations for SharePoint Configuration


The default installation of Reporting Services is in
native mode. This enables the report server to
process all report viewing and report management.
The alternative installation method for Reporting
Services is SharePoint mode. This mode has a
Report server, which handles report processing and
subscription, and a Reporting Services add-in for
SharePoint—this adds a Reporting Services user
interface to a SharePoint web front-end server.
SharePoint mode, therefore, can be used to
integrate reporting with an existing SharePoint
infrastructure.

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.

PowerPivot for SharePoint 2013 and Reporting Services


One Server

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: Reporting Services in SharePoint-integrated Mode


In this demonstration, you will see how to:

 View data using a Transact-SQL query.

 View data using a Reporting Services report.

 View a report on SharePoint.

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. On the File menu, point to Open, and then click File.

4. In the Open File dialog box, navigate to D:\Demofiles\Mod01, click Sales_Order_Detail_Query.sql,


and then click Open.

5. Review the query, and click Execute.

View Data in a Reporting Services Report

1. On the taskbar, click Internet Explorer.

2. In the address bar, type mia-sql/Reports_SQL2, and then press Enter.

3. Click the AdventureWorks Sample Reports folder, and then click Sales_Order_Detail.

4. In the First Order ID box, type 57033.


5. In the Last Order ID box, type 57033, and then click View Report.

6. Compare the output from the query and the report.


MCT USE ONLY. STUDENT USE PROHIBITED
1-12 Introduction to Business Intelligence and Data Modeling

Open a Report to SharePoint

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.

3. In the Parameters pane, in the First Order ID box, type 57033.

4. In the Last Order ID box, type 57033, and then click Apply.

5. Compare the output.

6. Close Internet Explorer and SQL Server Management Studio, without saving any changes.

Check Your Knowledge


Question

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?

Select the correct answer.

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:

 Describe considerations for cloud and on-premises deployments.

 List differences between Native mode and SharePoint Integrated mode.

 Describe the Reporting Services report authoring tools.

 Explain the differing job roles of report authors.

Cloud vs. On-Premises


In Azure, there was briefly a Reporting as a Service
solution called SQL Azure Reporting Services.
However, this service was withdrawn and a far more
functional cloud-based reporting solution can be
created with a virtual machine running on Azure
with SQL Server, including Reporting Services.

Cloud computing has a number of benefits over a


traditional on-premises solution. These benefits
include:

Low Initial Capital Outlay


By using a cloud-based solution, there is no capital
outlay for hardware, and most software costs become part of a monthly subscription model.

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.

Global Access to Systems


The only requirement to access a cloud-based system is an Internet connection. Developers of your
systems and consumers of your data can, therefore, be located almost anywhere in the world.

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.

Native Mode vs. SharePoint Integrated Mode


SharePoint Integrated mode has traditionally been
deployed by organizations that have SharePoint;
Native mode has been deployed by organizations
that do not have SharePoint.

Integrated mode can still produce reports that


appear as SharePoint documents and use
SharePoint security. However, with SQL Server 2016,
Native mode has several key features that are not
available in Integrated mode. This makes the choice
more complex, and you should consider which
features are most important. Some new features,
such as paginated reports and HTML5 rendering,
are available in both Native mode and SharePoint Integrated mode.

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

Reporting Services Report Authoring Tools


There are two main tools available to help you
create Reporting Services reports—Report Designer
and Report Builder. There is also the SQL Server
Mobile Report Publisher for mobile reports.

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.

Mobile Report Publisher


SQL Server Mobile Report Publisher is used specifically for the creation of mobile reports that are
designed for smartphones and tablets. Reports can be developed without any data then, when the design
is complete, published shared datasets can be used to populate the reports. Report creation is very
intuitive and reports can be viewed by using a browser or an app on a mobile device.

Roles That Create Reports


Report authors come from many job roles. The
ultimate goal for a successful BI project is to enable
a business to make quicker and better decisions.
Therefore, reports will be created, managed and
improved by many different roles within an
organization. Some common scenarios are explored
in further detail here, taking into account an
individual’s job role and how this might affect their
choice of report authoring tool.

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: Reporting Services and Cloud Data


In this demonstration, you will see how to:

 Add an Azure data source to a Report Builder report.

 Add an Azure dataset to a Report Builder report.

 Display data from both on-premises and Azure-based database.

Demonstration Steps
Open the Sales_Order_Detail Report in Report Builder

1. On the taskbar, click Internet Explorer.

2. In the address bar, type mia-sql/Reports_SQL2, and then press Enter.


3. Click the AdventureWorks Sample Reports folder.

4. In the top right of the Sales_Order_Detail report, click the ellipses, and then click MANAGE.

5. In the toolbar, click Edit in Report Builder.

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

7. In the Connect to Report Server dialog, click Yes.

Add an Azure Data Source

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.

3. Click Use a connection embedded in my report.

4. In the Select connection type list, click Microsoft Azure SQL Database.

5. On the taskbar, click Internet Explorer.


6. In the address bar, type portal.azure.com, and then press Enter.

7. Use your Azure pass credentials to sign in to the portal.

8. On the left, click SQL databases.

9. Click the AdventureWorksLT database you created in the Preparation step.

10. Copy the Server name into the clipboard.

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.

13. Click Use SQL Server Authentication.

14. In the User name box, type Student.

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.

18. In the Test Connection Result dialog box, click OK.

19. In the Data Source Properties dialog box, click OK.


MCT USE ONLY. STUDENT USE PROHIBITED
1-18 Introduction to Business Intelligence and Data Modeling

Add an Azure Dataset and Chart

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.

3. In the Data source list, click AdventureWorks_on_Azure.

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.

12. Delete the Legend, and then click Run.

13. In the First Order ID boxes, type 57033.

14. In the Last Order ID boxes, type 57033, and then click View Report.

15. Note that there is no data for the pie chart.


16. In the First Order ID boxes, type 71774.

17. In the Last Order ID boxes, type 71774, and then click View Report.

18. In the First Order ID boxes, type 71780.

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.

21. Close all open windows, without saving any changes.


MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 1-19

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

1 Updated web portal

2 Paginated reports

3 Mobile reports

4 HTML5 rendering

5 KPIs

Category 1 Category 2

Native mode only Native mode and SharePoint


Integrated mode
MCT USE ONLY. STUDENT USE PROHIBITED
1-20 Introduction to Business Intelligence and Data Modeling

Lab: Exploring a BI Solution


Scenario
You have data stored in a data warehouse that is then aggregated in an Analysis Services cube, and is
presented in a Reporting Services report. You have decided to compare the different ways that these
systems present the data.

Objectives
After completing this lab, you will have:

 Explored a data warehouse.

 Explored a data model.

 Explored a report.

Estimated Time: 45 minutes

Virtual machine: 10990B-MIA-SQL

User name: ADVENTUREWORKS\Student

Password: Pa$$w0rd

Exercise 1: Exploring a Data Warehouse


Scenario
You have an existing data warehouse and want to understand how you can query data in the data
warehouse; how complicated this would be for users; and how the results are presented.

The main tasks for this exercise are as follows:

1. Prepare the Lab Environment

2. View the Design of the AdventureWorksDW Data Warehouse

3. View Sales Data from the AdventureWorksDW Data Warehouse

 Task 1: Prepare the Lab Environment


1. Ensure 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.

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.

 Task 2: View the Design of the AdventureWorksDW Data Warehouse


 Connect to the MIA-SQL database engine and display the dbo.Reseller Sales database diagram in
the AdventureWorksDW database.

 Task 3: View Sales Data from the AdventureWorksDW Data Warehouse


1. Open and execute the D:\Labfiles\Lab01\Starter\SalesQuery.sql query.

2. Note that the total sales for the employee David Campbell is $106,380.438.

Results: After completing this exercise, you will have:

Viewed the design of a data warehouse.

Viewed sales data in a data warehouse.


MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 1-21

Exercise 2: Exploring a Data Model


Scenario
You have an existing Analysis Services cube and want to understand how you can query data in the cube;
how complicated this would be for users; and how the results are presented.

The main tasks for this exercise are as follows:

1. Display the Total Reseller Sales

2. Display the Reseller Sales for Each Employee


3. Filter the Results

4. Explore the Same Data in an Excel Pivot Table

 Task 1: Display the Total Reseller Sales


1. Connect to the MIA-SQL Analysis Services database.
2. Browse the AdventureWorks cube in the AdventureWorksDWMultidimensional-EE database.

3. Display the total Reseller Sales Amount for the cube.

 Task 2: Display the Reseller Sales for Each Employee


1. Display Reseller Sales amount by employee, showing their full name.
2. Note the sales amount for David R. Campbell.

 Task 3: Filter the Results


1. Filter the Reseller Sales amount to only show data for April 2013.

2. Note that the total sales for the employee David R. Campbell is $106,380.438.

 Task 4: Explore the Same Data in an Excel Pivot Table


1. Within Microsoft SQL Server Management Studio, analyze the data in Excel.

2. Use the same data as in previous steps to create a Pivot Table.

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.

Results: After completing this exercise, you will have:

Displayed total sales.

Displayed sales by employee.

Displayed sales by employee for a specific month.


MCT USE ONLY. STUDENT USE PROHIBITED
1-22 Introduction to Business Intelligence and Data Modeling

Exercise 3: Exploring Reports


Scenario
You have an existing Reporting Services report and want to understand how you can query data in the
report; how complicated this would be for users; and how the results are presented.

The main tasks for this exercise are as follows:

1. View Report Data

 Task 1: View Report Data


1. Connect to the report server at mia-sql/Reports_SQL2/Pages/Folder.aspx.

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.

5. Close all open windows, without saving any changes.

Results: After completing this exercise, you will have:

Viewed sales data in a report.


MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 1-23

Module Review and Takeaways


In this module, you’ve seen the tools provided by Microsoft to analyze data and produce Business
Information reports. You’ve seen how Reporting Services can be integrated with SharePoint to enable
reports to be more easily shared within an organization. Finally, you’ve seen how easy it is to query data
on Azure and combine different data sources inside a single Reporting Services report. The following
modules will be going into further detail about the tools used, and also include details on the new Mobile
Report Publishing tool made available with SQL Server 2016.
MCT USE ONLY. STUDENT USE PROHIBITED
MCT USE ONLY. STUDENT USE PROHIBITED
2-1

Module 2
Reporting Services Data
Contents:
Module Overview 2-1 

Lesson 1: Data Sources 2-2 

Lesson 2: Connection Strings 2-8 

Lesson 3: Datasets 2-16 

Lesson 4: Filters and Parameters 2-20 

Lab A: Configuring Data Access with Report Builder 2-32 

Lab B: Configuring Data Access with Report Designer 2-35 


Module Review and Takeaways 2-38 

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 data sources.


 Work with connection strings.

 Describe datasets.

 Use filters and parameters.


MCT USE ONLY. STUDENT USE PROHIBITED
2-2 Reporting Services Data

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:

 Define data sources.

 Explain the differences between shared data sources and embedded data sources.

 Describe data processing extensions.

What Are Data Sources?


A data source—sometimes referred to as a data
connection—is an object that contains the
information that is needed to connect to a source
system for a report.

Data sources are made up of three main


components:

 The source system type. This indicates the


technology of the source system. For example,
a source system might be an instance of SQL
Server, a SQL Server Analysis Services (SSAS)
model, or another database technology to
which SSRS can connect.

 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

Shared and Embedded Data Sources


There are two ways to include data sources in your
reports:

 Embedded data sources

 Shared data sources

Embedded Data Sources


When you use an embedded data source, the data
source definition is included as part of the
definition of a single report. An embedded data
source is not a separate object on the SSRS server,
and it cannot be shared between different report
definitions.

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.

Shared Data Sources


A shared data source 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
data source.

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.

Working with Data Sources


Whether you use Report Designer or Report Builder to create your reports, you can always create reports
that are based on existing shared data sources, or you can use embedded data sources.

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

Data Processing Extensions


As you saw at the start of this lesson, a data source
definition includes a property that defines the
source system type. Data processing extensions
define the source system type of a data source
and simplify the interaction between SSRS and a
diverse range of data sources.

By default, SSRS includes data processing


extensions for different source system types,
including:

 SQL Server database engine


 SSAS

 Microsoft SharePoint® list

 Azure SQL Database

 Oracle

 SAP NetWeaver Business Intelligence

 Hyperion Essbase
 Teradata

 OLE DB data sources

 Open Database Connectivity (ODBC) data sources

Additionally, SSRS can use any Microsoft ADO.NET data provider.

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: Creating a Data Source


In this demonstration, you will see how to:

 Use the SSRS portal to create a shared data source.

 Use Report Designer to define a shared data source.

 Use Report Builder to define an embedded data source.

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.

2. In the D:\Demofiles\Mod02 folder, run Setup.cmd as administrator.

3. In the User Account Control dialog box, click Yes.

4. In Windows® Internet Explorer®, browse to mia-sql/Reports_SQL2, and then click DataSources.

5. On the toolbar, click New, and then click Data Source.

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.

8. In the Connection string box, type the following code:

data source="(local)";initial catalog=AdventureWorksDW

9. Click Test connection. Note that the test succeeds, and then click Create.
10. Leave Internet Explorer open for the next demonstration.

Use Report Designer to Define a Shared Data Source

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

8. In the Test results dialog box, click OK.

9. In the Connection Properties dialog box, click OK.

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.

Use Report Builder to Define an Embedded Data Source

1. In Internet Explorer, click Home.


2. On the toolbar, click New, and then click Paginated Report.

3. In the Internet Explorer dialog box, click Allow.

4. In the Connect to Report Server dialog box, click Yes.


5. In the New Report or Dataset dialog box, click Blank Report.

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.

11. In the Test results dialog box, click OK.

12. In the Connection Properties dialog box, click OK.

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.

14. On the File menu, click Save.

15. In the Save As Report dialog box, double-click DataSources.

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.

Check Your Knowledge


Question

You want to create a data source that several reports will use. Which type of data
source should you create?

Select the correct answer.

A shared data source.

An embedded data source.

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:

 Explain the purpose of connection strings.

 Work with SQL Server database engine connection strings.


 Work with SSAS Services connection strings.

 Recognize connection strings for other data providers.

What Are Connection Strings?


Connection string is a widely used computing term
that refers to the information that is required to
configure a connection from an application to a
data source, stored as a delimited string. A
connection string is typically in the format that is
shown in the following code example:

property name=value;[property
name=value;…]

A connection string might be made up of many


properties and values. When an application
attempts to connect to a data source, the
connection string is passed as an argument to the software component that is responsible for establishing
the connection. This software component is often referred to as a data provider or database driver.

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:

 The location of the data source.

 Authentication credentials.

 Properties to further configure the data source.

Data Source Location


The data provider uses the data source location to find the data source; a data source location is common
to all connection strings, although its form can vary, based on the data source type and the configuration
of your network. Most commonly, the data source location takes the form of a server name or an IP
address, but it could alternatively take the form of a URL or a file system location. In some more complex
environments, the data source location information in a connection string might also include the names
of secondary servers to be used if the primary server is inaccessible.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 2-9

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.

SQL Server Database Engine Connection Strings


Although you can configure SQL Server in several
different ways, the connection string that is
required to use a database engine instance as a
data source is similar for each of them. For all SQL
Server database engine connections, the data
source location is defined by using the data source
property. The database that the connection should
open is defined by using the initial catalog
property.

Note: Remember that the authentication


details—a user name and password or Windows
authentication—are not specified in the connection string for SSRS data sources. Instead,
authentication details are specified separately and held in secure storage on the report server.

SQL Server Database Engine


The following examples show the connection string that is required to connect to database engine
instances that are installed in different ways. You use these connection strings with the data source type
Microsoft SQL Server.

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

Connecting to the Default Instance on the Local Instance of SQL Server


data source="(local)";initial catalog=AdventureWorksDW

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.

Connecting to a Named Instance on the Local Instance of SQL Server


data source=localhost\SQL2;initial catalog=AdventureWorksDW

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.

Connecting to the Default Instance on a Remote Instance of SQL Server


data source=DBServer;initial catalog=AdventureWorksDW

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.

Connecting to a Named Instance on a Remote Instance of SQL Server


data source=DBServer\SQL3;initial catalog=AdventureWorksDW

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.

Azure SQL Database


When you use Azure SQL Database as a data source for an SSRS report, the connection string is almost
identical to the connection string for a SQL Server database engine instance. You use the data source type
Microsoft SQL Azure with this connection string.

The following example shows how to connect to an Azure SQL Database called AdventureWorksDW that
runs on an Azure SQL Database server called azuresql.

Connecting to an Azure SQL Database


data source=azuresql.database.windows.net;initial
catalog=AdventureWorksDW;Encrypt=True;TrustServerCertificate=False

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

SQL Server Connection Type (SSRS)


http://aka.ms/Tqm3xk

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.

SQL Azure Connection Type (SSRS)


http://aka.ms/Pal79a

SSAS Connection Strings


SSAS is installed to support either the
multidimensional model or the tabular model.
Regardless of the model type, the connection
strings that are required to use SSAS as a data
source for an SSRS report are very similar. As with
the SQL Server database engine, you define the
data source location by using the data source
property. You define the database that the
connection should open by using the initial
catalog property.

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.

Connecting to an SSAS Local Multidimensional Instance


data source=localhost;initial catalog=AWCube

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.

Connecting to an SSAS Remote Multidimensional Instance


data source=AS_SERVER;initial catalog=AWCube2

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

Connecting to an SSAS Local Tabular Instance


Data source=AS_TAB_SERVER;initial catalog=AW3;cube= 'Sales'

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.

Analysis Services Connection Type for MDX (SSRS)


http://aka.ms/k3v2bm

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.

Analysis Services Connection Type for DMX (SSRS)


http://aka.ms/Xlty5a

Connection Strings for Other Providers


Each data source type that SSRS supports has a
different connection string, although many data
source types use a pattern that is similar to the
connection strings for SQL Server that you saw
earlier in this lesson. The following examples show
sample connection strings for some commonly
used data sources.

SQL Server Parallel Data Warehouse


The following example shows a connection string
for an instance of SQL Server Parallel Data
Warehouse that runs on port 6000 of the 10.0.0.1
IP address, and uses the AdventureWorksDW
database.

Connecting to an Instance of SQL Server Parallel Data Warehouse


HOST=10.0.0.1;database=AdventureWorksDW;port=6000

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

Report Server Model


The connection string for a report server model will depend on whether the report server instance is
running in native mode or SharePoint integrated mode.

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:

Connecting to a Report Server Model by Using Native Mode


Server=http://ModelServer/reportserver; datasource=/ReportModels/AWModel

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.

Connecting to a Report Server Model by Using SharePoint Integrated Mode


Server=http://ModelServerSP;
datasource=http://ModelServerSP/site/documents/ReportModels/AWModel.smdl

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:

Connecting to a SharePoint List


data source=http://AWSP/AdventureWorks/

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:

Connecting to SAP NetWeaver BI


DataSource=http://AWSAP:9000/sap/bw/xml/soap/xmla

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:

Connecting to Hyperion Essbase


Data Source=http://AWEssbase:13090/aps/XMLA;Initial Catalog=AWSales

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:

Connecting to an XML Web Service


http://AWReports/sales-report.aspx

The following example shows a connection string for the CurrentPriceList.xml document on the AWPublic
web server:

Connecting to an XML File


http://AWPublic/CurrentPriceList.xml

An XML document that is embedded in a report definition has no connection string when it is used as a
data source.

OLE DB and ODBC


The connection string for an OLE DB or ODBC data source will be formatted according to the rules for the
data provider. There are many different OLE DB and ODBC data providers with different connection string
formats.

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

Demonstration: Working with Azure SQL Database Connection Strings


In this demonstration, you will see how to create a connection to Azure SQL Database from:
 Report Builder

 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.

8. In the Connection Properties dialog box, click OK.

9. In the Data Source Properties dialog box, click OK.

10. On the File menu, click Save.

11. Leave Report Builder open for the next demonstration.

Connect to Azure SQL Database from Report Designer


1. In Visual Studio, in Solution Explorer, right-click Shared Data Sources, and then click Add New Data
Source.

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.

6. Select the Save my password check box.

7. In the Select or enter a database name list, click AdventureWorksLT, and then click Test
Connection.

8. In the Test results dialog box, click OK.


9. In the Connection Properties dialog box, click OK.

10. In the Shared Data Source Properties dialog box, click OK.

11. Leave Visual Studio open for the next demonstration.

Check Your Knowledge


Question

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?

Select the correct answer.

data source=SALES2;initial catalog=Sales\AWSales

data source=SALES2\Sales;initial catalog=AWSales

data source=SALES2\Sales;initial catalog=AdminDB

data source=SALES2;initial catalog=AWSales

None of the above


MCT USE ONLY. STUDENT USE PROHIBITED
2-16 Reporting Services Data

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.

 Explain the differences between shared datasets and embedded 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

Note: The dataset does not contain result


set data; instead, it contains the definition of how
a result set will be acquired from a data source.

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.

Column Exclusions and Additions


You do not have to include all of the columns that the source system query returns. You can also add
calculated column to a dataset.

For more information about datasets, see the topic Report Datasets (SSRS) in the SQL Server 2016
Technical Documentation.

Report Datasets (SSRS)


http://aka.ms/M2ks4i
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 2-17

Shared and Embedded Datasets


Similar to the data sources that you encountered
earlier in this module, datasets can be published in
their own right and can be shared between many
reports—or they can be embedded in a report
definition.

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.

Working with Datasets


Reports that you create in Report Designer or Report Builder can include both embedded datasets and
shared datasets. You can create shared datasets by using Report Designer or Report Builder, and you can
manage shared datasets by using the Reporting Services portal, Report Designer, or Report Builder.

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.

Embedded and Shared Datasets (Report Builder and SSRS)


http://aka.ms/M5exhx
MCT USE ONLY. STUDENT USE PROHIBITED
2-18 Reporting Services Data

Demonstration: Creating a Shared Dataset


In this demonstration, you will see how to:

 Use Report Designer to create a shared dataset.

 Use Report Builder to create a shared dataset.

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.

4. In the Query Designer dialog box, click Add Table.

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.

8. In the Shared Dataset Properties dialog box, click OK.

9. In Solution Explorer, expand Shared Datasets, right-click AssociatedOrders-SSDT.rsd, and then


click Deploy.

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.

Use Report Builder to Create a Shared Dataset


1. In Report Builder, on the File menu, click New.

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

True or false? A dataset definition includes a connection string.


MCT USE ONLY. STUDENT USE PROHIBITED
2-20 Reporting Services Data

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.

 Explain the different ways in which filters can be applied.


 Add filters.

 Describe parameters.

 Add parameters.

 Compare filters and parameters.

What Are Filters?


You can use a filter to select a subset of rows from
the result set that a dataset returns. The SSRS
instance applies filters to the data, after the
complete results of the dataset have been
retrieved from the source system.

Filters provide a way for different reports that use


a common shared dataset to report on different
sections of the data that the shared dataset
returns. For example, in an organization where
different regions report their sales by using
different reports, the regional reports could
reference the same shared dataset. This dataset
would include all sales across the organization; you would then use a filter to limit the data for each
report to a single region.

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.

 A data type for the 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.

Expression Data type Operator Value

[Region] Text = 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.

Expression Data Type


Expressions become more complex, so it can be difficult to determine how they should be compared to
the equation value—for example, whether you evaluate a sequence of digits as text or as a number affects
the result when compared to another value; the text “55” is less than the text “7” in an alphabetical sort,
but the numeric value “55” is greater than the numeric value “7”. This is why you must specify the data
type to use when evaluating an expression as part of a filter equation.

Operator
You can use the following simple operators in filter equations:
 Equal

 Not equal

 Like
 Greater than

 Greater than or equal

 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.

Add a Filter to a Dataset (Report Builder and SSRS)


http://aka.ms/Vwogeu
MCT USE ONLY. STUDENT USE PROHIBITED
2-22 Reporting Services Data

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.

Expression Reference (Report Builder and SSRS)


http://aka.ms/y3rfe8

Where to Set Filters


You can set filters at different levels, either within
a dataset definition or a report definition. A filter
set at one level will be applied to all of the later
levels that retrieve data from the level on which
the filter was set.

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.

Report Data Regions and Data Region Groups


There are two further levels at which a filter can be applied. These filters affect individual sections of a
report. A filter that is applied at data region level affects all of the groups within the data region. Data
regions and data region groups are covered in more detail in Module 3 of this course.

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.

Filter, Group, and Sort Data (Report Builder and SSRS)


http://aka.ms/Oin23u
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 2-23

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.

The object properties window (which includes the


Filters page) is also available from the Report
Builder Shared Dataset Design view by clicking Set
Options.

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.

Add a Filter to a Dataset (Report Builder and SSRS)


http://aka.ms/Vwogeu

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.

Add a Filter (Report Builder and SSRS)


http://aka.ms/Vwlfy5

Demonstration: Using Filters


In this demonstration, you will see how to:

 Add a filter to a shared dataset in Report Builder.


 Add a filter to a report dataset in Report Builder.

 Add a filter to a shared dataset in Report Designer.

 Add a filter to a report dataset in Report Designer.

Demonstration Steps
Add a Filter to a Shared Dataset in Report Builder

1. In Report Builder, click Set Options.

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 =.

4. In the Value box, type Pacific, and then click OK.

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

6. On the File menu, click Save.

7. In Internet Explorer, on the DataSources page, on the AssociatedOrders-builder shared dataset,


click the ellipsis (…) button, and then click MANAGE.

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.

9. Click DataSources to return to the DataSources folder.

Add a Filter to a Report Dataset in Report Builder

1. In Report Builder, on the File menu, click Open.

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.

7. On the Filters page, click Add.

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.

13. On the Choose the layout page, click Next.

14. On the Preview page, click Finish.

15. Click Run to preview the report.

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.

Add a Filter to a Shared Dataset in Report Designer

1. In Visual Studio, in Solution Explorer, under Shared Datasets, right-click AssociatedOrders-


SSDT.rsd, and then click Open.

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

4. In the Value box, type Pacific, and then click OK.

5. Right-click AssociatedOrders-SSDT.rsd, and then click Deploy.

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.

9. Close Internet Explorer.

Add a Filter to a Report Dataset 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 - 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.

5. On the Filters page, click Add.

6. In the Expression list, click [IncomeGroup]. Verify that Text is selected in the data type box, and in
the Operator list, click <>.

7. In the Value box, type High, and then click OK.


8. In the Toolbox pane, drag Table to the report design section of the Report1.rdl pane.

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

What Are Parameters?


The term parameter is used in two contexts in
SSRS reports:

 Dataset parameters. You can use a dataset


parameter to reduce the number of rows that
are returned from a source system by adding
a condition to the source system query that is
defined in the dataset. Parameters are applied
as part of the dataset query that is issued to
the source system.
The value of a parameter is variable and can be set
at the point at which a query is executed, so
parameters provide a way for you to restrict the
number of rows that are returned from a source system to only those that your report requires.

 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.

Parameters in Source System Queries


The source system query that is defined in a dataset must be modified to accommodate parameters.
When you parameterize a source system query, you do so by using the syntax of the source system
language. For example, in SQL Server database engine queries, variables and parameters are indicated by
using the @ prefix. Parameters can only be added to dataset queries where the syntax of the source
system query language permits them.

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.

SQL Server Query with Variable


SELECT * FROM AdventureWorksDW.dbo.vAssocSeqOrders WHERE Region = @region;

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.

Report Parameters (Report Builder and Report Designer)


http://aka.ms/Mjd63i
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 2-27

Adding a Parameter
There are two elements to configuring parameters:

 Defining a parameter.

 Setting a parameter value.

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.

Setting a Parameter Value


You can set the source that is used for a parameter value either in the dataset definition where the
parameter is defined or, in the case of report instances of shared datasets, in the definition for the report
instance. You set sources for parameter values by using the Parameters page of the dataset properties
window or in the Applied filters pane of the Report Builder Dataset editor. Typically, you will link a dataset
parameter to a report parameter.

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: Using Parameters


In this demonstration, you will see how to:

 Define a parameter for a shared dataset in Report Builder.

 Set the source value for a parameter in Report Builder.


 Define a parameter for a shared dataset in Report Designer.

 Set the source value for a parameter in Report Designer.

Demonstration Steps
Define a Parameter for a Shared Dataset in Report Builder

1. In Report Builder, on the File menu, click Open.

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.

4. Click Edit as Text.


5. In the Query Designer dialog box, click Yes.

6. In the Database view pane, expand Views, and then select the vAssocSeqOrders check box.

7. In the Applied filters pane, click Add Filter.


8. In the Field name column, click OrderNumber, and then click CustomerKey.

9. In the Operator column, click is, and then click is more than or equal to.

10. In the Parameter column, select the check box.

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.

Set the Source Value for a Parameter in Report Builder

1. On the File menu, click Open.

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

7. To preview the report, click Run.

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.

17. Close Report Builder without saving changes.

Define a Parameter for a Shared Dataset in Report Designer

1. In Visual Studio, in Solution Explorer, under Shared Datasets, right-click AssociatedOrders-


SSDT.rsd, and then click Open.
2. In the Shared Dataset Properties dialog box, on the Query page, edit the text of the Query box so
that it matches the following code:

SELECT OrderNumber, CustomerKey, Region, IncomeGroup


FROM vAssocSeqOrders
WHERE CustomerKey >= @CustomerKey

3. On the Parameters page, notice that the parameter has been detected automatically and added to
the parameter list.

4. On the Query page, click Query Designer.

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.

8. In the Shared Dataset Properties dialog box, click OK.


MCT USE ONLY. STUDENT USE PROHIBITED
2-30 Reporting Services Data

Set the Source Value for a Parameter in Report Designer

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.

3. On the Query page, click Refresh Fields.

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.

14. Close Visual Studio without saving any changes.

Comparing Filters and Parameters


The information in the following table outlines
some of the key points of comparison between
filters and parameters.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 2-31

Area Filters Parameters

Definition Filters are defined independently of Parameters are defined as part of the
the source system query. source system query.

Filters can be defined at different Parameters can only be defined in a


levels—shared dataset, report dataset query.
dataset, report data region, or data
region group.

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.

A filter can be added to a dataset or When a parameter is added to a


report object without changes to shared dataset, any report datasets
dependent objects. that are based on the shared dataset
must be updated to include the
parameter.

Question: A dataset that is linked to a SQL Server data source has the query text that is
shown in the following code:

SELECT CurrencyName FROM dbo.DimCurrency WHERE CurrencyKey = @CurrencyKey;

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

Lab A: Configuring Data Access with Report Builder


Scenario
As a reports developer at Adventure Works Cycles, you need to configure a data source, and several
shared datasets, to facilitate future development of SSRS reports.

Objectives
After completing this lab, you will be able to use Report Builder to create shared data sources and shared
datasets.

Estimated Time: 45 minutes

Virtual machine: 10990B-MIA-SQL

User name: ADVENTUREWORKS\Student


Password: Pa$$w0rd

Exercise 1: Configuring Data Access


Scenario
You expect to create many reports that are based on the AdventureWorksDW database, so your first task
is to create a shared data source that connects to this database. You cannot create shared data sources by
using Report Builder, so you will create the shared data source by using the SSRS portal.

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.

The main tasks for this exercise are as follows:


1. Prepare the Lab Environment

2. Create a Shared Data Source

3. Create a Shared Dataset

4. Create a Shared Dataset with a Filter

5. Create a Shared Dataset with a Parameter

 Task 1: Prepare the Lab Environment


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.

2. In the D:\Labfiles\Lab02\Starter folder, run Setup.cmd as administrator.


MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 2-33

 Task 2: Create a Shared Data Source


1. In Internet Explorer, use the SSRS portal at mia-sql/Reports_SQL2 to create a shared data source
called AdventureWorksDW in the Builder folder. Use the following information to configure the
data source:

o Data source type: Microsoft SQL Server

o Server name: MIA-SQL

o Database name: AdventureWorksDW

o User name: reporting

o Password: Pa$$w0rd
2. Use the Test Connection functionality to verify that you can connect to the data source.

 Task 3: Create a Shared Dataset


1. Using Internet Explorer, start Report Builder from http://mia-sql/Reports_SQL2.

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.

 Task 4: Create a Shared Dataset with a Filter


1. In Report Builder, using the shared data source that you created earlier in the exercise, create a
shared dataset. The dataset should return all of the rows and columns from the
dbo.usp_SalesTerritory stored procedure in the AdventureWorksDW database.

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.

4. In Internet Explorer, browse to http://mia-sql/Reports_SQL2/browse/Builder to verify that the dataset


has been created and to test the filter.

 Task 5: Create a Shared Dataset with a Parameter


1. In Report Builder, using the shared data source that you created earlier in the exercise, create a
shared dataset. The dataset should return all of the columns from the dbo.vAllSales view in the
AdventureWorksDW database.

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.

5. Close Report Builder, and then close Internet Explorer.

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

Lab B: Configuring Data Access with Report Designer


Scenario
As a reports developer at Adventure Works Cycles, you need to configure a data source, and several
shared datasets, to facilitate future development of SSRS reports.

Objectives
After completing this lab, you will be able to use Report Designer to create shared data sources and
shared datasets.

Estimated Time: 45 minutes

Virtual machine: 10990B-MIA-SQL

User name: ADVENTUREWORKS\Student


Password: Pa$$w0rd

Exercise 1: Configuring Data Access


Scenario
You expect to create many reports that are based on the AdventureWorksDW database, so your first
task is to create a shared data source that connects to this database.

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.

The main tasks for this exercise are as follows:

1. Prepare the Lab Environment


2. Create a Shared Data Source

3. Create a Shared Dataset

4. Create a Shared Dataset with a Filter


5. Create a Shared Dataset with a Parameter

 Task 1: Prepare the Lab Environment


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.

2. In the D:\Labfiles\Lab02\Starter folder, run Setup.cmd as administrator.

 Task 2: Create a Shared Data Source


1. Using Visual Studio, in D:\Labfiles\Lab02\Starter\Project, open the project file Project.sln.

2. Create a shared data source with the name AdventureWorksDW. Use the following information to
configure the data source:

o Data source type: Microsoft SQL Server


MCT USE ONLY. STUDENT USE PROHIBITED
2-36 Reporting Services Data

o Server name: MIA-SQL

o Authentication: SQL Server

o User name: reporting

o Password: Pa$$w0rd

o Saved password: Yes

o Database name: AdventureWorksDW

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.

 Task 3: Create a Shared Dataset


1. Using the shared data source that you created in the last task, create a shared dataset. The dataset
should return all of the rows and columns from the dbo.vAllSales view in the AdventureWorksDW
database. Give the dataset the name AllSales.

2. Deploy the dataset to the Designer folder of the SSRS instance.

3. In Internet Explorer, browse to http://mia-sql/Reports_SQL2_Preview to verify that the data source


and dataset have been created in the Designer folder.

 Task 4: Create a Shared Dataset with a Filter


1. In Visual Studio, using the shared data source that you created earlier in the exercise, create a shared
dataset. The dataset should return all of the rows and columns from the dbo.usp_SalesTerritory
stored procedure in the AdventureWorksDW database. Give the dataset the name
FilteredTerritories.

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. Deploy the dataset to the Designer folder of the SSRS instance.

4. In Internet Explorer, browse to http://mia-sql/Reports_SQL2_Preview/#/browse/Designer to verify that


the dataset has been created and to test the filter.

 Task 5: Create a Shared Dataset with a Parameter


1. In Visual Studio, using the shared data source that you created earlier in the exercise, create a shared
dataset. The dataset should return all of the columns from the dbo.vAllSales view in the
AdventureWorksDW database. Give the dataset the name CountrySales.

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

Module Review and Takeaways


In this module, you have seen how to work with data sources and datasets to bring data from source
systems into your SSRS reports. You have also seen how to use filters and parameters to restrict the rows
that a dataset returns.

Best Practice: To simplify the management and administration of your SSRS servers, use
shared data sources whenever possible.

Review Question(s)

Check Your Knowledge


Question

Which SSRS data access object would you typically create first when you configure
data access to a source system?

Select the correct answer.

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 

Lesson 1: Creating a Report with the Report Wizard 3-2 

Lesson 2: Creating a Report 3-6 

Lesson 3: Show Data Graphically in a Report 3-16 

Lab A: Creating a Report with Report Designer 3-29 

Lab B: Creating a Report with Report Builder 3-33 

Module Review and Takeaways 3-37 

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:

 Create a report with the Report Wizard.

 Create a report using Report Designer or Report Builder.

 Show data graphically within a report.


MCT USE ONLY. STUDENT USE PROHIBITED
3-2 Implementing Reports

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:

 Define a data source.

 Design a query.

 Specify a report type.

Define a Data Source


You can start the Report Wizard from within Visual
Studio® in a SQL Server Data Tools Report
Solution—in Solution Explorer, right-click Reports,
and then click New Report. In Report Builder, on
the File menu, click New, and then click Table or
Matrix Wizard.

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.

Microsoft® SQL Server Reporting Services (SSRS)


supports the following data source types:

 Microsoft SQL Server Database

 Microsoft SQL Server Analysis Services

 Microsoft Azure™ SQL Database

 SQL Server Parallel Data Warehouse

 Oracle
 SAP NetWeaver BI

 Hyperion Essbase

 Microsoft SharePoint® List

 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.

You can use Query Designer to specify aliases, sort


types, sort orders, and filters in an easy-to-use
graphical environment that generates the required
query for you. Query Designer also gives you the
option to edit the query as text, and therefore manually edit and amend the produced SQL.
Queries possible in SQL Server 2016
SSRS supports any valid SELECT DML query. It is therefore possible to create SQL statements that return
data from tables, views, functions, stored procedures, synonyms—or a combination of these.
Performance considerations
When designing reports, a primary consideration should be the time it takes for a report to be displayed
to the end user. The majority of processing time to display a report is taken in performing and returning
the data for a query. A typical performance improvement in SSRS reports is to perform as much grouping,
aggregation, and sorting of data on the database engine instead of within a report.

For further considerations regarding queries, see the next lesson on creating datasets.
MCT USE ONLY. STUDENT USE PROHIBITED
3-4 Implementing Reports

Specify a Report Type and Design the Report


After designing the query for the data you need in
your report, the next step is to choose a report
type—tabular or matrix. You can do this on the
Select a Report Type page of the Report Wizard.

Tabular reports display data in rows, while matrix


reports show data fields grouped in rows and
columns, with aggregated values in the intersecting
cells, similar to a PivotTable or crosstab.

When you have chosen your report type, you then


need to design the report on the Design the Table
or Design the Matrix page. To design the report,
select your required field in the Available fields list
and add it to the report in the Page, Column, Row, or Detail area. You can select more than one field for
each section of the report. Reorder fields by using the up and down arrows on the page.

Demonstration: Using the Report Wizard to Build a Report


In this demonstration, you will see how to use the Report Wizard to build a report.

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.

2. In the D:\Demofiles\Mod03 folder, run Setup.cmd as Administrator.


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.
4. Start Visual Studio.

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.

7. On the Welcome to the Report Wizard page, click Next.

8. On the Select the Data Source page, click Next.

9. On the Design the Query page, click Query Builder.

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

13. Add the following values to the Alias column:

o EnglishCountryRegionName: Country-Region

o StateProvincename: State

o ResellerName: Reseller

14. Click OK.

15. On the Design the Query page, click Next.

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.

20. Leave Visual Studio open for the next demonstration.

Sequencing Activity
Put the following steps in order by numbering each to indicate the correct order.

Steps

Select or create a data source.

Design a query to define the dataset.

Specify the report type.

Add fields to the report.

Give the report a name.

Preview the report.


MCT USE ONLY. STUDENT USE PROHIBITED
3-6 Implementing Reports

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:

 Create a dataset in Report Builder or Report Designer.

 Design a report in Report Builder or Report Designer.

 Use tablix data regions.


 Understand the difference between tables, lists, and matrices.

 Format a report in Report Builder or Report Designer.

 Publish a report.

 Understand considerations when designing reports.

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:

 Defines a query to retrieve data from a data


source.

 Determines the fields available for use in the


report.

 Can be shared across multiple reports or


embedded in a single report.

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.

 Add a dataset to the report in the Report Data pane.


 Add a shared dataset to the project in Solution Explorer.

 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.

 Use views instead of base tables.

Designing the Report


Key elements of the Report Designer interface
include:

 Solution Explorer. This pane shows the


projects and associated items in the Visual
Studio solution that is currently open. For a
Report Server project, it shows the reports,
shared data sources, shared datasets, and other
resources.

 Report Design surface. This is the graphical


report development area on the design tab of
the Report Designer. You use this part of the
interface to design a report.

 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.

Key elements of the Report Builder interface include:

 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.

Using a Tablix Data Region


After defining a data source and a dataset, you can
use a tablix data region to display data field values
in a report. The term “tablix” is derived from the
words “table” and “matrix”. A tablix data region
provides a common user interface element that
supports both different types of data layout.

When you create a report with the Report Wizard, it


automatically generates a table or matrix data
region, depending on the type of report you select
in the wizard. To add a tablix data region to an
existing report, drag the appropriate data region
item from the toolbox to the report body.

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.

Differences Between a Table, List and Matrix


A tablix can be one of three types of data region—a
table, a list, or a matrix. Each data region displays
data in a different way, as described in the
following list:

 Table. A table data region shows data as rows


in a table with a column for each field. For
example, you could use a table to show sales
results aggregated by country, with a row for
each country.

 Matrix. A matrix data region shows data fields


grouped in rows and columns, with aggregated
values in the intersecting cells, similar to a
PivotTable or crosstab. For example, you could use a matrix to show sales for each country for a range
of years, with a row for each country and column for each year.
 List. A list data region shows a repeated arrangement of data items in a free-form layout. For
example, you could use a list to show details for each store in the organization as a store name field
formatted as a heading—with labels and field values for business type, city, and phone number.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 3-9

Demonstration: Creating a Report


In this demonstration, you will see how to:

 Create a report in Report Designer.

 Create a report in Report Builder.

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:

SELECT DimGeography.EnglishCountryRegionName, DimGeography.StateProvinceName,


DimGeography.City, DimReseller.ResellerName, FactResellerSales.SalesOrderNumber,
FactResellerSales.OrderDate, FactResellerSales.SalesAmount
FROM
DimGeography INNER JOIN
DimReseller ON DimGeography.GeographyKey = DimReseller.GeographyKey INNER JOIN
FactResellerSales ON DimReseller.ResellerKey = FactResellerSales.ResellerKey

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:

Field Name Field Source

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.

10. In the text box, type the text Reseller Sales.

11. Click the Preview tab to view the report.

12. Leave Visual Studio open for the next demonstration.

Create a Report in Report Builder

1. Start Internet Explorer and browse to mia-sql/Reports_SQL2.

2. On the Home page, in the toolbar, click New, then click Paginated Report.

3. In the Internet Explorer dialog box, click Allow.


MCT USE ONLY. STUDENT USE PROHIBITED
3-10 Implementing Reports

4. If the Connect to Report Server dialogue appears, click Yes.

5. In the New Report or Dataset dialog box, click Blank Report.

6. In Report Data, right-click Datasets, and then click Add Dataset.

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.

9. In the Connection string text box, type the following:

Data Source=MIA-sql;Initial Catalog=AdventureWorksDW

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:

SELECT DimGeography.EnglishCountryRegionName, DimGeography.StateProvinceName,


DimGeography.City, DimReseller.ResellerName, FactResellerSales.SalesOrderNumber,
FactResellerSales.OrderDate, FactResellerSales.SalesAmount,
DimDate.CalendarYear AS SalesYear
FROM
DimGeography INNER JOIN
DimReseller ON DimGeography.GeographyKey = DimReseller.GeographyKey INNER JOIN
FactResellerSales ON DimReseller.ResellerKey = FactResellerSales.ResellerKey INNER
JOIN
DimDate ON [DateKey] = FactResellerSales.OrderDateKey

12. Click Refresh Fields.

13. On the Fields page, change the Field Name values to match the following table, and then click OK.

Field Name Field Source

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.

17. Click the Click to add title text box.

18. In the text box, type Reseller Sales.

19. On the Home menu, click Run.


20. Leave Report Builder open for the next demonstration.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 3-11

Formatting the Report


You can format all elements of a report, in both
Report Designer and Report Developer, by selecting
the element and using the format options on the
Ribbon in Report Builder or the Toolbar in Report
Designer.

Selecting a row or column in a tablix formats all


values in the selected row or column.

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.

Key ways in which you can control pagination include:


 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.
o 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.

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).

Pagination and Microsoft Excel


Being able to control pagination is particularly useful when you export reports to Microsoft Excel®. By
default, the Excel rendering extension creates a workbook with a single worksheet containing the report
data. The worksheet name, which is shown on the tabs at the bottom of the workbook, is based on the
name of the report by default. However, if you specify an InitialPageName property value, that is used
for the worksheet name instead.

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.

Publishing reports from Report Designer


Professional report developers use Report Designer
in Visual Studio to publish reports at the project
level or the individual report level. Before
publishing reports, you must be aware of how they
are affected by the project properties. Before you
publish reports created in Visual Studio, you should
ensure that the following properties are set
appropriately for the report server where you
intend to publish them:

Property Description

OverwriteDataSources Specifies whether to replace existing data sources


when publishing shared data sources. If this
property is set to False, an attempt to publish a
data source with the same name as an existing one
will fail.

TargetDataSetFolder Folder where shared datasets are published. When


publishing to a report server in native mode, this
property should be set to the folder name. When
publishing to a report server in SharePoint
integrated mode, this property should be set to
the full URL for the document library in the
SharePoint site.

TargetDataSourceFolder Folder where shared data sources are published.


When publishing to a report server in native mode,
this property should be set to the folder name.
When publishing to a report server in SharePoint
integrated mode, this property should be set to
the full URL for the document library in the
SharePoint site.

TargetReportFolder Folder where report parts are published. When


publishing to a report server in native mode, this
property should be set to the folder name. When
publishing to a report server in SharePoint
integrated mode, this property should be set to
the full URL for the document library in the
SharePoint site.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 3-13

Property Description

TargetReportPartFolder Folder where report parts are published. When


publishing to a report server in native mode, this
property should be set to the folder name. When
publishing to a report server in SharePoint
integrated mode, this property should be set to
the full URL for the document library in the
SharePoint site.

TargetServerURL Service endpoint for the report server. When


publishing to a report server in native mode, this
property should be set to URL for the report server
web service. When publishing to a report server in
SharePoint integrated mode, this property should
be set to the URL for the SharePoint site where you
want to publish the reports.

TargetServerVersion Compatibility version for reports. The RDL format


used by Reporting Services in SQL Server 2008 R2
and later is different from the format used in
earlier versions. If you are publishing to an older
report server, you must set the
TargetServerVersion appropriately. You can
publish reports in either version to report servers
running SQL Server 2008 R2 or later, but some
features are not supported in the older RDL
format.

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.

Publishing reports from Report Builder


When publishing a report from Report Builder, you have less control over its configuration. To publish a
report, you save the report to the report server. If you want to save a report from Report Builder using a
different name, use the Save As functionality.

Considerations for Designing a Report


Consideration should be given to the following
items before developing reports in Report Builder
or Report Designer.

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

Graphical vs. text data interpretation


Graphical report elements can improve the presentation and help users to understand the data that a
report is presenting to them; however, they take considerably more resources to render than textual data.
Before adding graphical elements to a reporting solution, think about whether they are adding value.
Avoid adding graphical elements which have no benefit to end users.

Report output format


When planning a reporting solution, you should consider the ways in which reports will be consumed.
Typically, reports are consumed in one of the following ways:

 Online: users view the report in a web browser.

 As a document in an application: users open the report in an application, such as Microsoft Excel.

 Printed: users print the report and view it in hard copy.


When you publish a report to a Reporting Services server, it can be rendered in an interactive HTML-
based report viewer that means users can consume the report online. However, users can also export the
report to a number of formats, and print it for offline viewing. You can also deliver reports in specific file
formats through subscriptions, where users do not need to view the report online. They can open the
report directly in an application for viewing or printing.

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

 Comma Separated Value (CSV)

 XML

 Web Archive

 Image

 Adobe Acrobat (PDF)

 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: Publishing a Report


In this demonstration, you will see how to:

 Publish a report from Report Designer.

 Publish a report from Report Builder.

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.

4. Start Internet Explorer and go to mia-sql/Reports_SQL2.


5. Click Designer, and then click Reseller Sales. Check that the report has been correctly published.

6. Close Internet Explorer.

Publishing a Report from Report Builder

1. In Report Builder, on the File menu, click Save As.

2. In the Look in drop-down list, ensure that http://mia-sql/ReportServer_SQL2 is selected.

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.

4. Start Internet Explorer and go to the address mia-sql/Reports_SQL2.

5. Click Builder, and then click Reseller Sales. Check that the report has been correctly published.

6. Close Internet Explorer.

7. Leave Report Builder open for the next demonstration.

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:

 Include images in a report.

 Include charts to visualize data values in a report.


 Summarize data by using data bars and sparklines.

 Use indicators to show trends and Key Performance Indicators (KPIs) in a report.

 Display geographical data in a report by using a map.

Images
You can enhance the appearance of a report by
including images—these are frequently used for the
following purposes:

 Adding a logo. For example, a company might


include its logo in the header of all reports to
provide a consistent look and feel that reflects
corporate branding.
 Binding an image to a data field. For
example, a report showing a sales breakdown
by product might include a photograph of
each product.

 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.

Adding an image in Report Designer


To add an image to a report, drag an image item from the Toolbox to the report body. Then use the
Image Properties dialog box to configure the image. The key property to set is ImageSource, which can
be one of the following three types:

 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:

 Source. Specify external, embedded, or database as described above.

 Value. Specify the source of the image as above.

 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.

Adding an image in Report Builder


To add an image in Report Builder, on the Insert tab, click Image, and then click on the design surface
where you would like the image to be placed. The Image Properties dialog box will then appear,
enabling you to set properties for the image.

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.

Adding a chart in Report Designer


Use the following procedure to add a chart to a
report in Report Designer:

1. Drag a Chart item from the Toolbox to the


body of the report.

2. In the Select Chart Type dialog box, select an


appropriate type of chart for your data.
Available chart types include:

o Column charts

o Line charts

o Shape charts (such as pie 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.

Adding a chart in Report Builder


To add a chart to a report in Report Builder, use the following procedure:

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.

3. In the Select Chart Type dialog, choose an appropriate chart type.

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: Adding Images and Charts


In this demonstration, you will see how to add images and charts to a report.

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.

6. Click Preview to view the report with the image.

Add a Chart to a Report in Report Designer

1. In Visual Studio, click Design to ensure you are in Design mode.

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.

Specify Chart Data in Report Designer

1. Click the chart to display the Chart Data pane.

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.

Format a Chart in Report Designer

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.

4. Preview the report and view the formatted chart.

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.

2. Name the image AdventureWorksLogo, and then click Import.

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.

5. Click Run to preview the report.


Add a Chart to a Report in Report

1. In Report Builder, click Design.

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.

Specify Chart Data in Report Builder

1. Double-click the chart to display the Chart Data pane.

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

Format a Chart in Report Builder

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.

Data Bars and Sparklines


Data bars and sparklines are compact charts, usually
displayed inline with data in a table or matrix. They
provide the same type of visual representations of
data as standard charts, but are designed to be
small, so they do not support features such as
legends, axis lines, labels, or tick marks. Report
authors can use data bars and sparklines to convey
a lot of visual information in a small amount of
space. In particular, data bars and sparklines are
useful for providing comparisons of key metrics
across a number of rows of data, meaning that
report consumers can see potential issues and
identify outliers at a glance.

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.

Adding data bars or sparklines to a report


Use the following procedure to add a data bar or sparkline to a report:

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.

3. Select the appropriate data bar or sparkline type.

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.

Data bar and sparkline alignment


You generally use sparklines and data bars to compare key metrics across multiple rows. It is important,
therefore, that the plotted data points and scales you use in each instance of the sparkline or data bar
provide a like-with-like comparison.

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:

 Trends. For example, you can display an


upward-pointing arrow to show a month-on-
month increase in sales or a downward-
pointing arrow to show a month-on-month
reduction.

 Status and conditions. For example, you can


display a green traffic light to indicate that a
salesperson is on track to meet a sales quota or
a red one to show that an individual is behind
on a quota.

 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: Adding Data Bars, Sparklines, and Indicators to a Report


In this demonstration, you will see how to add data bars, sparklines and indicators to a report.

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.

8. Click Preview to show the revised report.

Add a Sparkline in Report Designer


1. 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. 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.

8. Leave Visual Studio open for the next demonstration.

Add a Data Bar in Report Builder

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.

10. Click Run to show the revised report.

Add a Sparkline in Report Builder

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.

7. Click Run to show the revised report.

8. Leave Report Builder open for the next demonstration.

Maps
You can display geographical data in a report by
adding a map that consists of one or more layers.
Each layer can define:

 Spatial data to define the geographical features


to be displayed.

 Analytical data to show business values that are


related to the spatial data.

 Legends and scales to help viewers interpret


the map.

Add a map to a report in Report Designer


Use the following procedure to add a map to a report:

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.

o An Environmental Systems Research Institute (Esri)-compatible shapefile.

o A query that returns spatial data from a SQL Server database.


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.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 3-25

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.

Add a map to a report in Report Builder


Use the following procedure to add a map to a report:
1. On the Insert menu, point to Map, and then click Map 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.

o An Environmental Systems Research Institute (Esri)-compatible shapefile.

o A query that returns spatial data from a SQL Server database.

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: Adding Maps to a Report


In this demonstration, you will see how to add maps to a report.

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.

14. Click Preview to view the completed report.

15. Close Visual Studio, saving changes if you are prompted.

Add Maps to a Report in Report Builder

1. Switch to Report Builder, then click Design to return to Design mode.

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.

12. Select the map legend, and then press Delete.


13. Select the Map Distance Scale, and then press Delete.

14. Double-click the Map Color Scale and reposition in the bottom right of the map.

15. Click Run to preview the report.

16. Close Report Builder.


MCT USE ONLY. STUDENT USE PROHIBITED
3-28 Implementing Reports

Check Your Knowledge


Question

Which object can you use to visually display aggregated data on a report?

Select the correct answer.

Image

Chart

Data bar

Sparkline

Indicator
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 3-29

Lab A: Creating a Report with Report Designer


Scenario
The sales manager at Adventure Works Cycles currently spends a large amount of time manually creating
sales reports in Excel. The report shows monthly sales broken down by product category, subcategory,
and individual product, but takes too long to produce each month. The sales manager has requested a
solution that generates the required report on-demand, and available to export in Excel format.

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.

 Add a chart to a report.

 Add a map to a report.

Estimated Time: 45 minutes


Virtual machine: 10990B-MIA-SQL

User name: ADVENTUREWORKS\Student

Password: Pa$$w0rd

Exercise 1: Creating a Report


Scenario
The sales manager at Adventure Works spends a large amount of time each month using Excel to query
the data warehouse to produce a report that shows monthly sales broken down by product category,
subcategory, and individual product. You have been asked to create a reporting solution that provides the
sales manager with the required information.

The main tasks for this exercise are as follows:

1. Prepare the Lab Environment

2. Create the Report

3. Format the Report

 Task 1: Prepare the Lab Environment


1. Ensure 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.

2. Run Setup.cmd in the D:\Labfiles\Lab03\Starter folder as Administrator. If a Visual Studio Just-In-


Time Debugger dialog box shows an error relating to w3wp.exe, click No, cancel debugging.
MCT USE ONLY. STUDENT USE PROHIBITED
3-30 Implementing Reports

 Task 2: Create the Report


1. Start Visual Studio and open the project named Reports.sln in the D:\Labfiles\Lab03\Starter folder.

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):

SELECT d.CalendarYear [Year],


d.MonthNumberOfYear [MonthNo],
d.EnglishMonthName [Month],
c.EnglishProductCategoryName [ProductCategory],
s.EnglishProductSubcategoryName [ProductSubcategory],
p.EnglishProductName [Product],
i.SalesOrderNumber,
i.OrderDate,
i.SalesAmount
FROM dbo.DimProductCategory c
INNER JOIN dbo.DimProductSubcategory s ON s.ProductCategoryKey = c.ProductCategoryKey
INNER JOIN dbo.DimProduct p ON p.ProductSubcategoryKey = s.ProductSubcategoryKey
INNER JOIN dbo.FactInternetSales i ON i.ProductKey = p.ProductKey
INNER JOIN dbo.DimDate d ON i.OrderDateKey = d.DateKey
ORDER BY d.CalendarYear, d.MonthNumberOfYear, c.EnglishProductCategoryName,
s.EnglishProductSubcategoryName, p.EnglishProductName, i.SalesOrderNumber;

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.

 Task 3: Format the Report


1. Preview the report to view the default formatting.
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-31

Exercise 2: Adding a Chart to a Report


Scenario
The sales manager at Adventure Works has asked you to add a chart to the first page of the sales report.
The chart should show sales volumes for each product category across individual months of the year.

The main tasks for this exercise are as follows:

1. Add a Chart

2. Specify Data for the Chart


3. Format the Chart

 Task 1: Add a Chart


1. In the Internet Sales report, move the existing tablix data region down to make room for the 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.

 Task 2: Specify Data for the Chart


1. Configure the chart with the following data fields:

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.

 Task 3: Format the Chart


1. Edit the chart properties and change the Color palette property to the color palette of your choice.

2. Delete the chart title.


3. Format the vertical axis so that the numbers are formatted as currency with a separator for
“thousands”.

4. Preview the report to view your changes.

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

Exercise 3: Creating a Map Report


Scenario
An existing report lists Internet sales values by state. The sales manager has requested that the report
shows sales levels visually on a map so that states where sales are good can be easily identified.

The main tasks for this exercise are as follows:

1. Add a Map to a Report

2. Format the Map

 Task 1: Add a Map to a Report


1. In the Sales Reports solution, open the Internet Sales by State report.

2. Modify the report by adding a map item showing USA states colored based on their total sales values.

 Task 2: Format the Map


1. Format the chart to remove the legend, map distance scale and map title.
2. Move the color scale to the bottom right of the map so it is not covering any state.

3. Close Visual Studio.

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

Lab B: Creating a Report with Report Builder


Scenario
The sales manager at Adventure Works Cycles currently spends a large amount of time manually creating
sales reports in Excel. The report shows monthly sales broken down by product category, subcategory,
and individual product, but takes too long to produce each month. The sales manager has requested a
solution that generates the required report on-demand, and available to export in Excel format.

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.

 Add a chart to a report.

 Add a map to a report.

Estimated Time: 45 minutes


Virtual machine: 10990B-MIA-SQL

User name: ADVENTUREWORKS\Student

Password: Pa$$w0rd

Exercise 1: Creating a Report


Scenario
The sales manager at Adventure Works spends a large amount of time each month using Excel to query
the data warehouse to produce a report that shows monthly sales broken down by product category,
subcategory, and individual product. You have been asked to create a reporting solution that provides the
sales manager with the required information.

The main tasks for this exercise are as follows:

1. Prepare the Lab Environment

2. Create the Report

3. Format the Report

 Task 1: Prepare the Lab Environment


1. Ensure 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.

2. Run Setup.cmd in the D:\Labfiles\Lab03\Starter folder as Administrator. If a Visual Studio Just-In-


Time Debugger dialog box shows an error relating to w3wp.exe, click No, cancel debugging.

 Task 2: Create the Report


1. Start Internet Explorer and browse to mia-sql/Reports_SQL2.

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):

SELECT d.CalendarYear [Year],


d.MonthNumberOfYear [MonthNo],
d.EnglishMonthName [Month],
c.EnglishProductCategoryName [ProductCategory],
s.EnglishProductSubcategoryName [ProductSubcategory],
p.EnglishProductName [Product],
i.SalesOrderNumber,
i.OrderDate,
i.SalesAmount
FROM dbo.DimProductCategory c
INNER JOIN dbo.DimProductSubcategory s ON s.ProductCategoryKey = c.ProductCategoryKey
INNER JOIN dbo.DimProduct p ON p.ProductSubcategoryKey = s.ProductSubcategoryKey
INNER JOIN dbo.FactInternetSales i ON i.ProductKey = p.ProductKey
INNER JOIN dbo.DimDate d ON i.OrderDateKey = d.DateKey
ORDER BY d.CalendarYear, d.MonthNumberOfYear, c.EnglishProductCategoryName,
s.EnglishProductSubcategoryName, p.EnglishProductName, i.SalesOrderNumber;

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.

 Task 3: Format the Report


1. Preview the report to view the default formatting.

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

Exercise 2: Adding a Chart to a Report


Scenario
The sales manager at Adventure Works has asked you to add a chart to the first page of the sales report.
The chart should show sales volumes for each product category across individual months of the year.

The main tasks for this exercise are as follows:

1. Add a Chart

2. Specify Data for the Chart


3. Format the Chart

 Task 1: Add a Chart


1. In the Internet Sales report, move the existing tablix data region down to make room for the 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.

 Task 2: Specify Data for the Chart


1. Configure the chart with the following data fields:

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.

 Task 3: Format the Chart


1. Edit the chart properties and change the Color palette property to the color palette of your choice.

2. Delete the chart title.


3. Format the vertical axis so that the numbers are formatted as currency with a separator for
“thousands”.

4. Run the report to view your changes.

5. Close Report Builder.

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

Exercise 3: Creating a Map Report


Scenario
An existing report lists Internet sales values by state. The sales manager has requested that the report
shows sales levels visually on a map to easily identify those states where sales are good.

The main tasks for this exercise are as follows:

1. Add a Map to a Report

2. Format the Map

 Task 1: Add a Map to a Report


1. In Internet Explorer, browse to mia-sql/Reports_SQL2.

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.

 Task 2: Format the Map


1. Format the chart to remove the legend, map distance scale and map title.

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

Module Review and Takeaways


In this module, you have learned how to use the Report Wizard to create simple reports and how to use
Report Builder and Report Designer to create more customized reports. You have seen how to create,
format, and add graphical elements to reports.

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 

Lesson 1: Implementing Filters and Parameters 4-2 

Lesson 2: Implementing Sorting and Grouping 4-8 

Lesson 3: Publishing a Report 4-18 

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:

 Filter and parameterize reports.

 Sort and group data in reports.

 Publish reports to a Report Server and SharePoint®.


MCT USE ONLY. STUDENT USE PROHIBITED
4-2 Configuring Reports

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:

 Filter data in a report.

 Understand the uses for parameters in your reports.

 Create parameters.

 Explain what report parameter properties are.


 Maintain report parameters for published reports.

Filtering Data in a Report


There are two ways you can filter data that is
contained within a report. The first, and most
efficient, is to filter the data before it is received
by the report. This filtering of the data is more
efficient as it is performed, for example, on the
SQL Server Database Engine, and then only the
dataset required for the report is sent over the
network.

The second type of filtering is completed in the


report itself, although this is inefficient in terms
of the amount of data transferred to the report,
and the extra processing that is required to be
completed by the report. In some circumstances it is the only option—because Reporting Services can
consume data from many different providers, this data may not be filterable at the source. Consider the
scenario where you are provided with a shared dataset, but are not permitted to alter it.

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.

Uses for Report Parameters


As with filters, there are two categories of
parameter.

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:

 Use two parameters to control the range of data used in a report.


 A parameter can be used to relate main reports to drill through reports.

 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.

 Pass a URL string to set a default value for a report parameter.

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.

Here is an example query that contains a query


parameter:

Dataset with a query parameter


SELECT d.CalendarYear [Year],
d.MonthNumberOfYear [MonthNo],
d.EnglishMonthName [Month],
i.SalesOrderNumber,
i.OrderDate,
FROM dbo.FactInternetSales i ON i.ProductKey = p.ProductKey
INNER JOIN dbo.DimDate d ON i.OrderDateKey = d.DateKey
WHERE d.CalendarYear = @Year

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.

Report Parameter Properties


There are many report parameters, and this
makes them customizable and flexible. The
following is a summary of the most relevant
report parameter properties; for a complete list,
see:

Report Parameters (Report Builder and


Report Designer)
http://aka.ms/Trb407

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

Data type  A parameter can be one of the following values:


 Boolean
 DateTime
 Integer
 Float
 Text

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.

Published parameter properties


After a report has been published to a report server, or SharePoint, parameters can be modified and
updated independently from the reports with which they are associated. The properties that can be
changed are:

 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?

 If visible, what text should be used as a prompt for the parameter?

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: Report Parameters


In this demonstration, you will see how to:

 Add parameters automatically.


 Set the available values and default values for a parameter.

Demonstration Steps
Add a Parameter Automatically

1. On the toolbar, click Internet Explorer.


MCT USE ONLY. STUDENT USE PROHIBITED
4-6 Configuring Reports

2. In the address bar, type mia-sql/Reports_SQL2, and then press Enter.

3. Click the Builder folder.

4. On the USA Sales by State report, click the ellipsis (…) button, and then click MANAGE.

5. Click Edit in Report Builder.

6. In the Internet Explorer dialog, click Allow.

7. In the USA Sales by State - Microsoft SQL Server Report Builder window, in the Report Data pane,
expand Parameters, and then expand Datasets.

8. Right-click SalesByRegion, then click Query.

9. In the Query Designer dialog box, type the following query:

SELECT DimGeography.EnglishCountryRegionName, DimGeography.StateProvinceName,


DimGeography.City, DimReseller.ResellerName, FactResellerSales.SalesOrderNumber,
FactResellerSales.OrderDate, FactResellerSales.SalesAmount,
DimDate.CalendarYear AS SalesYear
FROM
DimGeography INNER JOIN
DimReseller ON DimGeography.GeographyKey = DimReseller.GeographyKey INNER JOIN
FactResellerSales ON DimReseller.ResellerKey = FactResellerSales.ResellerKey INNER
JOIN
DimDate ON [DateKey] = FactResellerSales.OrderDateKey
WHERE DimDate.CalendarYear = @Year

10. Click OK.


11. In the Report Data pane, expand Parameters. Note that there is now a Year parameter.

12. On the Home tab, in the Views section, click Run.

13. In the Year box, type 2010, and then click View Report.
Add Available Values to a Parameter

1. On the Run tab, in the Views section, click Design.

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.

4. In the Data source drop-down select DataSource1.

5. In the Query box, type:

SELECT Year(FactResellerSales.OrderDate) AS Year


FROM FactResellerSales
GROUP BY Year(FactResellerSales.OrderDate)
ORDER BY Year(FactResellerSales.OrderDate) DESC;

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.

9. In the Dataset: (Warning: Possible performance impact) drop-down, select AvailableYears.

10. In the Value field drop-down, select Year.


11. In the Label field drop-down, select Year.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 4-7

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.

15. On the Home tab, in the Views section, click Run.

16. Note that the report runs automatically and shows the figures for 2013.

Check Your Knowledge


Question

You want to filter report data. Where is the most efficient place to specify the
filter?

Select the correct answer.

On a row in a tablix.

On a detail group in a tablix.

On a category group in a chart.

On a data region.

On a dataset where clause.


MCT USE ONLY. STUDENT USE PROHIBITED
4-8 Configuring Reports

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:

 Sort data in a report.

 Implement group expressions.

 Describe the detail groups.

 Explain recursive hierarchy groups.


 Perform summing on tablix data regions.

 Enable drilldown in a grouped report.

 Add aggregated fields by using expressions.


 Configure page breaks for groupings.

 Implement drillthrough actions.

Sorting Data in a Report


Similar to filters and parameters, sorting can be
applied to the data before it is used in a report,
or sorted after the dataset is being used in a data
region or group.

Sort data at the source


If the data source is SQL Server, an ORDER BY
clause can be used on the query that is returning
the data. It may not be possible to sort data from
other sources.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 4-9

Here is an example SQL statement that will return sorted data:

Sorting source data


SELECT DimGeography.EnglishCountryRegionName AS [Country-Region],
DimGeography.StateProvinceName AS State,
DimGeography.City,
DimReseller.ResellerName AS Reseller,
FactResellerSales.SalesOrderNumber,
FactResellerSales.OrderDate, FactResellerSales.SalesAmount
FROM DimGeography
INNER JOIN DimReseller ON DimGeography.GeographyKey = DimReseller.GeographyKey
INNER JOIN FactResellerSales ON DimReseller.ResellerKey =
FactResellerSales.ResellerKey
ORDER BY DimGeography.EnglishCountryRegionName

Use a sort expression on a data region or group


The ability to sort is available in a number of places within an SSRS report. Both Report Designer and
Report Builder enable sorting to be added in the following places:

 Tablix data region

 Tablix data region group


 Chart data region

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:

Example sort expression


=Lookup(Fields!ProductID.Value, Fields!ID.Value, Fields!Name.Value, "Product")

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:

Expression Uses in Reports (Report Builder and SSRS)


http://aka.ms/Gsrlnt

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

Implementing Group Expressions


Groups are used to organize data—this grouping
will then be used for display purposes, or to
enable the calculation of aggregate values. SSRS
uses group expressions to create groups, and
these expressions are created automatically as
you build a report layout. Examples of when they
are created automatically include:

 Arranging datasets in tables or charts.

 Adding fields to Row of Column Groups in


the Grouping pane.

 Adding fields to Category or Series Groups


on a chart.

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.

Examples of Group Expressions


Group Expression Description

=Fields!Product.Value A group can be defined on a single


field. In this expression, that field is
a product.

=Fields!Postcode.Value.Substring(0,4) The expression can be more


complex than simply using the
value in a field. Here the group is
based on the first four characters
of a postal code.

=IIF(First(Fields!Age.Value)<18,"Under Complex logical expression can


18",(IIF(First(Fields!Age.Value)>=18 AND also be used. In this example, both
First(Fields!Age.Value)<=40,"Between 18 aggregate functions (First) and VB
and 40","Over 40"))) condition (IFF) are used to create
grouping that will be “Under 18”,
“Between 18 and 40” and “Over
40”.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 4-11

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.

When you insert a table or list into a report,


Report Builder and Report Designer
automatically creates a details group, and adds a
row to display the detail data. When the report is
viewed, the details row repeats once for every
value in the result set.

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.

Recursive Hierarchy Groups


A recursive hierarchy group uses data from a
dataset that has multiple hierarchical levels.
Examples of this kind of data include a report
showing an organization structure with employee
and manager relationships, or a product report
containing product categories and subcategories.

Before creating a table as a recursive hierarchy


group, there must be a dataset that contains the
hierarchical relationship data. In the organization
chart example, the dataset would have to contain
at least the employee’s name, an employee ID,
and a manager ID.

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.

Here is an example of a padding expression that could be used:

Textbox padding expression


=CStr(2 + (Level()*20)) + "pt"

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

Adding a document map


A very useful feature in a report containing hierarchical data is the inclusion of a document map. SSRS can
automatically generate a document map. When specifying the recursive parent, a report writer can also
specify a field, or expression, to be used for the text in the document map. In the previous example, the
employee’s name would be a good candidate for this text.

Adding Totals to Regions


One of the benefits of grouping data in a report
is that you can use the groupings to show
aggregated values for the data. For example, a
report showing sales grouped by product
category, subcategory, and individual products,
can show sales totals for each of those sections.

You can use the following technique to add an


aggregation to a report:

Right-click a group in the Groupings pane, click


Add Total, and click Before or After, depending
on where you want to display the total. This
technique adds a row (or column if you clicked a
column group for a matrix data region) containing a Sum function for each numeric field in the group.

Demonstration: Sorting and Grouping


In this demonstration, you will see how to:
 Add groups to a table.

 Change the sorting on these new groups.

Demonstration Steps
Add Groups to an Existing Report

1. On the taskbar, click File Explorer.

2. Navigate to D:\Demofiles\Mod04.

3. Double click Reports Demo.sln.

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].

15. Click OK.

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.

20. Click Delete Columns.

21. Click the cell containing Subcategory. Right-click the gray button above the Subcategory cell.

22. Click Delete Columns.

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.

26. Page through the report to show the grouped data.

Add Sorting to a Report

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.

5. In the Sort by drop-down, select [OrderDate]. Click OK.

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.

8. Click Enable interactive sorting on this text box.

9. Click Groups, and in the drop-down select EnglishProductCategoryName.

10. In the Sort by drop-down, select [EnglishProductCategoryName]. Click OK.

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

Enabling Drilldown in a Grouped Report


Groups and aggregations enable you to create
reports that include summary and detailed levels
of information. In many business scenarios,
report users initially want to view summary
information, and only explore details for specific
groupings where a potential issue or anomaly
merits further investigation. Reporting Services
supports this drill-down functionality, enabling
you to hide or show groups in a report by
clicking a toggle button associated with a field in
the parent group.

You can use the following techniques to enable


drill-down functionality in a report:

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.

Considerations for output format


Drill-down functionality is only available when a published report is viewed in a browser or exported to a
format such as Microsoft Excel® where the renderer supports this kind of interactivity. When exported to
a format that does not support interactivity, the data is rendered statically in the state in which it is
currently displayed in the browser. To overcome this problem, you can create a version of the same report
for each target format; for example, an interactive report that includes a hyperlink to a static version for
printing. This can entail a lot of additional work to develop and manage multiple versions of each report.
An alternative is to design adaptive reports that modify their behavior, depending on the rendering
extension being used. To help you accomplish this, Reporting Services supports the following global
variables:

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:

=iif(Globals!RenderFormat.IsInteractive, True, False)


MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 4-15

Adding Aggregated Fields by Using Expressions


Most aggregates in reports use a sum for each
group, but you might want to use average,
minimum, maximum, count, or a more complex
function.

You can use aggregate functions for the same


group and level, or for a specific named scope as
follows:

 Add a row or column to the group and enter


an expression that includes an aggregation
function such as Sum, Avg, Min, Max, or
Count. By default, the function aggregates
data at the same level as the group within
which it is used. For example, you could use the following expression in a Product group to show the
total sales for each product:

=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:

=Sum(Fields!SalesAmount.Value) & " of " & Sum(Fields!SalesAmount.Value,


"Product_Category")

Configuring Page Breaks for Groupings


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, enabling you to start a fresh page
for each new instance of a group.

Key ways in which you can control pagination


include:

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).

Pagination and Microsoft Excel


The ability to control pagination is particularly useful when you export reports to Microsoft Excel. By
default, the Excel rendering extension creates a workbook with a single worksheet containing the report
data. The worksheet name, which is shown in the tabs at the bottom of the workbook, is based on the
name of the report by default. However, if you specify an InitialPageName property value, it is used for
the worksheet name.

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.

Implementing Drillthrough Actions


You can add actions to go to a bookmark, to a
URL, or to another report. To specify another
report, the report must already exist. Actions can
be added to many items including images, text
boxes, and data points on a chart. To add an
action, go to the properties of the item where
you are adding the action, then go to the Action
tab.

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.

5. In the Specify a report field, in the drop-down, select Drilldown report.

6. Click Add.

7. In the Name drop-down, select ReportParameter1.

8. In the Value drop-down, select [EnglishProductCategoryName].

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.

15. Click Go to report.

16. In the Specify a report field, in the drop-down, select Order Detail.

17. Click Add.

18. In the Name drop-down, select SalesOrderNumber.

19. In the Value drop-down, select [SalesOrderNumber].


20. Click OK.

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.

Check Your Knowledge


Question

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?

Select the correct answer.

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.

Sort by country and then by region.

Configure a page break for each country.


MCT USE ONLY. STUDENT USE PROHIBITED
4-18 Configuring Reports

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.

 Publish a report to a report server.

 Publish a report to a SharePoint site.

 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.

Publishing a Report to a Report Server


In Report Designer, the term for publishing a
report is deploying a report. The terms publish
and deploy are interchangeable in this respect.
Before publishing a report, you must define the
URL of the target report server in the
deployment properties.

For more information about setting deployment


properties for Report Designer, see MSDN:

Set Deployment Properties (Reporting


Services)
http://aka.ms/Hnbhfu
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 4-19

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.

Publishing a Report to a SharePoint Site


The steps to publish a report to a SharePoint site
depend on whether you are using Report Builder
or Report Designer.

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.

The following deployment properties must be set:


 TargetServerURL. Use fully qualified URL.

 TargetReportPartFolder. Use fully qualified URL.

 TargetReportFolder. Use fully qualified URL.

 TargetDataSourceFolder. Use fully qualified URL.

 TargetDatasetFolder. Use fully qualified URL.

 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:

1. Open a web browser and navigate to the


report location. If the report has been
published to a report server running in
native mode, the user must navigate to the
Report Manager site, and if necessary, enter
appropriate authentication credentials. If the
report has been published to a report server
in SharePoint integrated mode, the user
must navigate to the document library in the
SharePoint site where the reports have been
published.
MCT USE ONLY. STUDENT USE PROHIBITED
4-20 Configuring Reports

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: Publishing a Report to a SharePoint Site


In this demonstration, you will see how to publish a report to SharePoint with Report Designer.

Demonstration Steps
Publishing with Report Designer

1. On the taskbar, click File Explorer.

2. Navigate to D:\Demofiles\Mod04.

3. Double click Reports Demo.sln.

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.

6. Ensure the TargetDataSourceFolder is set to http://mia-


sql/sites/adventureworks/Reports/DataSources.
7. Ensure the TargetReportFolder is set to http://mia-sql/sites/adventureworks/Reports.

8. Ensure the TargetReportPartFolder is set to http://mia-


sql/sites/adventureworks/Reports/ReportParts.
9. Ensure the TargetServerURL is set to http://mia-sql/sites/adventureworks.

10. Click OK.

11. In the Reports Demo - Microsoft Visual Studio window, in the Solution Explorer pane on the right,
right-click Reports Demo, then click Deploy.

12. Wait until the Deploy process has completed.

13. On the toolbar, click Internet Explorer.


14. In the address bar type http://mia-sql/sites/adventureworks/Reports.

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

Check Your Knowledge


Question

When you are publishing a report to a SharePoint site with Report Builder, what
needs to be specified?

Select the correct answer.

Report server location

TargetReportFolder

TargetDataSourceFolder

TargetDatasetFolder
MCT USE ONLY. STUDENT USE PROHIBITED
4-22 Configuring Reports

Lab A: Create and Publish Reports That Include Parameters


with Report Designer
Scenario
To meet new business requirements, the current reporting solution would require many duplicate reports
based on filters. To reduce the number of reports, you have decided to implement parameters. Once
you’ve added these new parameters, you will publish the report.

Objectives
After completing this lab, you will have:

 Added a new parameter to an existing report.

 Included grouping and aggregation in the report.

 Added visual elements to improve the ability to compare data.

 Published an updated report to SharePoint.


Estimated Time: 90 minutes

Virtual machine: 10990B-MIA-SQL

User name: ADVENTUREWORKS\Student


Password: Pa$$w0rd

Exercise 1: Implementing Parameters in a Report


Scenario
A colleague in your department has created an SSRS report to show Internet sales by product category.
This report has a chart and table of values. It currently has 1,374 pages.

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:

1. Prepare the Lab Environment

2. Walk Through the Existing Report


3. Add a New Parameter

4. Add a Default Value

5. Enhance the Report’s Usability

 Task 1: Prepare the Lab Environment


1. Ensure 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.

2. Run Setup.cmd in the D:\Labfiles\Lab04\Starter folder.

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

 Task 2: Walk Through the Existing Report


1. Open the D:\Labfiles\Lab04\Starter\Reports.sln SSRS solution Visual Studio.

2. Preview the Internet Sales.rdl report.

3. Note that the report data starts at 2010.

 Task 3: Add a New Parameter


1. In Report Designer, add a dataset to get a list of all the available years of data in the
FactInternetSales table. This dataset should have distinct values for each year. You should name it
AvailableYears.

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.

 Task 4: Add a Default Value


1. In Report Designer, add a new dataset that returns the latest year (maximum year) from the
FactInternetSales table. Name this CurrentYear.

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.

 Task 5: Enhance the Report’s Usability


1. Change the title of the report to include the selected reporting year—it should be Internet Sales by
[@Year].

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.

Results: After completing this exercise, you will have:

Added a parameter to an existing report.

Set a default value for a parameter.

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

Exercise 2: Grouping and Aggregating Data in a Report


Scenario
After seeing the new report, your manager has thought of several enhancements that could be
implemented. The report is still too long and doesn’t enable focusing on the product orders.

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.

The main tasks for this exercise are as follows:

1. Create a Duplicate Report

2. Add Grouping
3. Remove Unnecessary Report Items

4. Add Total Sales for the Groups

5. Enable the Ability to Drill Down into a Report

6. Add Page Breaks for the Month Grouping

 Task 1: Create a Duplicate Report


 Before enhancing the current report, save the current Internet Sales by Year report as Grouped
Internet Sales.

 Task 2: Add Grouping


1. The report needs to be grouped by Month, ProductCategory, ProductSubcategory, and Product.

2. Add these groups using the Add group menu.

3. When adding the groups, also add a footer to contain aggregation information you will add in
following steps.

4. For the Month group, you should also include a header.

5. Preview the changes you have made.

 Task 3: Remove Unnecessary Report Items


1. Remove all the fields that contain redundant information. Delete the second instances of the Year,
Month, ProductCatergory, ProductSubcategory, and Product columns in the detail section of the
tablix.

2. Preview the changes you have made.

 Task 4: Add Total Sales for the Groups


1. Add a sales total aggregation below the [SalesAmount] cell.

2. Add a count of the number of orders aggregation below [SalesOrderNumber].


3. Preview the changes you have made.

 Task 5: Enable the Ability to Drill Down into a Report


1. Change the visibility of each of the groups to appear when the parent group field is clicked.

2. Preview the changes you have made.


MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 4-25

Fix the Totals Issue

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.

3. Change the format of the [Sum(SalesAmount)] column to Currency.

4. Preview the changes you have made.

 Task 6: Add Page Breaks for the Month Grouping


1. For the Month grouping, add page breaks between each instance of the group.

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.

4. Preview the changes you have made.

5. Close Excel.

Results: After completing this exercise, you will have:


Created groups within a report.

Aggregated the data to show total sales by group.

Added the ability to drill down to specific sales orders.


Adjusted the page breaks so that each month is on one page.

Enhanced the Excel export so that the worksheets are named correctly.

Exercise 3: Creating Visual Comparisons in a Report


Scenario
A final requirement has been received to improve the report and make it more visual. The changes are to
include the addition of data bars to quickly show the product category sales, and sparklines to show the
distribution of sales over a month.

The main tasks for this exercise are as follows:

1. Create a Duplicate Report

2. Move the Report Title Text into the Header

3. Add a Data Bar

4. Add a Sparkline

 Task 1: Create a Duplicate Report


 Before enhancing the current report, you should save the current Internet Sales by Year it has
Grouped Internet Sales in http:/mia-sql/ReportServer_SQL2/Reports.

 Task 2: Move the Report Title Text into the Header


1. Add a header to the report.

2. Move the title text box into the header.


MCT USE ONLY. STUDENT USE PROHIBITED
4-26 Configuring Reports

 Task 3: Add a Data Bar


1. Add a data bar in the cell next to above [ProductCategory].

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.

5. Preview the changes you have made.

 Task 4: Add a Sparkline


1. Insert a sparkline chart for the Total text under [ProductSubcategory] and [ProductCategory].

2. The sparklines should be for SalesAmount against OrderDate, with the interval set to Days.

3. Preview the changes you have made.

Results: After completing this exercise, you will have:


Created a header.

Added a data bar to an existing report.

Added a sparkline to an existing report.

Exercise 4: Publishing and Viewing a Report


Scenario
A new SharePoint reporting server has been made available to your department, and your manager would
like you to deploy the visual report you created previously.

The reporting SharePoint portal is located at http://mia-sql/sites/adventureworks/Reports.

The main tasks for this exercise are as follows:

1. Verify the Location Where the Report Deploys

2. Deploy the Reports to SharePoint

3. View the Reports on SharePoint

 Task 1: Verify the Location Where the Report Deploys


1. Verify the Report projects deployment settings.

2. Verify the TargetServerURL is set to http://mia-sql/sites/adventureworks.

3. Verify all other targets are set to http://mia-sql/sites/adventureworks/Reports.

 Task 2: Deploy the Reports to SharePoint


1. Deploy the Reports project.

2. Wait for Visual Studio to confirm it has successfully deployed the reports.

 Task 3: View the Reports on SharePoint


1. View the Visual Internet Sales report on SharePoint at http://mia-
sql/sites/adventureworks/Reports.

2. Note that the report can now be viewed directly on SharePoint.


MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 4-27

3. Close Internet Explorer, and then close Visual Studio.

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

Lab B: Create and Publish Reports That Include Parameters


with Report Builder
Scenario
To meet new business requirements, the current reporting solution would require many duplicate reports
based on filters. To reduce the number of reports, you have decided to implement parameters. Once you
have added these new parameters, you will publish the report.

Objectives
After completing this lab, you will have:

 Added a new parameter to an existing report.

 Included grouping and aggregation in the report.

 Added visual elements to improve the ability to compare data.

 Published an updated report to SharePoint.


Estimated Time: 90 minutes

Virtual machine: 10990B-MIA-SQL

User name: ADVENTUREWORKS\Student


Password: Pa$$w0rd

Exercise 1: Implementing Parameters in a Report


Scenario
A colleague in your department has created an SSRS report to show Internet sales by product category.
This report has a chart and table of values. It currently has 1,374 pages.

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:

1. Prepare the Lab Environment

2. Walk Through the Existing Report


3. Add a New Parameter

4. Add a Default Value

5. Enhance the Report’s Usability

 Task 1: Prepare the Lab Environment


1. Ensure 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.

2. Run Setup.cmd in the D:\Labfiles\Lab04\Starter folder.

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

 Task 2: Walk Through the Existing Report


1. Open the SSRS reports page at mia-sql/Reports_SQL2/browse/Reports.

2. View the current Internet Sales report, and note that the data starts at 2010.

3. Navigate back to the parent folder.

 Task 3: Add a New Parameter


1. In Report Builder, add a dataset to get a list of all the available Years of data in the FactInternetSales
table. This dataset should have distinct values for each year. You should name it AvailableYears.

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.

 Task 4: Add a Default Value


1. In Report Builder, add a new dataset that returns the latest year (maximum year) from the
FactInternetSales table. Name this CurrentYear.

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.

4. Return to the Design view.

 Task 5: Enhance the Report’s Usability


1. Change the title of the report to include the selected reporting year; it should be Internet Sales by
[Year].

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.

4. Return to the Design view.

Results: After completing this exercise, you will have:

Added a parameter to an existing report.

Set a default value for a parameter.

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

Exercise 2: Grouping and Aggregating Data in a Report


Scenario
After seeing the new report, your manager has thought of several enhancements that could be
implemented. The report is still too long and does not enable staff to focus on the product orders.

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.

The main tasks for this exercise are as follows:

1. Create a Duplicate Report

2. Add Grouping
3. Remove Unnecessary Report Items

4. Add Total Sales for the Groups

5. Enable the Ability to Drill Down into the Report

6. Add Page Breaks for the Month Grouping

 Task 1: Create a Duplicate Report


 Before enhancing the current report, save the current Internet Sales by Year it has Grouped
Internet Sales in mia-sql/ReportServer_SQL2/Reports.

 Task 2: Add Grouping


1. The report needs to be grouped by Month, ProductCategory, ProductSubcategory, and Product.

2. Add these groups using the Add group menu.

3. When adding the groups, also add a footer to contain aggregation information you will add in the
following steps.

4. You should also include a header for the Month group.

5. Preview the changes you have made.

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.

6. Return to the Design view.

 Task 3: Remove Unnecessary Report Items


1. Remove all the fields that contain redundant information. Delete the second instances of the Year,
Month, ProductCatergory, ProductSubcategory, and Product columns in the detail section of the
tablix.

2. Remove the header row.

3. Preview the changes you have made.

 Task 4: Add Total Sales for the Groups


1. Add a sales total aggregation below the [SalesAmount] cell.

2. Add a count of the number of orders aggregation below [SalesOrderNumber].


MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 4-31

3. Preview the changes you have made.

 Task 5: Enable the Ability to Drill Down into the Report


1. Change the visibility of each of the groups to appear when the parent group field is clicked.

2. Preview the changes you have made.

Format the Totals cells

1. Change the format of the [Sum(SalesAmount)] cell from Default to Currency.

2. Preview the changes you have made.

 Task 6: Add Page Breaks for the Month Grouping


1. For the Month grouping, add page breaks between each instance of the group.

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.

4. Preview the changes you have made.

Results: After completing this exercise, you will have:


Created groups within a report.

Aggregated the data to show total sales by group.

Added the ability to drill down to specific sales orders.


Adjusted the page breaks so that each month is on one page.

Enhanced the Excel export so that the worksheets are named correctly.

Exercise 3: Creating Visual Comparisons in a Report


Scenario
A final requirement has been received to improve the report and make it more visual. The changes are to
include the addition of data bars to quickly show the product categories sales, and sparklines to show the
distribution of sales over a month.

The main tasks for this exercise are as follows:

1. Create a Duplicate Report

2. Move the Report Title Text into the Header

3. Add a Data Bar

4. Add a Sparkline

 Task 1: Create a Duplicate Report


 Before enhancing the current report, save the current Grouped Internet Sales as Visual Internet
Sales in mia-sql/ReportServer_SQL2/Reports.

 Task 2: Move the Report Title Text into the Header


1. Add a header to the report.
MCT USE ONLY. STUDENT USE PROHIBITED
4-32 Configuring Reports

2. Move the title text box into the header.

 Task 3: Add a Data Bar


1. Add a data bar in the cell next to above [ProductCategory].

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.

5. Preview the changes you have made.

 Task 4: Add a Sparkline


1. In the [ProductSubcategory] and [ProductCategory] columns, insert a sparkline chart into the cells
containing the Total text.

2. The sparklines should be for SalesAmount against OrderDate.

3. Preview the changes you have made.

Results: After completing this exercise, you will have:

Created a header.
Added a data bar to an existing report.

Added a sparkline to an existing report.

Exercise 4: Publishing and Viewing a Report


Scenario
A new SharePoint reporting server has been made available to your department, and your manager would
like you to deploy the visual report you created previously.

The reporting SharePoint portal is located at http://mia-sql/sites/adventureworks/Reports.


The main tasks for this exercise are as follows:

1. Download the Report Components to be Deployed to SharePoint

2. Upload Components to SharePoint

3. Correct the Connections Between Components

 Task 1: Download the Report Components to be Deployed to SharePoint


 Download the Visual Internet Sales report, and the InsternetSales shared dataset, to
D:\Labfiles\Lab04.

 Task 2: Upload Components to SharePoint


 Upload the previously downloaded files to mia-sql/sites/adventureworks/Reports.

 Task 3: Correct the Connections Between Components


1. After the report and shared dataset are uploaded to SharePoint, they need to be connected together.

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.

4. Repeat these steps for the Visual Internet Sales report.

5. Click the ellipsis (…) next to Visual Internet Sales, then click the ellipsis (…) again, then click Manage
Shared Datasets.

6. Connect the report to InternetSales.

7. Run the report to view it on SharePoint.

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

Module Review and Takeaways


It is very common for the requirements of businesses to continually change regarding the information
they need, and how they want it to be presented. On viewing a detailed report, senior management will
likely request 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 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 

Lesson 1: Overview of SQL Server Mobile Reports 5-2 

Lesson 2: Preparing Data for Mobile Reports 5-7 

Lesson 3: SQL Server Mobile Report Publisher 5-13 

Lab: Working with Mobile Reports 5-23 

Module Review and Takeaways 5-29 

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:

 Describe considerations for mobile reports.

 Prepare data for publication in mobile reports.

 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:

 Describe the motivation for mobile reporting solutions.

 Explain the design-first approach to mobile reporting.


 Explain the data-first approach to mobile reporting.

 Use mobile reporting key performance indicators (KPIs).

Why Do We Need Mobile Reports?


There are many reasons for the introduction of
mobile reports. Some are covered in this lesson.

Better mobile experience


High-powered mobile computing devices—such as
smartphones and tablets—are ubiquitous in many
modern businesses, but the screen size and touch
interface of these devices can make it awkward to
consume the paginated reports generated by
traditional reporting tools such as SSRS. SQL Server
mobile reports use an intuitive grid-based layout
with which you can quickly design reports for
different mobile device form-factors. Mobile reports
can be viewed in a browser on any device, or accessed through the Power BI for iOS, Android or Windows
Phone.

KPI and dashboard components


Business decision makers typically prefer to quickly view and interpret summarized information in the
form of KPIs and dashboards. SQL Server mobile reports can include many visual components—such as
gauges, graphs, and maps—that you can easily link to your data and add to your reports.

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

Data from many sources


Business dashboards and KPI scorecards typically draw information from diverse sources into a single
report. SQL Server mobile reports can be based on SSRS data sources or created directly from data in a
Microsoft Excel® spreadsheet. You do not need to define formal relationships between source data; SSRS
can automatically correlate data from different sources based on dates and times or on key values, so that
report elements from different sources always display related data.

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:

Data model for SSRS mobile reports


http://aka.ms/Lp28pd

Consistent look and feel


Users expect a consistent look and feel when viewing the reports on different devices. Although they are
called “mobile” reports, the reports generated by the mobile report publishing process can be viewed on
any computer. The SSRS portal has been rewritten to accommodate and display mobile reports—the first
major revision of the portal since it was released as part of SQL Server 2005.

Data-First Approach to Mobile Reports


There are two approaches you can take when
designing mobile reports, the first of which is data-
first. The data-first approach is similar to the
approach you typically use when designing reports
using Report Builder or Report Designer, which has
the following steps:

1. Identify data sources.

2. Compose data source queries.

3. Link reporting elements to query result sets.

You might use the data-first approach when you


are confident that the source data is formatted
correctly for use with mobile reports, or when converting an existing paginated report to a mobile report.

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

Design-First Approach to Mobile Reports


The second approach to designing mobile reports is
design-first. With this approach, you define the
visual composition of the report before you link the
report to one or more sources of data. When you
use the design-first approach, the Mobile Report
Publisher generates a small set of random
simulated data on which your report controls can
be based while you are configuring them.

The design-first approach is most useful when you


are exploring the best way to present data, or the
data sources you plan to use are not available in a
format suitable for mobile reports. Because the
simulated dataset is part of the report definition, you can publish a mobile report based on simulated
data alone; this can be useful when you want to get early feedback from other users about the report
design.

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:

Work with simulated data


http://aka.ms/Lvg9e7
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 5-5

Mobile Report KPIs


SQL Server mobile reports support KPIs that you
can create directly in Reporting Services folders
through the new portal. You can configure a mobile
report KPI entirely by using manual data, using
fields from a shared dataset, or from a mixture of
manual and shared dataset data.

Each KPI can have the following attributes:

 KPI name. The title that appears on the KPI.

 Description. A free-text description of the KPI.


Optional.

 Value format. The formatting applied to the


KPI value.

 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: Mobile Reports in Action


In this demonstration, you will see several examples of mobile reports.

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.

2. In the D:\Demofiles\Mod05 folder, run Setup.cmd as Administrator.

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.

6. Click the browser Back button.

7. Click Gauge Example.


The report shows an example of the same data presented on various different gauge styles supported
by mobile reporting. The subtitle of each gauge shows the gauge type.
MCT USE ONLY. STUDENT USE PROHIBITED
5-6 Create Mobile Reports

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.

9. Click the browser Back button.


10. Click Simulated Example.
The report shows various different report elements linked by a scorecard grid. The report uses
simulated data.

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.

14. Click the browser Back button.


15. Click Time Navigator Example.
The report shows a bar graph and a map linked to a time navigator element. The report will take a
few seconds to open because it is based on data retrieved from the AdventureWorks and
AdventureWorksDW databases.

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.

18. Click the browser Back button.

19. Click Tree Map Example.


The report shows a tree map filtered by a selection list. The report is based on a dataset embedded in
the report. The size of each box in the tree map is determined by the value of the Amount field,
relative to the other Amount values. The color of each box is determined by a comparison of
Amount to Delta values.

20. On the left, click Media and demonstrate that the tree map adjusts to show data related to Media.

21. Close Internet Explorer.

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:

 Optimize reports by pre-aggregating data.

 Properly format dates and times.

 Prepare data for use in filters.


 Use Excel files in mobile reports.

 Configure an SSRS instance for mobile access.

Optimizing Reports with Pre-Aggregation


In general, the performance of mobile reports will
improve when the amount of aggregation that
must be carried out by Reporting Services is kept to
a minimum. For example, for a report that shows
order values by month, Reporting Services does not
have to aggregate data if the source dataset for the
report already contains values aggregated by
month. However, if the source dataset is composed
of many individual sales order detail rows,
Reporting Services must aggregate the data by
month before the report can be rendered.

Note: At the time of writing, the unofficial


guidance from the mobile report development team is that mobile report datasets should ideally
have no more than 100,000 rows.

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.

Formatting Time Data


Date and time data must be presented in a format
that Mobile Report Publisher can correctly
recognize. Many date and time formats are
supported. Examples of supported data and time
formats include:

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

4/02/2016 16:57:32.80 -04:00

2 April 2016 4:57:32.8 PM

Sat, 2 April 2016 20:57:32 GMT

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.

Prepare Filter Data


You can filter data in mobile reports by date and
time, or on a key field. You designate a key field for
each report element when you link it to a source
dataset. Compound keys—made up of more than
one column in the dataset—are not supported; to
be an effective filter key, a key field should be a
single column. However, you can define more than
one filter key for use with different filter navigators
on the same report.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 5-9

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

United Arab Emirates Arab States

Bahrain Arab States

Australia Asia and Pacific

Bangladesh Asia and Pacific

Armenia CIS

Belarus CIS

Andorra Europe

Bosnia and Herzegovina Europe

Bermuda North America

Antigua and Barbuda South/Latin America

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

Asia and Pacific

CIS

Europe

North America

South/Latin America

Benin Africa

Botswana Africa
MCT USE ONLY. STUDENT USE PROHIBITED
5-10 Create Mobile Reports

Key ParentKey

United Arab Emirates Arab States

Bahrain Arab States

Australia Asia and Pacific

Bangladesh Asia and Pacific

Armenia CIS

Belarus CIS

Andorra Europe

Bosnia and Herzegovina Europe

Bermuda North America

Antigua and Barbuda South/Latin America

For more information about formatting data, see the topic Prepare data for SQL Server mobile reports in
the SQL Server 2016 Technical Documentation:

Prepare data for SQL Server mobile reports


http://aka.ms/Cal362

Using Excel Files in Mobile Reports


When you base a mobile report on an Excel
workbook, the data from the workbook becomes
part of the mobile report definition. At that point,
the link between the report data and the workbook
data is broken. If you update the workbook, you
must reimport the data to the mobile report
definition.

Rules for using Excel data


There are a number of rules to follow when
preparing your data for import from an Excel data
source:
 Mobile Report Publisher can create a dataset for each worksheet in your workbook, so make sure you
separate your data into one dataset per worksheet.

 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.

 Ensure cells containing date values are formatted as dates.

 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:

Prepare Excel data for SQL Server mobile reports


http://aka.ms/C8zi9p

Enable a Report Server for Mobile Access


Some configuration might be required to enable
access to mobile reports from mobile devices.

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:

Configure a Firewall for Report Server Access


http://aka.ms/T6gl54

Using Power BI for iOS


If you plan to provide access to mobile reports through device web browsers, no additional configuration
is required. However, if you plan to provide access to mobile reports through the Power BI for iOS app for
iPad and iPhone, additional configuration is required.
MCT USE ONLY. STUDENT USE PROHIBITED
5-12 Create Mobile Reports

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:

Enable a report server for Power BI Mobile access


http://aka.ms/X963jp

For more information about enabling basic authentication, see the topic Configure Basic Authentication on
the Report Server in the SQL Server 2016 Technical Documentation:

Configure Basic Authentication on the Report Server


http://aka.ms/Ny0llp

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:

Configure SSL Connections on a Native Mode Report Server


http://aka.ms/Aqk54o

Check Your Knowledge


Question

How many datasets should you have per Excel worksheet, for use as a data source for
a mobile report?

Select the correct answer.

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:

 Describe SQL Server Mobile Report Publisher.

 Add a dataset to a mobile report.

 Design a mobile report.

 Explain mobile report phone, tablet, and master views.

 Publish a mobile report.

What Is SQL Server Mobile Report Publisher?


SQL Server Mobile Report Publisher (SSMRP) is the
tool that you use to design and publish mobile
reports; at the time of writing, it is the only tool that
you can use to carry out these tasks.

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.

To download SSMRP, use the following link to the


Microsoft website:

Download SQL Server Mobile Report Publisher


http://aka.ms/Tcgkog

Working with SSMRP


You interact with SSMRP through four tabs in the application:
 Layout. Configure the layout of the visual components of a report on the Layout tab.

 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.

You can import data into Mobile Report Publisher


from two sources:

 Excel local workbook. After importing the


data from Excel, it is then stored in the report. The data can be updated using the Refresh All Data
button.

 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:

Data Sources Supported by Reporting Services (SSRS)


http://aka.ms/Ahv6bi

You import datasets using the Add Data button on the Data tab of SSMRP.

Demonstration: Adding a Dataset


In this demonstration, you will see how to:
 Format Excel data for use in a mobile report.

 Add a dataset from an Excel file.

 Update a dataset from an Excel file.


 Add a dataset from an SSRS shared dataset.

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.

6. Save the workbook and close Excel.

Add a Dataset from Excel

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.

Update a Dataset from Excel


1. In File Explorer, navigate to D:\Demofiles\Mod05, and the double-click report_data.xlsx.

2. On Sheet2, click cell B7, type Rebecca Green, and then press Enter.

3. Save the workbook and close Excel.

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.

Add a Dataset from an SSRS Shared Dataset

1. Click Add data, and then click Report server.

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 Category chart. The x-axis is defined by a grouping of data values.

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 Simple DataGrid. A simple tabular representation of the dataset.

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:

Maps in SQL Server mobile reports


http://aka.ms/Ak15kh
MCT USE ONLY. STUDENT USE PROHIBITED
5-18 Create Mobile Reports

Demonstration: Designing a Report


In this demonstration, you will see how to:

 Design a mobile report.

 Configure navigators and visualizations.

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.

6. In the Data properties region, in the Keys list, click Sheet2.

7. In the Filter these details when a selection is made region, select the Sheet2 and Sheet3 check
boxes.

8. In the Sheet3 list, click Region.

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.

13. In the Row numbers list, click Hide.

14. On the Data tab, click 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.

17. On the Data tab, click Sales Person.

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.

23. In the Visual properties region, click Set ranges.


24. In the Neutral end box, type 110.00 %.
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 5-19

25. In the Neutral start box, type 90.00 %, and then click Done.

26. On the Data tab, click Total Value.

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.

Phone, Tablet, and Master Views


With SSMRP, you can define the various views of a
report suitable for viewing on different screen
aspect ratios. When a report is opened on a device,
it will display the report view that best matches its
screen resolution and aspect ratio. Each view is
defined by the size of the grid in the Design tab.
Each view may have a different combination of
report elements selected from the control instance
gallery.

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: Defining Phone and Tablet Views


In this demonstration, you will see how to:

 Define tablet and phone views for a mobile report.

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.

Define Phone View

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.

8. Leave SSMRP open for the next demonstration.

Publishing Mobile Reports


You can change the appearance of your mobile
report by selecting a color palette. When you have
finished the design of your mobile report, you can
save the report definition to a file, or publish it to
an SSRS instance.

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: Publishing a Mobile Report


In this demonstration, you will see how to:

 Change the palette of a mobile report.

 Save a mobile report to the file system.

 Publish a mobile report to SSRS.

 View a published report.

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.

2. On the menu bar, click Save mobile report as.

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.

View a Published Report

1. In Internet Explorer, navigate to http://mia-sql/Reports_SQL2, click MobileReports, and then click


Regional Sales. This is the master view of the report.

2. In File Explorer, navigate to D:\Demofiles\Mod05, right-click browser_size.html, point to Open


with then click Internet Explorer.

3. In the message bar, click Allow blocked content.

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

Lab: Working with Mobile Reports


Scenario
Your workforce is increasingly mobile and needs a solution to view reports on a range of mobile devices.
In this lab, you will design and publish mobile reports, using Reporting Services. You have been asked to
create a mobile report that senior managers can use to monitor KPIs and other metrics related to activity
in the Adventure Works Cycles call center.

Objectives
After completing this lab, you will be able to:

 Define datasets for mobile reports.

 Design mobile reports.


 Publish mobile reports.

 Create a mobile KPI.

Estimated Time: 60 minutes

Virtual machine: 10990B-MIA-SQL

User name: ADVENTURWORKS\Student

Password: Pa$$w0rd

Exercise 1: Defining Datasets for Mobile Reports


Scenario
You decide to use the data-first approach to build this mobile report, so you will import datasets to
SSMRP before adding visual elements to the report.

The main tasks for this exercise are as follows:


1. Prepare the Lab Environment

2. Import Data from an Excel File

3. Import Data from an SSRS Shared Dataset

 Task 1: Prepare the Lab Environment


Run the Setup Script

 Run Setup.cmd in the D:\Labfiles\Lab05\Starter folder as Administrator.

 Task 2: Import Data from an Excel File


1. Start SSMRP, then change the report name to Call Center Metrics.

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.

 Task 3: Import Data from an SSRS Shared Dataset


1. Import the SalesEmployees shared dataset from the mia-sql/Reports_SQL2 SSRS server.

2. Leave SSMRP open for the next exercise.

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

Exercise 2: Designing a Mobile Report


Scenario
In this exercise, you will connect the datasets you imported in the previous exercise to navigators and
visualizations.

The main tasks for this exercise are as follows:

1. Add a Time Navigator

2. Add a Pie Chart


3. Add a Selection List

4. Add Numbers

5. Add a Progress Bar

 Task 1: Add a Time Navigator


1. On the report master view, add a time navigator that is five cells high and three cells wide. The time
navigator should have the following visual properties:

o Time levels: Months, Weeks, Days


o Time range presets: All

o Number format: General

o Visualization type: Step Area

o Show comparison delta: On

o Value direction: Lower values are better

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.

 Task 2: Add a Pie Chart


1. On the report master view, add a pie chart, adjacent to the time navigator, that is five cells high and
three cells wide. The pie chart should have the following visual properties:

o Title: Abandoned Calls


o Number Format: General

o Series Visualization: Donut

o Value Display Mode: Percentage on Chart

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.

 Task 3: Add a Selection List


1. On the report master view, add a selection list, adjacent to the pie chart, that is five cells high and two
cells wide. The selection list should have the following visual property:

o Title: Call Center Staff


MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 5-25

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.

 Task 4: Add Numbers


1. On the report master view, add a number, adjacent to the selection list, that is one cell high and two
cells wide. The number should have the following visual properties:

o Title: Total Sales

o Number Format: Abbreviated Currency

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:

o Title: Sales Target

o Number Format: Abbreviated Default Currency

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.

 Task 5: Add a Progress Bar


1. On the report master view add a progress bar, in the empty space adjacent to the pie chart, that is
two cells high and two cells wide. The selection list should have the following visual properties:

o Title: Sales Target Progress


o Delta Label: Percentage from target

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

Exercise 3: Publishing a Mobile Report


Scenario
The mobile report you have created is almost ready for publication. In this exercise, you will configure
phone and tablet views of the report, then select a color palette, before finally publishing the report to
the SSRS server.

The main tasks for this exercise are as follows:

1. Define the Tablet View

2. Define the Phone View

3. Select a Palette and Publish the Report

4. View the Published Report

 Task 1: Define the Tablet View


1. In SSMRP, on the Layout tab, use the view selector to switch to Tablet view. Add the following
elements to the report:

o Time navigator 1: height 5 cells, width 6 cells


o Total Sales: height 3 cells, width 3 cells

o Abandoned Calls: height 3 cells, width 3 cells

2. Preview tablet view when you have completed configuring it.

 Task 2: Define the Phone View


1. On the Layout tab, use the view selector to switch to Phone view. Add the following elements to the
report:

o Call Center Staff: height 4 cells, width 4 cells


o Sales Target Progress: height 2 cells, width 4 cells

2. Preview phone view when you have completed configuring it.

 Task 3: Select a Palette and Publish the Report


1. On the Layout tab, use the palette selector to select the Steel palette.

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.

 Task 4: View the Published Report


1. In Internet Explorer, go to mia-sql/Reports_SQL2/MobileReports, to view the Call Center Metrics.

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

Exercise 4: Creating a Mobile KPI


Scenario
You have been asked to create a mobile KPI that will track the number of production line stoppages in the
Adventure Works factory. Because this data is not available in an Excel file or from the database, you will
create a manually maintained KPI.

The main tasks for this exercise are as follows:

1. Create a Manual Mobile KPI

2. Create an Automated Mobile KPI

 Task 1: Create a Manual Mobile KPI


1. Use Internet Explorer to create a new mobile KPI in the MobileReports folder of mia-
sql/Reports_SQL2. The KPI should have the following properties:

o KPI name: Production Line Stoppages

o Value format: General

o Value: Set manually, 5

o Goal: Not set

o Status: Set manually, -1 (bad)

o Trend set: Set manually, 5;0;1;0;0;6;5;1

2. Leave Internet Explorer open for the next task.

 Task 2: Create an Automated Mobile KPI


1. Create another mobile KPI. The KPI should have the following properties:

o KPI name: Total Sales


o Value format: Abbreviated currency…

o Value: Dataset field, SalesByStateByMonth.ActualSales

o Goal: Dataset field, SalesByStateByMonth.TargetSales


o Status: Set manually, 1 (good)

o Trend set: Not set

o Related content: Mobile report


o Choose a mobile report: /Call Centre Metrics

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

Check Your Knowledge


Question

Which type of visual component of mobile reports do you use to filter data?

Select the correct answer.

Gauges

Navigators

Graphs

DataGrids
MCT USE ONLY. STUDENT USE PROHIBITED
Analyzing Data with SQL Server Reporting Services 5-29

Module Review and Takeaways


In this module, you have worked with the new mobile reports features in SQL Server 2016. You have
learned how to work with SQL Server Mobile Report Publisher and the new Reporting Services portal to
publish mobile reports suitable for consumption on devices with different form factors.

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

Module 1: Introduction to Business Intelligence and Data


Modeling
Lab: Exploring a BI Solution
Exercise 1: Exploring a Data Warehouse
 Task 1: Prepare the Lab Environment
1. Ensure 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.

2. In the D:\Labfiles\Lab01\Starter folder, right-click Setup.cmd and click Run as administrator.

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.

 Task 2: View the Design of the AdventureWorksDW Data Warehouse


1. On the taskbar, click Microsoft SQL Server Management Studio.
2. In the Connect to Server dialog box, in the Server name text box, type MIA-SQL, in the
Authentication list, click Windows Authentication, and then click Connect.

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.

5. Double-click dbo.Reseller Sales.

 Task 3: View Sales Data from the AdventureWorksDW Data Warehouse


1. On the File menu, point to Open, and click File.

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.

Results: After completing this exercise, you will have:

Viewed the design of a data warehouse.

Viewed sales data in a data warehouse.


MCT USE ONLY. STUDENT USE PROHIBITED
L1-2 Analyzing Data with SQL Server Reporting Services

Exercise 2: Exploring a Data Model


 Task 1: Display the Total Reseller Sales
1. In Object Explorer, click Connect, and then click Analysis Services.

2. In Server name, type MIA-SQL, and then click Connect.

3. In Object Explorer, expand the MIA-SQL Analysis Server, expand Databases, expand
AdventureWorksDW, and then expand Cubes.

4. Right-click AdventureWorks, and then click Browse.

5. On the Metadata tab, expand Measures, and expand Fact Reseller Sales.
6. Drag Sales Amount to the query pane.

 Task 2: Display the Reseller Sales for Each Employee


1. On the Metadata tab, expand Dim Employee.

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.

 Task 3: Filter the Results


1. On the Metadata tab, expand Order Date dimension, expand Order Date.Calendar.

2. Drag Day Number Of Month to the dimension filter pane.

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.

 Task 4: Explore the Same Data in an Excel Pivot Table


1. In Microsoft SQL Server Management Studio, on the Adventure Works [Browse] tab, to the right of
the Language drop-down list, in the toolbar, click Analyze in Excel.

2. In the Analyze in Excel dialog, click OK.

3. In the Microsoft Excel Security Notice dialog, click Enable.

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

Results: After completing this exercise, you will have:

Displayed total sales.

Displayed sales by employee.

Displayed sales by employee for a specific month.

Exercise 3: Exploring Reports


 Task 1: View Report Data
1. On the taskbar, click Internet Explorer.

2. In the address bar, type mia-sql/Reports_SQL2/browse, and then press Enter.

3. Click the AdventureWorks Sample Reports folder.

4. In the Employee_Sales_Summary report, click the ellipses, and then click Manage.
5. In the toolbar, click Edit in Report Builder.

6. If the Internet Explorer dialog box appears, click Allow.

7. If the Connect to Report Server dialog box appears, click Yes.

8. On the Home ribbon, in the Views group, click Run.

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.

13. Close all open windows, without saving any changes.

Results: After completing this exercise, you will have:

Viewed sales data in a report.


MCT USE ONLY. STUDENT USE PROHIBITED
MCT USE ONLY. STUDENT USE PROHIBITED
L2-1

Module 2: Reporting Services Data


Lab A: Configuring Data Access with Report
Builder
Exercise 1: Configuring Data Access
 Task 1: Prepare the Lab Environment
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.

2. In the D:\Labfiles\Lab02\Starter folder, right-click Setup.cmd, and then click Run as


administrator.

3. In the User Account Control dialog box, click Yes to run the command file, and then wait for the
script to finish.

 Task 2: Create a Shared Data Source


1. Start Internet Explorer, and then browse to mia-sql/Reports_SQL2.

2. On the SQL Server Reporting Services page, click Builder.


3. On the Builder page, click New, and then click Data Source.

4. On the New data source page, in the Name box, type AdventureWorksDW.

5. In the Type box, verify that Microsoft SQL Server is selected.


6. In the Connection string box, type the following code:

data source=MIA-SQL;initial catalog=AdventureWorksDW

7. Under Credentials, click Using the following credentials.

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.

11. Click Create.

 Task 3: Create a Shared Dataset


1. In Internet Explorer, click Home.

2. On the toolbar, click New, then click Dataset.

3. In the Internet Explorer dialog box, click Allow.


4. In the New Report or Dataset dialog box, click Browse other data sources.

5. In the Select Data Source dialog box, double-click Builder, click AdventureWorksDW, and then
click Open.

6. In the New Report or Dataset dialog box, click Create.

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.

10. On the File menu, click Save.

11. In the Save As Dataset dialog box, double-click Builder.

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.

 Task 4: Create a Shared Dataset with a Filter


1. In Report Builder, on the File menu, click New.

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.

5. In the Expression list, click [SalesTerritoryGroup].

6. In the Operator box, select <>.


7. In the Value box, type North America, and then click Add.

8. In the filter list, in the new section, in the Expression list, click [SalesTerritoryGroup].

9. In the Operator box, select <>.


10. In the Value box, type NA, and then click OK.

11. Click Run Query. Notice that the filter is not applied.

12. On the File menu, click Save.

13. In the Save As Dataset dialog box, double-click Builder.

14. In the Name box, type FilteredTerritories, and then click OK.

15. In Internet Explorer, browse to http://mia-sql/Reports_SQL2/browse/Builder.


16. On the FilteredTerritories object, click the ellipsis (…) button, and then click MANAGE.

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.

 Task 5: Create a Shared Dataset with a Parameter


1. In Report Builder, on the File menu, click New.

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.

5. In the Applied filters pane, click Add Filter.

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.

11. In the Save As Dataset dialog box, double-click Builder.

12. In the Name box, type CountrySales, and then click OK.

13. Click the Run button (!).

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.

15. Close Report Builder, and then close Internet Explorer.

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

Lab B: Configuring Data Access with Report


Designer
Exercise 1: Configuring Data Access
 Task 1: Prepare the Lab Environment
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.

2. In the D:\Labfiles\Lab02\Starter folder, right-click Setup.cmd, and then click Run as


administrator.

3. In the User Account Control dialog box, click Yes to run the command file, and then wait for the
script to finish.

 Task 2: Create a Shared Data Source


1. On the taskbar, click Visual Studio 2015.

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.

8. In the Authentication list, click SQL Server Authentication.


9. In the User name box, type reporting, in the Password box, type Pa$$w0rd, and then select the
Save my password check box.

10. In the Select or enter a database name list, click AdventureWorksDW, and then click Test
Connection.

11. In the Test results dialog box, click OK.

12. In the Connection Properties dialog box, click OK.

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.

15. Right-click AdventureWorksDW.rds, and then click Deploy.

 Task 3: Create a Shared Dataset


1. In Solution Explorer, right-click Shared Datasets, and then click Add New Dataset.

2. In the Shared Dataset Properties dialog box, on the Query page, in the Name box, type AllSales.

3. In the Data source list, ensure AdventureWorksDW is selected.


MCT USE ONLY. STUDENT USE PROHIBITED
L2-5

4. In the Query box, type the following code, and then click OK:

SELECT * FROM dbo.vAllSales;

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.

To resolve it edit the D:\Labfiles\Lab02\Starter\Project\Project\AllSales.rsd file in notepad and change:

<DataSet>

To:

<DataSet Name=””>

Save and then repeat step 5.

6. On the taskbar, click Internet Explorer.

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.

 Task 4: Create a Shared Dataset with a Filter


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, on the Query page, in the Name box, type
FilteredTerritories.

3. In the Data source list, ensure AdventureWorksDW is selected.

4. In the Query type section, click Stored Procedure.

5. In the Select or enter stored procedure name list, click usp_SalesTerritory.

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.

7. On the Query page, click Refresh Fields.

8. On the Filters page, click Add.

9. In the Expression list, click [SalesTerritoryGroup].

10. In the Operator list, click <>.

11. In the Value box, type North America, and then click Add.

12. In the second row, in the Expression list, click [SalesTerritoryGroup].

13. In the Operator list, click <>.

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.

To resolve it edit the D:\Labfiles\Lab02\Starter\Project\Project\FilteredTerritories.rsd file in notepad


and change:
MCT USE ONLY. STUDENT USE PROHIBITED
L2-6 Analyzing Data with SQL Server Reporting Services

<DataSet>

To:

<DataSet Name=””>

Save and then repeat step 15.

16. In Internet Explorer, browse to mia-sql/Reports_SQL2/browse/Designer.

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.

 Task 5: Create a Shared Dataset with a Parameter


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 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.

8. Click the Run button (!).

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.

10. In the Query Designer dialog box, click OK.

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.

12. On the File menu, click Save All.

13. Close Visual Studio, 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
L3-1

Module 3: Implementing Reports


Lab A: Creating a Report with Report
Designer
Exercise 1: Creating a Report
 Task 1: Prepare the Lab Environment
1. Ensure 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.

2. In the D:\Labfiles\Lab03\Starter folder, right-click Setup.cmd and click Run as administrator.

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.

 Task 2: Create the Report


1. Start Visual Studio, and on the File menu, point at Open and click Project/Solution.

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.

7. Double-click the text box and type Internet Sales.


8. In the Toolbox, click Table, and then click on the report design surface under the text box.

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

 Task 3: Format the Report


1. In the Report Designer, click the Preview tab and view the report. Note that the report contains no
formatting.

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.

Exercise 2: Adding a Chart to a Report


 Task 1: Add a Chart
1. In the Internet Sales 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.

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

 Task 2: Specify Data for the Chart


1. Click the chart area to select it, and then if necessary click inside the chart again to display the Chart
Data pane.

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.

 Task 3: Format the Chart


1. Click the chart area to select it, and then right-click inside it again and click Chart Properties.

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.

Exercise 3: Creating a Map Report


 Task 1: Add a Map to a Report
1. In Solution Explorer, expand Reports and then double-click the Internet Sales by State report.

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.

 Task 2: Format the Map


1. Right-click the map legend and click Delete Legend.

2. Right-click the Map Title and click Delete Title.

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.

5. Click Preview to view the report.


6. Close Visual Studio, saving changes if prompted.

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

Lab B: Creating a Report with Report


Builder
Exercise 1: Creating a Report
 Task 1: Prepare the Lab Environment
1. Ensure 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.

2. In the D:\Labfiles\Lab03\Starter folder, right-click Setup.cmd and click Run as administrator.

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.

 Task 2: Create the Report


1. Start Internet Explorer and browse to mia-sql/Reports_SQL2.

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.

4. In the Select Data Source, in the Name field, type http://mia-sql/ReportServer_SQL2/Builder,


then click open.

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

 Task 3: Format the Report


1. In the Report Builder, click Run and view the report. Note that the report contains no formatting.

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.

Exercise 2: Adding a Chart to a Report


 Task 1: Add a Chart
1. In the Internet Sales 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.

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

 Task 2: Specify Data for the Chart


1. Click the chart area to select it, and then if necessary click inside the chart again to display the Chart
Data pane.

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.

 Task 3: Format the Chart


1. Click the chart area to select it, and then right-click inside it again and click Chart Properties.

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.

7. Close Report Builder without saving changes.

Results: After completing this exercise, you will have a report that includes a chart and an Excel output.

Exercise 3: Creating a Map Report


 Task 1: Add a Map to a Report
1. In Internet Explorer, browse to mia-sql/Reports_SQL2.

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.

 Task 2: Format the Map


1. Right-click the map legend and click Delete Legend.

2. Right-click the Map Title and click Delete Title.


3. Right-click the map distance scale and click Show Distance Scale to remove the distance scale.

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

Module 4: Configuring Reports


Lab A: Create and Publish Reports That
Include Parameters with Report Designer
Exercise 1: Implementing Parameters in a Report
 Task 1: Prepare the Lab Environment
1. Ensure 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.

2. In the D:\Labfiles\Lab04\Starter folder, right-click Setup.cmd and click Run as administrator.

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.

 Task 2: Walk Through the Existing Report


1. On the taskbar, click Visual Studio 2015.
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\Lab04\Starter, click Reports.sln, and then
click Open.
4. In Solution Explorer, under Reports, double-click Internet Sales.rdl.

5. On the Internet Sales.rdl [Design] tab, click Preview.

6. Note that the report data starts at 2010.

 Task 3: Add a New Parameter


1. In the Reports - Microsoft Visual Studio window, on the File menu, click Save Internet Sales.rdl As.

2. In the Save File As dialog box, in the File name box, type Internet Sales by Year.rdl, and then click
Save.

3. In the Internet Sales by Year.rdl [Design] tab, click Design.

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.

6. Click Use a dataset embedded in my report.

7. In the Data source list, select AdventureWorksDW.

8. In the Query box, type the following query:

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.

12. In the Prompt box, type Choose a reporting year.

13. In the Data type list, select Integer.

14. On the Available Values page, select Get values from a query.

15. In the Dataset: (Warning: Possible performance impact) list, click AvailableYears.

16. In the Value field list, click CalendarYear.


17. In the Label field list, click CalendarYear, and then click OK.

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.

20. In the Expression drop-down, select [Year].

21. Next to the Value box, click fx.

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.

23. In the Dataset Properties dialog box, click OK.

24. On the Internet Sales by Year.rdl [Design] tab, click Preview.

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.

27. In the Internet Sales by Year.rdl [Design] tab, click Design.

 Task 4: Add a Default Value


1. In the Reports - Microsoft Visual Studio window, in the Report Data pane, right-click Datasets, and
click Add Dataset.

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:

Select MAX(CalendarYear) AS CurrentYear


from FactInternetSales
inner join DimDate on DimDate.DateKey = FactInternetSales.OrderDateKey;

4. Click OK.

5. In the Report Data pane, expand Parameters, right-click Year, click Parameter Properties.

6. In the Report Parameter Properties dialog box, click Default Values.

7. Click Get values from a query.

8. In the Dataset: (Warning: Possible performance Impact) list, click CurrentYear.

9. In the Value field list, click CurrentYear, and then click OK.
MCT USE ONLY. STUDENT USE PROHIBITED
L4-3

10. On the Internet Sales by Year.rdl [Design] tab, click Preview.

11. Note that the report now opens with 2014 selected, and the results are displayed without the need to
click View Report.

12. On the Internet Sales by Year.rdl [Design] tab, click Design.

 Task 5: Enhance the Report’s Usability


1. Click the title box containing Internet Sales. Change the text to Internet Sales by, and increase the
size of the title box by dragging to the right.

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.

5. Click the Format toolbar, click Center.

6. Double-click the text box, and type the Report created:.

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].

10. On the Internet Sales by Year.rdl [Design] tab, click Preview.

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.

Results: After completing this exercise, you will have:


Added a parameter to an existing report.

Set a default value for a parameter.

Enhanced an existing report to display the selected parameter, and used some built-in SSRS fields.

Exercise 2: Grouping and Aggregating Data in a Report


 Task 1: Create a Duplicate Report
1. In the Reports - Microsoft Visual Studio window, on the File menu, click Save Internet Sales by
Year.rdl As.

2. In the Save File As dialog box, in the File name box, type Grouped Internet Sales.rdl, and then click
Save.

 Task 2: Add Grouping


1. On the Grouped Internet Sales.rdl [Design] tab, click Design.

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.

14. On the Grouped Internet Sales.rdl [Design] tab, click Preview.

 Task 3: Remove Unnecessary Report Items


1. On the Grouped Internet Sales.rdl [Design] tab, click Design.

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.

5. Right-click the header, and click Delete Columns.

6. Click the blank gray column header above the ProductCategory cell (fifth column) to select the
whole column.

7. Right-click the header, and click Delete Columns.

8. Click the blank gray column header above the ProductSubcategory cell (fifth column) to select the
whole column.

9. Right-click the header, and click Delete Columns.


10. Click the blank gray column header above the Product cell (fifth column) to select the whole column.

11. Right-click the header, and click Delete Columns.

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.

13. Right-click that button, then click Delete Rows.

14. On the Grouped Internet Sales.rdl [Design] tab, click Preview.

 Task 4: Add Total Sales for the Groups


1. On the Grouped Internet Sales.rdl [Design] tab, click Design.

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

4. Click the cell under [SalesOrderNumber] and type Total.

5. Right-click under the [OrderDate] cell, then click Expression.

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.

8. Right-click the [Count(SalesOrderNumber)] cell, click Copy.

9. Select the three cells below, right-click, and then click Paste.

10. On the Grouped Internet Sales.rdl [Design] tab, click Preview.

 Task 5: Enable the Ability to Drill Down into a Report


1. On the Grouped Internet Sales.rdl [Design] tab, click Design.

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.

7. Change the ToggleItem from blank to ProductSubcategory1.

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.

13. Change the ToggleItem from blank to Month1.

14. On the Grouped Internet Sales.rdl [Design] tab, click Preview.

Fix the Totals Issue

1. On the Grouped Internet Sales.rdl [Design] tab, click Design.

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.

7. On the Grouped Internet Sales.rdl [Design] tab, click Preview.

 Task 6: Add Page Breaks for the Month Grouping


1. On the Grouped Internet Sales.rdl [Design] tab, click Design.

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.

4. Select the Also at the start of the group check box.

5. On the Sorting page, change the Sort by field to [MonthNo].

6. Change the Order to Z to A, and then click OK.

7. In the Row Groups pane, click Month.

8. In the Properties pane, in the Group section, expand Group, and then change the PageName
property to be:

=Fields!Month.Value

9. On the Grouped Internet Sales.rdl [Design] tab, click Preview.

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.

12. Open File Explorer, navigate to the D:\Labfiles\Lab04 folder.


13. Double-click Grouped Internet Sales.xlsx, and review the report. Note the month name in the
worksheet.

14. Close Excel.

Results: After completing this exercise, you will have:


Created groups within a report.

Aggregated the data to show total sales by group.

Added the ability to drill down to specific sales orders.


Adjusted the page breaks so that each month is on one page.

Enhanced the Excel export so that the worksheets are named correctly.

Exercise 3: Creating Visual Comparisons in a Report


 Task 1: Create a Duplicate Report
1. In the Reports - Microsoft Visual Studio window, on the File menu, click Save Grouped Internet
Sales.rdl As.

2. In the Save File As dialog box, in the Name box, type Visual Internet Sales.rdl, and then click Save.

 Task 2: Move the Report Title Text into the Header


1. On the Visual Internet Sales.rdl [Design] tab, click Design.

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.

 Task 3: Add a Data Bar


1. Right-click the [ProductCategory] cell, point to Insert Row, and then click Outside Group - Above.

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.

6. On the Visual Internet Sales.rdl [Design] tab, click Preview.


7. On the Preview tab, click the right arrow beneath Choose a reporting year to move to page 2. Note
that you should see a data bar next to the cell containing July.

8. On the Visual Internet Sales.rdl [Design] tab, click Design.

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.

 Task 4: Add a Sparkline


1. On the Visual Internet Sales.rdl [Design] tab, click Design.

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.

10. In the Interval box, type 1.

11. In the Interval type box, type Days, and then click OK.

12. Right-click the new sparkline, then click Copy.

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

Results: After completing this exercise, you will have:

Created a header.

Added a data bar to an existing report.

Added a sparkline to an existing report.

Exercise 4: Publishing and Viewing a Report


 Task 1: Verify the Location Where the Report Deploys
1. In Solution Explorer, under Solution ‘Reports’, right-click Reports, and then click Properties.

2. In the Reports Property Pages dialog box, under Deployment, verify the TargetServerURL box is
set to http://mia-sql/sites/adventureworks.

3. Verify the TargetReportPartFolder box is set to http://mia-sql/sites/adventureworks/Reports.

4. Verify the TargetReportFolder box is set to http://mia-sql/sites/adventureworks/Reports.

5. Verify the TargetDataSourceFolder box is set to http://mia-sql/sites/adventureworks/Reports.

6. Verify the TargetDatasetFolder box is set to http://mia-sql/sites/adventureworks/Reports.

7. Verify the OverwriteDatasets box is set to True.

8. Verify the OverwriteDataSources box is set to True.

9. In the Reports Property Pages dialog box, click Cancel.

 Task 2: Deploy the Reports to SharePoint


1. In Solution Explorer, under Solution ‘Reports’, right-click Reports, and then click Deploy.
2. Wait for Visual Studio to confirm it has successfully deployed the reports. The last line in the Output
window should read:

========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========

 Task 3: View the Reports on SharePoint


1. On the toolbar, click Internet Explorer.

2. In the address bar, type mia-sql/sites/adventureworks/Reports, and then press Enter.

3. In the Reports window, click AdventureWorkDW.

4. In the Data Source: AdventureWorkDW window, click Stored credentials.

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.

8. Note that the report can now be viewed directly on SharePoint.

9. Close Internet Explorer, and then close Visual Studio.

Results: After completing this exercise, you will have published and viewed an SSRS report in SharePoint.
MCT USE ONLY. STUDENT USE PROHIBITED
L4-9

Lab B: Create and Publish Reports That


Include Parameters with Report Builder
Exercise 1: Implementing Parameters in a Report
 Task 1: Prepare the Lab Environment
1. Ensure 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.

2. In the D:\Labfiles\Lab04\Starter folder, right-click Setup.cmd and click Run as administrator.

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.

 Task 2: Walk Through the Existing Report


1. On the taskbar, click Internet Explorer.

2. In the address bar, type mia-sql/Reports_SQL2, and then press Enter.


3. On the SQL Server Reporting Services page, click Reports.

4. On the Reports page, under PAGINATED REPORTS, click Internet Sales.

5. On the Internet Sales page, scroll down and view the returned data. Note that the report data starts
at 2010.

6. At the top of the page, click Reports.

 Task 3: Add a New Parameter


1. On the Reports page, under PAGINATED REPORTS, on the Internet Sales report, in the top-right
corner, click the ellipsis (…) button, and then click MANAGE.

2. On the Edit Internet Sale page, click Edit in Report Builder.

3. In the Internet Explorer dialog box, click Allow.

4. In the Connect to Report Server dialog box, click Yes.

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.

9. In the Data source list, click AdventureWorksDW.


MCT USE ONLY. STUDENT USE PROHIBITED
L4-10 Analyzing Data with SQL Server Reporting Services

10. In the Query box, type the following query:

Select CalendarYear
from FactInternetSales
inner join DimDate on DimDate.DateKey = FactInternetSales.OrderDateKey
group by CalendarYear
order by CalendarYear desc;

11. Click OK.

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.

15. In the Data type list, click Integer.

16. On the Available Values page, click Get values from a query.

17. In the Dataset: (Warning: Possible performance impact) list, click AvailableYears.

18. In the Value field list, click CalendarYear.

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.

22. In the Expression list, click [Year].

23. Next to the Value box, click fx.

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.

25. In the Dataset Properties dialog box, click OK.

26. On the Home tab, in the Views group, click Run.

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.

28. On the Run tab, in the Views group, click Design.

 Task 4: Add a Default Value


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 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:

Select MAX(CalendarYear) AS CurrentYear


from FactInternetSales
inner join DimDate on DimDate.DateKey = FactInternetSales.OrderDateKey

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.

7. In the Dataset: (Warning: Possible performance Impact) list, click CurrentYear.

8. In the Value field list, click CurrentYear, and then click OK.

9. On the Home tab, in the Views group, click Run.


10. Note that the report now opens with 2014 selected, and the results are displayed without the need to
click View Report.

11. On the Run tab, in the Views group, click Design.

 Task 5: Enhance the Report’s Usability


1. Click the title box containing Internet Sales. Change the text to Internet Sales by, and increase the
size of the title box by dragging to the right.

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.

6. Double-click the text box, and type Report created:.

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].

10. On the Home tab, in the Views group, click Run.


11. On the Run tab, in the Export section, click Export, then click Excel.

12. In the Save As dialog box, navigate to D:\Labfiles\Lab04, then click Save.

13. On the Run tab, in the Views group, click Design.

Results: After completing this exercise, you will have:

Added a parameter to an existing report.

Set a default value for a parameter.

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

Exercise 2: Grouping and Aggregating Data in a Report


 Task 1: Create a Duplicate Report
1. On the File tab, click Save As.

2. In the Save As Report dialog box, double-click the Reports folder.

3. In the Name box, type Grouped Internet Sales, and then click Save.

 Task 2: Add Grouping


1. On the View tab, in the Show/Hide group, ensure the Grouping check box is selected.

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.

14. On the Home tab, click Run to preview the report.

15. On the Run tab, in the Views group, click Design.

 Task 3: Remove Unnecessary Report Items


1. Click the Year cell (fifth column) in the table on the report. Click the blank gray column header above
to select the whole column.

2. Right-click the header, then click Delete Columns.

3. Click the blank gray column header above the Month cell (fifth column) to select the whole column.

4. Right-click the header, then click Delete Columns.

5. Click the blank gray column header above the ProductCategory cell (fifth column) to select the
whole column.

6. Right-click the header, then click Delete Columns.

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.

10. Right-click the header, then click Delete Columns.


MCT USE ONLY. STUDENT USE PROHIBITED
L4-13

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.

12. Right-click that button, then click Delete Rows.

13. On the Home tab, click Run to preview the report.

 Task 4: Add Total Sales for the Groups


1. On the Run tab, in the Views group, click Design.

2. Click the cell under [SalesAmount], click the small field chooser that appears in the top right of the
cell, and then click SalesAmount.

3. Right-click the [Sum(SalesAmount)]cell, and click Copy.

4. Right-click each cell below, and then click Paste.

5. Click the cell under [SalesOderNumber] and type Totals.

6. Right-click the Totals cell, and click Copy.

7. Right-click each cell below, and then click Paste.

8. Right-click under the [OrderDate] cell, then click Expression.

9. In the Expression dialog box, in the Set expression for: Value box, after the equals sign, type the
following:

Count(Fields!SalesOrderNumber.Value)

10. Click OK.

11. Right-click the [Count(SalesOrderNumber)] cell, and click Copy.


12. Right-click each cell below, and then click Paste.

13. On the Home tab, click Run to preview the report.

 Task 5: Enable the Ability to Drill Down into the Report


1. On the Run tab, in the Views group, click Design.
2. On the View tab, in the Show/Hide section, select the Properties check box.

3. In the Row Groups pane, click (Details).

4. In the Properties pane, under Visibility, change the Hidden property from False to True.

5. Change the ToggleItem from blank to Product1.

6. In the Row Groups pane, click Product.

7. In the Properties pane, under Visibility, change the Hidden property from False to True.

8. Change the ToggleItem from blank to ProductSubcategory1.

9. In the Row Groups pane, click ProductSubcategory.

10. In the Properties pane, under Visibility, change the Hidden property from False to True.
11. Change the ToggleItem from blank to ProductCategory1.

12. In the Row Groups pane, click ProductCategory.

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

15. On the Home tab, click Run to preview the report.

Format the Totals cells

1. On the Run tab, in the Views group, click Design.

2. Click the top cell containing [Sum(SalesAmount)].

3. On the Home tab, in the Number group, change Default to Currency.

4. Repeat the above for all cells containing [Sum(SalesAmount)].

5. On the Home tab, click Run to preview the report.

 Task 6: Add Page Breaks for the Month Grouping


1. On the Run tab, in the Views group, click Design.

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

7. On the Home tab, click Run to preview the report.

8. On the Run tab, in the Views group, click Design.

Results: After completing this exercise, you will have:

Created groups within a report.


Aggregated the data to show total sales by group.

Added the ability to drill down to specific sales orders.

Adjusted the page breaks so that each month is on one page.

Enhanced the Excel export so that the worksheets are named correctly.

Exercise 3: Creating Visual Comparisons in a Report


 Task 1: Create a Duplicate Report
1. On the File tab, click Save As.

2. In the Save As Report dialog box, in the Name box, type Visual Internet Sales, and then click Save.

 Task 2: Move the Report Title Text into the Header


1. On the Insert tab, in the Header & Footer group, click Header, and then click Add Header.

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

 Task 3: Add a Data Bar


1. Right-click the [ProductCategory] cell, point to Insert Row, and then click Outside Group - Above.

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.

6. On the Home tab, click Run to preview the report.

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.

8. In the Run tab, in the Views group, click Design.

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.

11. In the Tooltip box, type the following:

=Fields!ProductCategory.Value

12. Click OK.


13. On the Home tab, click Run to preview the report.

14. On the Run tab, in the Navigation section, click Next. Move the cursor over the data bar to see what
each bar represents.

 Task 4: Add a Sparkline


1. On the Run tab, in the Views section, click Design.

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.

6. Right-click the new sparkline, click Horizontal Axis Properties.

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.

8. In the Interval box, type 1.

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.

14. On the Home tab, click Run to preview the report.


MCT USE ONLY. STUDENT USE PROHIBITED
L4-16 Analyzing Data with SQL Server Reporting Services

15. On the Run tab, in the Navigation section, click Next. Expand the groupings to see the sparklines.

Results: After completing this exercise, you will have:

Created a header.

Added a data bar to an existing report.

Added a sparkline to an existing report.

Exercise 4: Publishing and Viewing a Report


 Task 1: Download the Report Components to be Deployed to SharePoint
1. On the taskbar, click Internet Explorer.

2. In the address bar type mia-sql/Reports_SQL2, and then press Enter.

3. On the SQL Server Reporting Services page, click Reports.


4. In the Visual Internet Sales report, click the ellipses (…), and then click MANAGE.

5. On the Edit Visual Internet Sales page, click Download.

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.

7. In the Save As dialog box, navigate to D:\Labfiles\Lab04, then click Save.

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.

11. On the Edit InternetSales page, click Download.

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.

 Task 2: Upload Components to SharePoint


1. In Internet Explorer, in the address bar, type mia-sql/sites/adventureworks/Reports, and then press
Enter.

2. At the top of the page, click the Files tab.

3. In the New section, click Upload Document.

4. In the Add a document dialog box, click Browse.

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.

6. In the Reports - Visual Internet Sales.rdl dialog box, click Save.

7. On the Files tab at the top of the page, in the New section, click Upload Document.

8. In the Add a document dialog box, click Browse.


MCT USE ONLY. STUDENT USE PROHIBITED
L4-17

9. In the Choose File to Upload dialog box, navigate to D:\Labfiles\Lab04, click InternetSales.rsd,
click Open, and then click OK.

10. In the Reports - InternetSales.rsd dialog box, click Save.

 Task 3: Correct the Connections Between Components


1. In Internet Explorer, on the FILES tab, click the New Document drop-down arrow, and then click
Report Data Source.

2. On the Data Source Properties page, in the Name box, type AdventureWorksDW.

3. In the Connection string box, type the following code:

Data Source=(local);initial Catalog=AdventureWorksDW

4. Click Stored credentials.

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. Click the ellipsis (…) next to InternetSales.


8. In the InternetSales.rsd popup, click the ellipsis (…), then click Manage Data Sources.

9. On the Manage Data Sources: InternetSales page, click DataSetDataSource.

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.

12. Click OK.

13. Click Close.


14. In the Internet Explorer window, click the ellipsis (…) next to Visual Internet Sales.

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.

19. Click OK.

20. Click Close.

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.

26. Click OK.

27. Click Close.

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

Module 5: Create Mobile Reports


Lab: Working with Mobile Reports
Exercise 1: Defining Datasets for Mobile Reports
 Task 1: Prepare the Lab Environment
Run the Setup Script

1. In the D:\Labfiles\Lab05\Starter folder, right-click Setup.cmd, and then click Run as


administrator.

2. In the User Account Control dialog box, click Yes, and then wait for the script to finish.

 Task 2: Import Data from an Excel File


1. On the Start page, type Microsoft SQL Server Mobile Report Publisher, and then press Enter.
2. In SSMRP, on the Settings tab, in the Report title box, type Call Center Metrics.

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.

 Task 3: Import Data from an SSRS Shared Dataset


1. Click Add data, and then click Report server.

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.

Exercise 2: Designing a Mobile Report


 Task 1: Add a Time Navigator
1. On the Layout tab, click and drag Time navigator from the element gallery to the top left cell of the
design grid. Grab the sizer and expand the time navigator to fill three grids across and five down.

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.

4. In the Number format list, click General.

5. In the Visualization type list, click Step area.

6. Click the Show comparison delta switch so that its value is On.

7. In the Value direction list, click Lower values are better.


MCT USE ONLY. STUDENT USE PROHIBITED
L5-2 Analyzing Data with SQL Server Reporting Services

Note: Note that you may need to scroll to the right in the Visual properties area to find all the
properties you should configure.

8. On the Data tab, click Time navigator 1.

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.

 Task 2: Add a Pie Chart


1. On the Layout tab, click and drag Pie Chart from the element gallery to the top left empty cell of the
design grid, adjacent to the time navigator you placed in the previous step.

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.

5. In the Series visualization list, click Donut.

6. In the Value display mode list, click Percentage on Chart.

7. Click the Show legend switch so that its value is On.

Note: Note that you may need to scroll the Visual properties area to find all the properties you
should configure.

8. On the Data tab, click Abandoned Calls.

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.

 Task 3: Add a Selection List


1. On the Layout tab, click and drag Selection list from the element gallery to the top left empty cell of
the design grid, adjacent to the pie chart you placed in the previous step.

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.

4. On the Data tab, click Call Center Staff.

5. In the Data properties region, in the Keys list, click SalesEmployees.


6. In the adjacent list, click BusinessEntityID.

7. In the Labels list, in the adjacent list, click Employee.

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.

 Task 4: Add Numbers


1. On the Layout tab, 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.

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.

4. In the Number format list, click Abbreviated currency.

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.

8. In the Number format list, click Abbreviated currency.

Note: Note that you may need to scroll the Visual properties area to find all the properties you
should configure.

9. On the Data tab, click Total Sales.


10. In the Data properties region, in the Value list, click PhoneSalesCommission.

11. In the adjacent list, click SalesAmount.

12. Click Sales Target.


13. In the Data properties region, in the Value list, click SalesTarget.

14. In the adjacent list, click SalesTarget.

 Task 5: Add a Progress Bar


1. On the Layout tab, click and drag Progress Bar from the element gallery to the top left empty cell of
the design grid, below the number you placed in the previous step.

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.

4. In the Delta label list, click Percentage from target.

5. Click Set ranges.

6. In the Maximum box, type 150%.

7. In the Neutral End box, type 100%.

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.

9. On the Data tab, click Sales Target Progress.

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.

13. In the Comparison value list, click SalesTarget.


MCT USE ONLY. STUDENT USE PROHIBITED
L5-4 Analyzing Data with SQL Server Reporting Services

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.

Exercise 3: Publishing a Mobile Report


 Task 1: Define the Tablet View
1. On the Layout tab, in the upper right of the page, click the view selector, and then click Tablet.

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.

 Task 2: Define the Phone View


1. On the Layout tab, in the upper right of the page, click the view selector, and then click Phone.

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.

 Task 3: Select a Palette and Publish the Report


1. On the Layout tab, in the upper right of the page, click the palette selector, click Steel, and then click
Done.

2. On the menu bar, click Save mobile report as.

3. In the Save mobile report as dialog box, click Save to file system.
MCT USE ONLY. STUDENT USE PROHIBITED
L5-5

4. In the Save as dialog, navigate to D:\Labfiles\Lab05\Starter, 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.

7. In the Save mobile report as dialog box, in the Location box, type /MobileReports, and then click
Save.
8. Close SSMRP.

 Task 4: View the Published Report


1. In Internet Explorer, navigate to mia-sql/Reports_SQL2, click MobileReports, and then click Call
Center Metrics. This is the master view of the report.

2. In File Explorer, navigate to D:\Labfiles\Lab05\Starter, right-click browser_size.html, point to Open


with, and then click Internet Explorer.

3. In the message box, click Allow blocked content.

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.

Exercise 4: Creating a Mobile KPI


 Task 1: Create a Manual Mobile KPI
1. Start Internet Explorer, navigate to mia-sql/Reports_SQL2, click MobileReports, click New, and then
click KPI.

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.

 Task 2: Create an Automated Mobile KPI


1. In Internet Explorer click New, and then click KPI.

2. On the New KPI page, in the KPI name box, type Total Sales.

3. In the Value format list, click Abbreviated currency.

4. In the Value list, click Dataset field.

5. In the Pick dataset field box, click the ellipses (…).


MCT USE ONLY. STUDENT USE PROHIBITED
L5-6 Analyzing Data with SQL Server Reporting Services

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.

8. In the Goal list, click Dataset field.

9. In the Pick dataset field box, click the ellipses (…).

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.

12. In the Status list, ensure that Set manually is selected.


13. In the Enter status list, click 1 (good).

14. In the Trend set list, click Not set.

15. In the Related content list, click Mobile report.


16. In the Choose a mobile report box, click the ellipses (…).

17. In the Choose a mobile report window, click the MobileReports folder, click Call Centre Metrics,
and then click OK.

18. On the New KPI page, click Create.

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.

Вам также может понравиться