1165 Professional Microsoft SQL Server 2012 Reporting Services
PROFESSIONAL MICROSOFT® SQL SERVER® 2012 REPORTING SERVICES FOREWORD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxv INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxvii
⊲ PART I GETTING STARTED
CHAPTER 1 Introducing Reporting Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 CHAPTER 2 Reporting Services Installation and Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
CHAPTER 3 Confi guring SharePoint Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 ⊲ PART II REPORT DESIGN CHAPTER 4 Basic Report Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 CHAPTER 5 Report Layout and Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 CHAPTER 6 Designing Data Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 CHAPTER 7 Advanced Report Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 CHAPTER 8 Chart Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 ⊲ PART III BUSINESS INTELLIGENCE REPORTING CHAPTER 9 BI Semantic Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 CHAPTER 10 Reporting with Analysis Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 CHAPTER 11 OLAP Reporting Advanced Techniques . . . . . . . . . . . . . . . . . . . . . . . . . 295 ⊲ PART IV ENABLING USER REPORTING CHAPTER 12 Tabular Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349 CHAPTER 13 Visual Analytics with Power View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373 CHAPTER 14 Report Builder Solution Strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
⊲ PART V SOLUTION PATTERNS
CHAPTER 15 Managing Report Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463 CHAPTER 16 Report Solutions, Patterns, and Recipes . . . . . . . . . . . . . . . . . . . . . . . . . 483 ⊲ PART VI ADMINISTERING REPORTING SERVICES CHAPTER 17 Content Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525 CHAPTER 18 Integrating Reports with SharePoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559 CHAPTER 19 Native Mode Server Administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581 ⊲ PART VII REPORTING SERVICES CUSTOM PROGRAMMING CHAPTER 20 Integrating Reports into Custom Applications . . . . . . . . . . . . . . . . . . . . 619 CHAPTER 21 Using Embedded and Referenced Code . . . . . . . . . . . . . . . . . . . . . . . . . 681 CHAPTER 22 Extending Reporting Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697 ⊲ PART VIII APPENDIXES APPENDIX A T-SQL Commands, Clauses, and Predicates . . . . . . . . . . . . . . . . . . . . . . 758 APPENDIX B T-SQL System Variables and Functions . . . . . . . . . . . . . . . . . . . . . . . . . . 779 APPENDIX C MDX Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803 INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
829
PROFESSIONAL
Microsoft® SQL Server® 2012
Reporting Services
PROFESSIONAL
Microsoft® SQL Server® 2012
Reporting Services
Paul Turley,
Robert M. Bruckner,
Thiago Silva,
Ken Withee, and Grant Paisley
Professional Microsoft® SQL Server® 2012 Reporting Services Published by John Wiley & Sons, Inc.
10475 Crosspoint Boulevard Indianapolis, IN 46256 Copyright © 2012 by John Wiley & Sons, Inc., Indianapolis, Indiana Published simultaneously in Canada
ISBN: 978-1-118-10111-7
ISBN: 978-1-118-22379-6 (ebk)
ISBN: 978-1-118-23713-7 (ebk)
ISBN: 978-1-118-26210-8 (ebk) Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means,
electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108
of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online atLimit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifi cally disclaim all warranties, including without limitation warranties of fi tness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional
services. If professional assistance is required, the services of a competent professional person should be sought. Neither
the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site isreferred to in this work as a citation and/or a potential source of further information does not mean that the author or the
publisher endorses the information the organization or Web site may provide or recommendations it may make. Further,
readers should be aware that Internet Web sites listed in this work may have changed or disappeared between when this
work was written and when it is read.For general information on our other products and services please contact our Customer Care Department within the United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002. Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at
Library of Congress Control Number: 2012933621 Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affi liates, in the United States and other countries, and may not be used without written permission. Microsoft and SQL Server are registered trademarks of
Microsoft Corporation. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc., is not
associated with any product or vendor mentioned in this book.
This book is dedicated to my wonderful wife, Sherri,
for her love and endless support. To my dad, Mark,and to the most incredible young people on the planet;
Krista, Sara, Rachael, and Josh.— Paul Turley Dedicated to my parents. — Robert M. Bruckner
I dedicate this book to my beautiful wife, Michelle, who still loves me and encourages me, after all these years; to my children, Gabriella, Joshua, and Olivia, who brighten my life with their smiles and unconditional hugs; and to my mother Lucia who keeps believing that I am a rockstar.
— Thiago Silva I dedicate this book to my wife and best friend, Rosemarie Withee.
— Ken Withee I dedicate this book to my wife Sue, who still loves me after all these years; to my teenage kids, Megan,
Lisa, and Zoe, who have turned out even better than I
could have hoped; and to mum and dad who gave me
the opportunity and encouragement to always do and
learn new things.— Grant Paisley
ABOUT THE AUTHORS
PAUL TURLEY is a Mentor with SolidQ, a Microsoft MVP, solution architect, teacher and presenter.
He speaks at industry conferences and authors several publications on BI, data visualization, and reporting. He blogs at SQLServerBIBlog.com. He has been developing business database solu- tions since 1991 for companies like Microsoft, Disney, Nike, and Hewlett-Packard. He has been a Microsoft Certifi ed Trainer since 1996 and holds several industry certifi cations, including MCTS and MCITP for BI, MCSD, MCDBA, MSF Practitioner, and IT Project+.
Paul has authored and coauthored several books and courses on databases, business intelligence, and application development technologies. His books include SQL Server Reporting Services
Recipes for Designing Expert Reports, Professional SQL Server 2008 Reporting Services, Professional SQL Server 2005 Reporting Services, Professional SQL Server Reporting Services
(SQL Server 2000), Beginning T-SQL with SQL Server 2005 and 2008, Beginning Transact-SQL
with SQL Server 2000 and 2005, Beginning SQL Server 2005 Administration, Beginning Access 2002 VBA, Data Warehousing with SQL Server 2000 Analysis Services, and Professional Access2000 Programming — all from Wrox. He is also the lead author for SQL Server 2005 Integration
Services Step by Step from Microsoft Press.ROBERT M. BRUCKNER, is a principal software architect and developer with the Microsoft SQL
Server division. Robert is responsible for the technical architecture of SQL Server Reporting Services including Power View. One of Robert’s core areas has been the design and development of the scal- able report processing engine, utilized by Reporting Services and Power View. Power View is an enhancement of Reporting Services 2012, enabling end-users to easily and interactively visualize data, quickly gain analytical insights, and simply have fun exploring data! Prior to joining Microsoft in 2003, Robert researched, designed, and implemented database and business intelligence systems as a system architect at T-Mobile Austria, and as a researcher at Vienna University of Technology, Austria. Robert holds Master and PhD degrees with highest distinctions in Computer Science from Vienna University of Technology, and holds several patents.
Anyone good with a search engine can fi nd thousands of Robert’s past postings on public news- groups and MSDN forums sharing his insights, tips, tricks, and expert advice related to Reporting Services and other SQL Server technologies. Robert has co-authored books on SQL Server Reporting Services as well as Analysis Services. Robert regularly presents at industry conferences and also maintains a popular blog at In his spare time, Robert enjoys mountain biking, skiing, and reading.
THIAGO SILVA is an MCPD and an architect and consultant for Credera. Thiago has been develop-
ing custom .NET and Reporting Services since the early days of .NET and SQL Server 2000. He is a part of the Microsoft practice within Credera, a Dallas-based consulting fi rm, delivering Microsoft solutions to clients that include several Fortune 500 companies. He has worked as a consultant for the last eight years and as a software engineer and web developer prior to that. Thiago is co-author
ABOUT THE AUTHORS
of the previous edition of this book, Professional SQL Server 2008 Reporting Services, and he was a contributor in the book Microsoft SQL Server Reporting Recipes for Designing Expert
Reports. Thiago has been featured on the tech podcast “.NET Rocks!”, and he is a member of
the DFW .NET user groups and community. He occasionally writes articles on his tech blog “Silvaware,” found at Thiago holds a BBA in Information and Operations Management with a focus on Information Systems from Texas A&M University. He holds MCAD, MCPD, and MCTS titles for web development using ASP.NET 2, 3.5, and 4.
KEN WITHEE is President of Portal Integrators LLC oftware develop-
ment company focused on developing world class business applications for the SharePoint platform.He lives with his wife Rosemarie in Seattle, Washington, and is the author or coauthor of several books including Microsoft Offi ce 365 For Dummies (Wiley, 2011), SharePoint 2010 Development
For Dummies (Wiley, 2011), Professional Microsoft Project Server 2010 (Wrox, 2012), Microsoft
Business Intelligence For Dummies (Wiley, 2010), Professional Microsoft SQL Server 2012Reporting Services (Wrox, 2012), and Professional Microsoft SQL Server 2008 Reporting Services
(Wrox, 2008). Ken has also written a number of other published works in a variety of journals and magazines. Ken earned a Master of Science degree in Computer Science studying under Dr. Edward Lank at San Francisco State University. Their work has been published in the LNCS journals and was the focus of a presentation at the IASTED conference in Phoenix. Their work has also been presented at various other Human Computer Interaction conferences throughout the world. Ken has more than 12 years of professional computer and management experience working with a vast range of technologies. He is a Microsoft Certifi ed Technology Specialist and is certifi ed in SharePoint, SQL Server, and .NET.
GRANT PAISLEY is an SQL Server MVP and founder of Angry Koala, a Microsoft Business
Intelligence consultancy based in Sydney, Australia. Grant is president of the SQL Server Usergroup Sydney and is an internationally recognized speaker who has spoken at TechEd USA, Australia, and even China. His passion about BI, in particular with visualization of data, resulted in Grant creat- ing ommunity reporting site. Grant was also a contributing author for SQL Server 2008 Analysis Services with MD and Microsoft SQL Server Reporting Services
Recipes. If you don’t see him on stage presenting, you might see him on the water kite surfi ng in
Hawai’i or mountain biking in Whistler.CREDITS EXECUTIVE EDITOR
PROJECT COORDINATOR, COVER
VICE PRESIDENT AND EXECUTIVE GROUP PUBLISHER
Richard Swadley
VICE PRESIDENT AND EXECUTIVE PUBLISHER
Neil Edde
ASSOCIATE PUBLISHER
Jim Minatel
Katie Crocker
PRODUCTION MANAGER
PROOFREADER
James Saturnio, Word One
INDEXER
Johnna VanHoose Dinse
COVER DESIGNER
Ryan Sneed
COVER IMAGE
Tim Tate
Amy Knies
Robert Elliot
Gayle Johnson
PROJECT EDITOR
Kelly Talbot
TECHNICAL EDITORS
Joe Salvatore Chris Albrektson Nigel Sammy
PRODUCTION EDITOR
Christine Mugnolo
COPY EDITOR
EDITORIAL MANAGER
BUSINESS MANAGER
Mary Beth Wakefi eld
FREELANCER EDITORIAL MANAGER
Rosemarie Graham
ASSOCIATE DIRECTOR OF MARKETING
David Mayhew
MARKETING MANAGER
Ashley Zurcher
© Mark Evans / iStockPhoto
ACKNOWLEDGMENTS
Thanks to: My wonderful family for their enduring support and occasional tolerance for my over-commitment to books, papers, projects, and events. To my wife Sherri who says “Honey, I love you, but if you bring home one more piece of conference swag, you’ll sleep in the garage.” …the Reporting Services and SQL Server BI product teams at Microsoft; Thierry, Sean, Carolyn, Lukasz, Ariel, Robert, and many others who have been open and available for the past nine years of books, projects, and support. Thank you for letting me play a small role in your quest to avail these fantastic technologies to people who use them to deliver information and make important things happen all over the world. Thanks to Mark, Chuck, Denny, Carl, John, and the SQL CAT team.
…the Microsoft MVP organization for building an unbelievable network of dedicated professionals. To the SQL Server PASS organization who have nurtured a respected and trusted community. To Arnie and the Oregon SQL team for being my “homies.” Thanks to all the PASS chapter directors and SQL Saturday organizers everywhere.
…everyone at SolidQ for building a stellar organization, unlike any other. I’m proud to be counted among so many trusted friends and professionals. A heartfelt thanks to the editorial and management team at Wiley; especially Bob and Kelly. How you maintain your sanity trying to manage those who write books in our “spare” time is beyond my comprehension. Thank you for your enduring patience and perseverance. Thank you to my co-authors and reviewers; Robert, Ken, Grant, Thiago, Joe, Chris, Nigel, and Glyn who have endured endless nights and weekends, reviews, and rewrites. Just one more revision and we should be done, guys! Thank you all for making this book happen. I have a profound respect for those who write “those other” books, and who I consider to be peers and co-contributors to a vibrant industry. Thank you Stacia, Teo, and Brian for keeping the bar high and for your contributions to the industry.
— Paul Turley
Robert would like to thank in particular Paul Turley and Bob Elliott for great collaboration through- out this project, drawing from the experience of several seasoned Reporting Services experts, and collecting proven best practices from large-scale customer deployments of Reporting Services. Furthermore, Robert would like to express a big “thank you” to all co-authors contributing to this book, to Kelly Talbot for great editorial work, and to technical reviewers for ensuring accuracy.
— Robert M. Bruckner
ACKNOWLEDGMENTS
Thanks to Thierry D’Hers, Robert Bruckner, and the Reporting Services product team for their guidance and technical assistance during the authoring of this book. Thanks to Paul Turley for continuing to give me the opportunity to be a part of this book project, and for Kelly Talbot and Bob Elliot’s support and patience during the writing and editorial process. Finally, thanks to my wife and kids, who have put up with my long hours and weekend nights spent during the writing of this book. I appreciate their love and encouragement and could not have done this without them.
— Thiago Silva
I would like to acknowledge my grandma Tiny Withee who turns 99 this year and is still going strong. I would also like to acknowledge my wife Rosemarie Withee, mother Maggie Blair, father Ken Withee, sister Kate Henneinke, and parents-in-law Alfonso and Lourdes Supetran and family. An extraordinary amount of thanks goes to my co-authors; Paul Turley, Robert Bruckner, Thiago Silva, and Grant Paisley. Special thanks to Bob Elliott, Kelly Talbot, Gayle Johnson, Joe Salvatore, Chris Albrektson, Nigel Sammy, and the rest of the Wrox team for making this book a reality.
— Ken Withee
Thank you to the Angry Koala Team, Glyn Llewellyn who picks up the reins in my absence and helped in the writing of my chapters; Colin McGowan, David Lean, Geoff Orr, Mark Fitzpatrick, Lesley Llewellyn, Peter Orgill, and Praveen Chand, who through their professionalism and enthusi- asm for BI, are the backbone to my success. Thanks to my good friend Paul Turley for opportunity and support during authoring; Kelly and the team at Wrox for their invaluable role in getting the book into production. And fi nally my family Sue, Megan, Lisa, and Zoe that I love but rarely say so. Oh and I nearly forgot: “Megan is awesome” — actually you all are!
— Grant Paisley
CONTENTS
FOREWORD xxxv
INTRODUCTION xxxvii
PART I: GETTING STARTED CHAPTER 1: INTRODUCING REPORTING SERVICES
3 Who Uses Reporting Services?
4 Business Information Workers
5 Business Managers
5 Software Developers
5 System Administrators
5 Dashboards, Reports, and Applications
6 Blurring the Line Between Applications and Reports
6 Launching Reports from an Application
7 User Interaction
7 Integrating Reports and Applications
8 Enterprise Reporting
9 Solution Types
10 Simple Report Design
10 IT-Designed Reports
11 User-Designed Reports
12 Server-Based Reports
15 Business Intelligence Reporting Solutions
16 Report Data Sources
18 Analytic Data Sources and Self-Service BI
18 Complexity and Report Performance
19 Customizing the Reporting Experience
20 Summary 20
CHAPTER 2: REPORTING SERVICES INSTALLATION AND ARCHITECTURE
23 The Basic Installation
24 Installing Reporting Services
25 Installing the Reporting Services Samples and SQL Server Sample Databases
41
xvi CONTENTS The Enterprise Deployment
55 Confi guration Files
51 Subscriptions 52 Reporting Services Windows Service
52 HTTP.SYS and the HTTP Listener
53 The Security Sublayer
54 Report Manager and the Web Service
55 Core Processing
55 Service Management
56 WMI and the RPC Interface
50 Report Viewer Control
57 Reporting Services Processors and Extensions
57 The Report Processor
58 Report Session Caching
59 Report Execution Caching
59 Snapshots 60 Data Processing Extensions
60 Report Items
51 Reporting Services Web Service
50 HTML Viewer
41 SQL Server Editions
47 Report Designer
41 Named Instances
44 Topology 44 Modes 45 Installation Options
45 Command-Line Installation
46 The Reporting Life Cycle
46 Authoring 47 Management 47 Delivery 47
Reporting Services Tools
48 Power View
49 Command-Line Utilities
48 Report Builder
48 Third-Party Authoring Tools
49 Report Manager
49 SharePoint Libraries and Web Parts
49 Reporting Services Confi guration Manager
49 SQL Server Management Applications
61
CONTENTS Rendering Extensions
61 The HTML Rendering Extension
62 The CSV-Rendering Extension
62 The XML-Rendering Extension
62 The Image-Rendering Extension
63 The PDF-Rendering Extension
63 The Excel-Rendering Extension
63 The Word-Rendering Extension
64 The Scheduling and Delivery Processor
64 Delivery Extensions
64 Reporting Services Application Databases
64 ReportServer 65 ReportServerTempDB 66
Summary 66
CHAPTER 3: CONFIGURING SHAREPOINT INTEGRATION
69 The SharePoint Technologies
70 SharePoint Foundation
70 SharePoint Server
71 SharePoint Web Parts
73 Installation and Confi guration
74 Installing SharePoint Server 2010
74 Installing Service Pack (SP) 1
76 Installing and Confi guring PowerPivot for SharePoint
77 Installing and Confi guring Reporting Services for SharePoint
81 SharePoint Site Settings
89 Architecture 90 Summary 91
PART II: REPORT DESIGN CHAPTER 4: BASIC REPORT DESIGN
95 What Good Are Wizards, Anyway?
95 Building Blocks
96 Following Along?
97 Let’s Get Started
97 Touring Report Builder 107 Offi ce Tabs and Ribbons
108 Home Tab 108 xvii
xviii CONTENTS Insert Tab
Maps and Spatial Reports 127 Defi ning Table Groups
141 Rendering Format Limits and Considerations 141 Summary 142
Browser Compatibility 140 Offl ine Viewing
Designing Multicolumn Reports 139 Designing Gauge Reports 139
Formatting Report Data 138 Introduction to Dynamic Formatting 138
130 Interactive Sort 134 Adding Page Breaks 135 Creating Drill-Down Reports and Dynamic Visibility 136
128 Group Expressions and Options 128 Formatting Table Values
125 List Reports 126 Chart Reports 126 Gauge Reports and Dashboards 127
109 View Tab 110 Report Builder Menu
Table Reports 124 Matrix Reports
CHAPTER 5: REPORT LAYOUT AND FORMATTING 123 Report Layout Types 124
Summary 120
Building a Matrix 113 Wrapping It Up 118 Running and Saving the Report 120
Manual Report Design 113
112 Server Reports 112
111 Viewing and Setting Properties 112 Data Sources
CHAPTER 6: DESIGNING DATA ACCESS 143 Business Intelligence Reporting 146 Reporting for Relational Data 148 Data and Query Basics 148 Data Sources 148
CONTENTS Creating a Data Source from the Project Add Item Template 149 Creating a Data Source in the Report Wizard 149 Creating a Data Source When Defi ning a Dataset 152 Data Sources and Query Languages 153
T-SQL Query Design 154 Data Warehouse Star Schema 155
Filtering Techniques 161
Filtering a Query 162 Parameter Concepts 163 Filtering Data with Query Parameters 165
Creating a Parameter List 167 Multivalue Parameters 168 Cascading Parameters 170 Report Parameters
175 Using Stored Procedures 176 Filtering Data with Report Parameters 177
Using Other Data Sources 180
Microsoft Access 180 Building a Query in a String Expression 183
Microsoft Excel 184 Oracle P/L SQL 185 Sybase Adaptive Server 186 Federating Data Sources 186
Best Practices 187 Summary 187
CHAPTER 7: ADVANCED REPORT DESIGN 189 Headers and Footers
190 Aggregate Functions and Totals 194 Adding Totals to a Table or Matrix Report 196
Creating Report Templates 198 Creating Composite Reports 199
Anatomy of a Textbox 199 Padding and Indenting
200 Embedded Formatting 201 Embedded HTML Formatting 202
Designing Master/Detail Reports 204 Groups and Dataset Scope 205 Using a List to Combine Report Items and
Data Regions 205 xix
CONTENTS Designing Subreports 212
Federating Data with a Subreport 213 Execution and Resource Implications 216 Navigating Reports
219 Creating a Document Map
219 Links and Drill-Through Reports 221 Navigating to a Bookmark
223 Navigating to a URL 223
Reporting on Recursive Relationships 224 Summary 228
CHAPTER 8: CHART REPORTS 229 Chart Types
230 Column Charts
230 Stacked Charts 233 Area and Line Charts 233 Pie and Doughnut Charts 234 Bubble and Stock Charts 235 Chart Type Summary 237 The Anatomy of a Chart 239
Creating a Multiseries Chart 240 Using Multiple Chart Areas
242 Useful Properties and Settings 246 Control the Number of Items Displayed on an Axis 246 Manage Axis Text Placement and Rotation 246 Manage the Format of Axis Values 246 Change the Color and Width of a Series Line 246 Set a Tooltip for a Chart Value 246 Control the Width and Gap Between Columns or Bars 246 For a Chart with Multiple Chart Areas, Control the Exact Position of Each Chart Area
247 Dynamically Increase a Chart’s Size 247 Summary 247
PART III: BUSINESS INTELLIGENCE REPORTING CHAPTER 9: BI SEMANTIC MODELS 251 Introduction to Data Modeling 252 The BI Semantic Model 253
Conceptual Architecture 256 Data Model
257 xx
CONTENTS Business Logic and Queries 260 Data Access
260 The Hybrid Nature of the BI Semantic Model 261 Summary 262
CHAPTER 10: REPORTING WITH ANALYSIS SERVICES 263 Why Use Analysis Services for Reporting? 264 Using Reporting Services with Analysis Services Data 266 Working with Multidimensional Expression Language 266 MDX: Simple or Complex? 267 Building Queries with the MDX Query Designer 267
Creating a Data Source 268 Building the Dataset Query 270
Using Parameterized Queries 273 Modifying the MDX Query 278
Adding Nonadditive Measures 285 When to Use the Aggregate Function 287
MDX Properties and Cube Formatting 289 Drill-Through Reports 290
Creating Cube Report Actions 291 Parameter Safety Precautions 292 Best Practices and Provisions 293 Summary 293
CHAPTER 11: OLAP REPORTING ADVANCED TECHNIQUES 295 Cube Dynamic Rows 296
Cube Dynamic Rows Anatomy 296 Parameters 296 Dataset 297 Matrix Content
301 Formatting the Row Label 301 Highlighting the Current Row 303
Dynamic Number Formatting 304 Self-Calling Drill-Through Action 304 Cube Dynamic Rows Summary 306
Cube Dynamic Rows Expanded 306 MDX Query Modifi cations
306 Design Surface Modifi cations 308 Tablix 308 Visualization Tweaks
308 Summary 309 xxi
xxii CONTENTS Cube Restricting Rows 309
Footer Information 342 Final Thoughts 345
Analyzing and Enriching Data 363 Filtering and Sorting
361 The Advanced Tab 362
The Home Tab 360 The Design Tab
Importing Data into PowerPivot 355 PowerPivot Window 360
PowerPivot for Excel 352 Setup and Installation 354
PART IV: ENABLING USER REPORTING CHAPTER 12: TABULAR MODELS 349 Introduction to PowerPivot 350
Summary 346
Swap Actions 336 Titles 338
Designing the Report 309 pRowCount Parameter 309 Restricting the Number of Rows in the MDX Query 312
327 Cube Browser Member 329 Behind the Scenes 329 Cube Browser 329 Report Body 334 Restricting Rows and Columns 336
Anatomy of the Reports 326 Cube Browser 326 Cube Browser Metadata
Cube Browser 324
Adding Other Cube Metadata 320 Final Thoughts 324
Designing the Report 315 MeasureGroups 318
Cube Metadata 315
Adding pRowCount to Self-Calling Drill-Through Report Action 314 A Better Way to Interact with a Report Parameter 314 Summary 314
363 Relationships 364
CONTENTS Calculated Columns
367 Measures 368 Browsing the Model
371 Summary 372
CHAPTER 13: VISUAL ANALYTICS WITH POWER VIEW 373 Introduction to Power View
374 Power View Architecture 379
Architecture Overview 380 Reporting Services Add-in
381 Reporting Services Service Application 381 PowerPivot for SharePoint
382 Preparing a Model and Connection for a Tutorial 382
Deploying the FAA Flight Data Model 383 Creating a SharePoint Image Library for FAA Airline Images 384 Publishing the FAA Workbook Directly to the PowerPivot Gallery 386 Creating Data Source Connections for Power View 387
BI Semantic Model (BISM) Connection File 387 Report Data Source (RSDS) Connection 388 Visual Analytics with Power View 389
Getting Started with Power View 390 Creating a New Power View Report 390 Opening an Existing Power View Report 391 Introduction to the Design Experience 391 Creating a Table Visualization 392 Converting Visualizations
394 Sorting Inside a Chart 395 Expanding Visualizations 396 Filtering in Views 396 Multiple Views 400 Saving Reports
403 Permissions for Power View 405 Visualizations and Interactivity 405 Tile Visualizations
405 Highlighting in Visualizations 408 Matrix 409 Slicers 410 Filters 410 Card and Callout Views
411 Zooming in Charts 413 Scatter and Bubble 414 xxiii
xxiv CONTENTS Animated Timeline Charts
Resources 443
Using Shared Data Sources 453 Using a BI Semantic Model 454 Designing and Deploying Report Parts 454
Report Branding 452 Data Source and Query Options 453
Conducting User Training 452 Folder and Library Management 452
User Education 451 Optimizing the Report Builder User Experience 452
449 Data Governance 450 Data Source Access and Security 451
448 Design Approaches and Usage Scenarios 448 Defi ne Ownership
Installing Analysis Services Tabular 437 Deploying a PowerPivot Workbook to Analysis Services Tabular 440 Summary 442
416 Refreshing Data in a Power View Report 418 Presenting and Exporting in Power View 418 Reading and Presentation Modes 419
Analysis Services Tabular 437
Kerberos Delegation with BISM or RSDS 432 BISM Connection and RS Service Account 433 RSDS and Stored Windows Credentials 433 RSDS with Impersonation and Eff ectiveUser 435
429 Authentication Scenarios 430 Comparison and Trade-off s 432
Connecting to PowerPivot Workbooks 427 Connecting to a BISM Connection File 428 Connecting to an RSDS
Tips and Tricks for Power View 424 Confi guring Data Source Connections 425
Printing Views 421 PowerPoint Export and Interactivity 421
CHAPTER 14: REPORT BUILDER SOLUTION STRATEGIES 445 Report Builder and Semantic Model History 447 Planning a Self-Service Reporting Environment 448 You Need a Plan
CONTENTS Using Report Parts
457 Using Shared Datasets 457
User Report Migration Strategies 457 Report Migration Phases
457 Review 457 Consolidate 458 Design 458 Test 458 Maintain 459
Summary 459
PART V: SOLUTION PATTERNS CHAPTER 15: MANAGING REPORT PROJECTS 463 Solutions and Projects 463
Project Structure 464 Multiple Reporting Environments 465
Multiple Logical Folders and Projects 465 Report-Naming Conventions 466 Shared Datasets and Data Sources 466 Key Success Factors
467 Solution Scope 467 Report Specifi cations
468 Report Template 469 Development Phases 469 Multiple Reporting Environments 469
Multiple Logical Folders and Projects 470 Version Control
471 Why Use Version Control?
471 Setting Up Version Control 471 Getting the Latest Version
472 Viewing a Report’s History 472 Restoring a Previous Version of a Report 472
Setting Check-out and Check-in Policies 472 Applying Labels 473
Synchronizing Content 473
Deploying an Individual Report 473 Deploying a Suite of Reports 473 Checking for Build Errors 473 Excluding a Report from a Deployment 473 xxv
CONTENTS Managing Server Content 474
Checking the Deployment Location 474 Managing Content in Native Mode 475 Managing Data Sources
475 Managing Data Sets 476 Managing Reports 476 Managing Content in SharePoint 477
Getting Started with Azure Reporting 477 Deploying and Executing Reports 481
Summary 482
CHAPTER 16: REPORT SOLUTIONS, PATTERNS, AND RECIPES 483 Super Reports
484 Working with the Strengths and Limitations of the Architecture 484
Report Recipes: Building on Basic Skills 487 Dashboard Solution Data Sources and Datasets 488 KPI Scorecard
488 Deploying a Report Part 492 Interactive Sparkline and Chart 494
Map with Navigation and Zoom 502 Geographic Shape Colors 506 Adding Spatial Point Markers 508
Zoom, Pan, and Tilt 509 Using Report Parts to Assemble a Dashboard 511
Dynamic Colors and Themes 514 Table Report with Dynamic Columns 517
Designing the Report 517
Summary 521
PART VI: ADMINISTERING REPORTING SERVICES CHAPTER 17: CONTENT MANAGEMENT 525 Using Report Manager 526 Content Management Activities 529
Folders 529 Shared Data Sources 531 Report Models
534 Reports 535 Report Resources
543 Shared Schedules 544 xxvi
xxvii CONTENTS Item-Level Security 545 Content Management Automation 553
The Unattended Execution Account 586 System-Level Roles 587 Surface Area Management
Trace Logs 596 Execution Logs 600 Performance Counters 602 Server Management Reports
Setup Logs 596 Windows Application Event Logs 596
595 Monitoring 595
590 Encryption Keys 592 Confi guration Files 594 Other Items
590 Application Databases
589 Backup and Recovery
CHAPTER 19: NATIVE MODE SERVER ADMINISTRATION 581 Security 582 Account Management 582 The Service Account 583 The Application Database Account 585
The RS Utility 553 Reporting Services Scripts
578 Summary 579
572 Integrated Mode Web Parts 574 Native Mode Versus Integrated Mode 577 Report Models
SharePoint Foundation and SharePoint Server Standard Edition 564 SharePoint Server Enterprise Edition 570 Report Management
562 Publishing Reports to SharePoint 564
Native Mode Web Parts Installation 560 Report Viewer 561 Report Explorer
CHAPTER 18: INTEGRATING REPORTS WITH SHAREPOINT 559 Native Mode Web Parts 560
555 Summary 557
607
CONTENTS Confi guration 607
Memory Management 607 URL Reservations
608 E-mail Delivery 610 Rendering Extensions 612 My Reports 614
Summary 616
PART VII: REPORTING SERVICES CUSTOM PROGRAMMING
CHAPTER 20: INTEGRATING REPORTS INTO CUSTOM APPLICATIONS 619 URL Access 620URL Syntax 620 Accessing Reporting Services Objects 621
Folders 621 Data Sources 623 Resources 625
Reports 625 Reporting Services URL Parameters 627 Parameter Prefi xes
627 Parameters 628 Passing Report Information Through the URL 632 Report Parameters
633 Rendering Snapshot History 634 URL Rendering Summary
635 Programmatic Rendering
635 Common Scenarios
636 Custom Security 636 Server-Side Parameters 636 Rendering Through Windows 637
Building the Application Interface 637 Setting Up the Web Services 637 Retrieving Report Information 643 Retrieving Report Parameters 648 Rendering a Report to a File on the Filesystem 653 Rendering a Report to the Filesystem Summary 660
Rendering to the Web 661 Using Integrated Windows Authentication 661 xxviii
xxix CONTENTS Modifying the web.confi g File 662 Confi guring ASP.NET 2.0 in IIS 6 and Older Versions 662 Setting Up the Report Execution Web Service 662 Rendering to the Response Object 662
Using the ReportViewer Control 669 Embedding a Server-Side Report in a Windows Application 672
Summary 678
CHAPTER 21: USING EMBEDDED AND REFERENCED CODE 681 Using the Expression Builder 683 Calculated Fields 684 Conditional Expressions
687
IIF() Is Your Friend 687 Using Custom Code
690 Using Custom Code in a Report 691 Using a Custom Assembly
692 Custom Assembly Security 694 Errors, Warnings, and Debugging Code 695
Summary 695
CHAPTER 22: EXTENDING REPORTING SERVICES 697 Extension Through Interfaces 699 What Is an Interface? 699 Interface Language Diff erences 700
A Detailed Look at Data Processing Extensions 702 Creating a Custom Data Processing Extension 705
The Scenario 705 Creating and Setting Up the Project 706
Creating the DataSetConnection Object 708 Variable Declarations 710 Constructors 710
Implementing IDbConnectionExtension 711 Impersonate Property 711 IntegratedSecurity Property 712
UserName and Password Properties 712 Implementing IDbConnection 713 Begin Transaction Method
715 CreateCommand Method 716
CONTENTS Open Method
716 Close Method 717 ConnectionString Property 717 ConnectionTimeout Property 719
Creating the DataSetParameter Class 720 Declarations 720 Implementing IDataParameter 720 ParameterName Property
721 Value Property 722 Creating the DataSetParameterCollection Class 723
Namespaces 723 Implementing IDataParameterCollection 723 Creating the DataSetCommand Class 725 Variable Declarations
726 Constructors 727 Implementing IDbCommand 728 Cancel Method
729 ExecuteReader Method 729 CommandText Property
731 CommandTimeout Property 739 CommandType Property
739 CreateParameter Method 740 Parameters Property 740 Creating the DataSetDataReader Object 741
Declarations 741 Implementing IDataReader 742 GetFieldType Method
743 GetName Method 743 GetOrdinal Method 744 GetValue Method 744 Read Method 745 FieldCount Property 746 Installing the DataSetDataProcessing Extension 746
Server Installation 746 Server Security Confi guration 747
WorkStation Installation 748 WorkStation Security Confi guration 748
Testing DataSetDataExtension 749 Summary 753 xxx
CONTENTS
PART VIII: APPENDIXES APPENDIX A: T-SQL COMMAND SYNTAX REFERENCE 757 T-SQL Commands, Clauses, and Predicates 758 WITH 758 SELECT 758 SELECT TOP 759 SELECT INTO 759 FROM 760
WHERE 760 GROUP BY 761 WITH ROLLUP 761 BY ROLLUP 761 WITH CUBE 761 BY CUBE
762 HAVING 762 UNION 762 EXCEPT and INTERSECT
762 ORDER BY 762 COMPUTE and COMPUTE BY Clauses 763
FOR Clause 763 OPTION Clause 763 CASE 763
INSERT 764 UPDATE 764 DELETE 764 DECLARE @local_variable
765 SET 765 LIKE 765 ALTER TABLE
766 PIVOT Operator 766 UNPIVOT Operator 766 CREATE DATABASE
767 CREATE DEFAULT 767 CREATE PROCEDURE 767 CREATE RULE
768 CREATE TABLE 768 CREATE TRIGGER 768 xxxi
CONTENTS
CREATE VIEW
768 CREATE SCHEMA 769 CREATE PARTITION FUNCTION 769
CREATE PARTITION SCHEME 769
Script Comment Conventions 769 Reserved Words 770
ODBC Reserved Words 772 Future Reserved Words 775
APPENDIX B: T-SQL SYSTEM VARIABLES AND FUNCTIONS 779 System Global Variables 779
Confi guration 780 Cursor 782
System 782 System Statistics 782
System Functions 783