www.sharexxx.net - free books & magazines
Beginning
Excel
®
Services
Liviu Asnash
Eran Megiddo
Craig Thomas
104899ffirs.qxd 1/28/07 4:30 PM Page 3
104899ffirs.qxd 1/28/07 4:30 PM Page 6
Praise for
Beginning Excel
®
Services
“A must read for anyone wanting to learn how Excel Services revolutionizes the world of
spreadsheets!”
Richard McAniff
Corporate Vice President,
Microsoft Office
“This book will guide you through everything you need to know about the great new func-
tionality in Excel Services. Microsoft Office SharePoint Server 2007 is Microsoft’s platform for
business applications. Excel Services provides great new business intelligence functionality
and helps users control and manage their spreadsheets. We’re already seeing these tools and
services unleashing tremendous creativity in the developer community.”
Kurt DelBene
Corporate Vice President,
Office Business Platform Group
“Microsoft Excel’s sophisticated calculation and analysis capabilities, combined with ease of
use and programmability, have led to wide deployment in Capital Markets for critical applica-
tions such as pricing and risk management. To date, management and auditing, of what can
be highly complex linked workbooks, have posed challenges.
“Excel Services, part of Microsoft Office SharePoint Server 2007, now provides a power-
ful solution for management of mission-critical spreadsheet applications by centralizing
workbook content and calculations and providing controlled web browser access to Excel
applications and data on a client/server basis.
“We at HCL technologies see huge take-up of Excel Services in Capital Markets and are
making significant investments in developing deployment capabilities. If you want to learn
more about Excel Services, you must get this book.”
Peter Bennett
Principal, Capital Markets,
HCL Former CIO of London Stock Exchange
“Excel Services is a critical enhancement to the analysis tool that the world knows and loves.
This is the definitive book on Excel Services, from the team that dreamed it up and built it.”
Bill Baker
Distinguished Engineer,
General Manager Business Intelligence,
Microsoft Corporation
104899ffirs.qxd 1/28/07 4:30 PM Page 1
“A crucial introduction to the most important addition to Office in years.”
Avi Bryant
Co-CEO,
Dabble DB
“Microsoft Excel is a critical business tool in most organizations. As our customers use Excel
in ever more demanding ways, they have asked the Excel team for a server to enable sharing
of spreadsheets, to simplify controlling critical business information, and to provide web-
based access to their spreadsheet models. In Office 2007, the Excel team introduced Excel
Services — a server-based version of Excel — to meet precisely those needs.
“Eran, Liviu, and Craig — the authors of this book — led the development of Excel
Services 2007, so they are uniquely qualified to explain what Excel Services is, how to deploy
and run it, and how to get the most business benefit from the technology.”
David Gainer
Group Program Manager,
Microsoft Excel
“Now, the analysis and models in your spreadsheets can instantly be part of a scalable
enterprise-class application. I spent eight years working at Wells Fargo and Ernst & Young,
and I have seen hundreds of examples of spreadsheets being used as part of a reccurring
business process. Beginning Excel Services clearly and concisely shows you how to use Excel
Services to start to automate those spreadsheet-based business processes and thus save sub-
stantial amounts of time, effort, and money.”
Rod Boothby
Senior Director, Solution Marketing,
Teqlo Inc.
104899ffirs.qxd 1/28/07 4:30 PM Page 2
Beginning
Excel
®
Services
Liviu Asnash
Eran Megiddo
Craig Thomas
104899ffirs.qxd 1/28/07 4:30 PM Page 3
Beginning Excel
®
Services
Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright © 2007 by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-0-470-10489-7
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
Library of Congress Cataloging-in-Publication Data is available from the publisher.
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 Legal Department,
Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4355,
or online at
/>.
LIMIT 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 SPECIFICALLY DISCLAIM ALL
WARRANTIES, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTI-
CULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES OR PROMO-
TIONAL 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 PRO-
FESSIONAL 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 WEBSITE IS REFERRED 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 WEBSITE MAY
PROVIDE OR RECOMMENDATIONS IT MAY MAKE. FURTHER, READERS SHOULD BE AWARE
THAT INTERNET WEBSITES 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 (800) 762-2974, outside the United States at (317) 572-3993
or fax (317) 572-4002.
Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Programmer to Programmer, and related
trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates,
in the United States and other countries, and may not be used without written permission. Excel is a
registered trademark of Microsoft Corporation in the United States and/or other countries. All other
trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with
any product or vendor mentioned in this book.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print
may not be available in electronic books.
104899ffirs.qxd 1/28/07 4:30 PM Page 4
To my amazing wife, Nurit, who inspires me in everything I do. You mean everything to me.
And to my son, Edan, who reminds me that everything is possible.
—Liviu Asnash
To my wife, Inbal, for making me laugh when I need it most, and our two beautiful daughters,
Yael and Adi, for making me smile every step of the way. You make life fun and wonderful.
And to the Maximal team who “make things happen.”
—Eran Megiddo
To my wife, Mele, and daughters, Emma and Cecelia, for inspiring me each and every day.
I’m truly blessed. I love you all very much.
—Craig Thomas
104899ffirs.qxd 1/28/07 4:30 PM Page 5
104899ffirs.qxd 1/28/07 4:30 PM Page 6
About the Authors
Liviu Asnash is a Principal Development Lead at Microsoft, and currently manages the development of
Excel Services (which is part of Microsoft Office SharePoint Server 2007). Asnash has more than 15 years
of experience in enterprise-level software development. In the past five years, he has worked on Microsoft
Office in areas related to Business Intelligence, Excel, and Excel Services. Prior to joining Microsoft, he was
the director of Research and Development at Maximal Innovative Intelligence, a software company that
developed data visualization tools for Business Intelligence. Before that, he worked for six years on
mission-critical server systems based on UNIX and Oracle technologies. Asnash holds a B.S. degree in
Computer Science and an M.B.A. degree. He lives in Bellevue, Washington, with his wife and son.
Eran Megiddo is an entrepreneur at heart and is the Principal Group Program Manager at Microsoft,
responsible for the team that defines the functionality and product road map for Excel Services. Megiddo
has been designing and developing data analysis software for more than 14 years. Prior to joining
Microsoft, he co-founded Maximal Innovative Intelligence, back home in Israel. Maximal developed data
visualization and exploration tools that were eventually acquired by Microsoft. The tools were initially
released as Microsoft Data Analyzer and are now part of Microsoft Office Excel 2007. The inspiration for
Maximal was in student-assessment software developed at Memad Educational Systems, where Megiddo
led the software development and product marketing efforts. He began his professional career as an offi-
cer in an elite Israeli Military Intelligence unit. Megiddo enjoys spending his free time traveling and hik-
ing with his wife and two daughters. He is an avid theatergoer, but on most nights, you will find him in
the kitchen, where he enjoys cooking for family and friends.
Craig Thomas is a Senior Test Lead who works for Microsoft in Redmond, Washington. For the Office
SharePoint Server 2007 release, he is the Release Test Lead for Excel Services. He also leads a team of
testers who focus primarily on server performance and reliability. Prior to joining the Office team, he
was contributing to shipping Exchange Server 2003 with a focus on leading a test team responsible for
the Outlook Web Access component of Exchange. Thomas discovered his technology passions later in
life, after an 11-year career as a submariner in the United States Navy. He programmed with C and C++
early on, but now prefers C#, and keeps his coding skills fresh by staying involved with tools develop-
ment, authoring test automation scripts, and, of course, writing custom solutions for Excel Services.
104899ffirs.qxd 1/28/07 4:30 PM Page 7
104899ffirs.qxd 1/28/07 4:30 PM Page 8
Credits
Acquisitions Editor
Katie Mohr
Development Editor
Kevin Shafer
Technical Editor
Dan Battagin
Copy Editor
Kathryn Duggan
Editorial Manager
Mary Beth Wakefield
Production Manager
Tim Tate
Vice President and Executive Group Publisher
Richard Swadley
Vice President and Executive Publisher
Joseph B. Wikert
Compositor
Laurie Stewart, Happenstance Type-O-Rama
Proofreader
Jen Larsen, Word One
Indexer
Melanie Belkin
Anniversary Logo Design
Richard Pacifico
104899ffirs.qxd 1/28/07 4:30 PM Page 9
104899ffirs.qxd 1/28/07 4:30 PM Page 10
Acknowledgments
This book is the culmination of an effort we’ve all been involved with for more than three years as Excel
Services progressed from thoughts and ideas to code running in production. Along the way, a lot of people
crossed our paths and helped us get to where we are today. The words here cannot adequately express
our gratitude to the Excel Services Testing, Development, and Program Management teams at Microsoft,
who put together this amazing product and gave us something to write about. Thank you all.
Also, thanks to Wiley Publishing, especially Katie Mohr, for the support and for giving us this opportu-
nity to complete our first book.
104899ffirs.qxd 1/28/07 4:30 PM Page 11
104899ffirs.qxd 1/28/07 4:30 PM Page 12
Contents
Acknowledgments xi
Introduction xxi
Part I: Overview of Excel Services 1
Chapter 1: Introduction to Excel Services 3
Who Hasn’t Heard of Excel? 4
Why Excel on the Server? 5
The Problems with Distributing Spreadsheets 5
Controlling Spreadsheet Distribution 6
Incorporating Spreadsheets in Dashboards 7
Leveraging Spreadsheet Models in Custom Solutions 7
Offloading Spreadsheet Calculations to Servers 8
What Is Excel Services? 8
Microsoft Office SharePoint Server 9
Security 10
Web Part Pages 11
Content Storage and Management 11
Collaboration 14
Search 15
Forms Services 15
Business Intelligence 16
Administration 20
Five Key Ways to Use Excel Services 20
Distributing Workbooks Through the Browser 20
Controlling and Managing Workbook Distribution 23
Building Business Intelligence Portals and Dashboards 25
Leveraging Workbook Calculation in Custom Solutions 25
Offloading Workbook Calculation to Excel Services 26
Who Is Excel Services For? 26
What Excel Services Is Not 27
Summary 28
104899ftoc.qxd 1/29/07 1:44 PM Page xiii
xiv
Contents
Chapter 2: Getting Started with Excel Services 29
Installation Types 29
Platform Requirements 30
Hardware 30
Software 31
Excel 2007 Client 32
Installing an Evaluation Copy 32
Setup Wizard 33
Configuration Wizard 37
After Setup Completes 38
Excel Web Access 39
Excel Web Services 42
Summary 42
Chapter 3: Architecture 45
Getting to Know Excel Services 45
Understanding the Architecture 47
Office SharePoint Server Architecture 48
The Excel Calculation Server (ECS) 50
The Excel Web Access (EWA) Web Part 51
The Excel Web Services API 52
Understanding Operational Concepts 53
Sessions 53
Workbook Operations 55
Publishing and Loading Workbooks 56
Querying Data from External Databases 58
Caching and Memory Utilization 58
Scaling to Multiple Machines 61
ECS Thread Management 63
Charting 63
Optimizing for Performance 64
Load Balancing 64
Network 65
Memory 67
CPU 69
I/O 70
Charting 70
Client Machine and Browser Speed 71
Summary 71
104899ftoc.qxd 1/29/07 1:44 PM Page xiv
xv
Contents
Part II: Working with Excel Services 73
Chapter 4: Workbook Support 75
Supported File Formats 75
Unsupported Features 76
Workbook Security 78
External Data Queries 82
Graphics Objects 84
Code, Macros, and Solutions 85
Other Features 86
Partially Supported Features 86
Sheet Rendering 87
Charts 88
Calculation Extensibility 89
Summary 90
Chapter 5: External Data 91
Connecting to Data 92
Data Connection Libraries 93
Data Connections in Excel Services 95
Trusted Data Providers 96
Supported Data Objects 99
Using UDFs to Query External Data 99
Security 99
Security Threats 100
Security Mitigations 101
Credentials Delegation 103
Performance 109
Caching and Sharing 109
Connection Pooling 111
Parallel and Asynchronous Queries 111
OLAP Formulas 111
Excel Web Access 112
Refresh on Open 112
Interactivity 113
Periodic Refresh 114
Common Configuration 116
Line of Business Data 116
104899ftoc.qxd 1/29/07 1:44 PM Page xv
xvi
Contents
Reporting on Restricted Data 116
Business Intelligence Portal 117
Summary 117
Chapter 6: Capacity and Deployment Planning 119
Choosing a Deployment Topology 119
Single-Server Topology 120
Small Farm Topology 121
Medium Farm Topology 122
Large Farm Topology 123
Single-Server and Farm Topology Comparison 124
Intranet and Extranet 124
High-Performance Computing 124
Capacity Planning 126
Considerations 127
Affecting Capacity 128
Mitigation 135
Summary 138
Chapter 7: Administration of Excel Services 139
Configuring 139
Using Central Administration 140
Monitoring 169
Unified Logging Service (ULS) 170
Windows Events 177
Making Configuration Changes to Event Logging 179
Performance Counters 179
Microsoft Operations Management Pack 182
International Deployments 184
Setup 184
Language Packs 184
Cultures and Workbooks 186
Summary 190
Chapter 8: Security 191
Protecting the Workbook 191
Authentication 192
104899ftoc.qxd 1/29/07 1:44 PM Page xvi
xvii
Contents
Opening Workbooks 193
Protecting the Workbook Content 195
Configuring and Delegating Credentials 196
Protecting Against Attacks 198
Threats 198
Spoofing 199
Tampering with Data 200
Repudiation 202
Information Disclosure 202
Denial of Service 204
Elevation of Privilege 207
Extensibility 207
Summary 209
Part III: How-To Scenarios 211
Chapter 9: Sharing Workbooks with the Browser 213
Publishing a Workbook to the Server 213
The Simple Case 213
Controlling What’s Visible in the Browser 217
Other Ways to Save Your Workbook to the Server 220
Common Issues with Publishing Workbooks 221
Viewing Workbooks in the Browser 225
Viewing a Workbook from a Document Library 225
Changing the Default Click to View in Browser 226
The Excel Viewer Page 227
Sending a Link to View a Workbook in the Browser 227
Summary 229
Chapter 10: Interacting with Workbooks in the Browser 231
Navigating Workbooks and Hyperlinks 232
Scrolling Within a Worksheet 232
Navigating Between Worksheets in a Workbook 234
Switching Between Items in a Workbook 234
Working with Hyperlinks 237
Working with Grouped Rows and Columns 238
Using Tables to Sort and Filter Data 240
Using PivotTables 243
104899ftoc.qxd 1/29/07 1:44 PM Page xvii
xviii
Contents
Working with Workbook Parameters 246
Defining Workbook Parameters 246
Changing Workbook Parameters in the Browser 248
Interactivity and Charting 251
The Excel Web Access Toolbar 251
Using the Toolbar to Open a Workbook in Excel 251
Using the Toolbar to Calculate a Workbook 252
Reloading the Workbook File 254
Finding Data in a Workbook 255
Excel Web Access Interactivity Settings 256
Summary 257
Chapter 11: Controlling Workbook Distribution 259
Controlling Workbook Authoring 259
Controlling Who Can Publish Workbooks 260
Using Content Approval to Review Workbooks 262
Using Workflows to Review Workbooks 266
Using Check-In, Check-Out, and Versioning 273
Controlling Workbook Viewing 278
The View Only Permission 278
Workbook Snapshots 281
Alerts and RSS Feeds 283
Auditing Workbook Usage 286
The End-to-End Scenario 290
Summary 292
Chapter 12: Business Intelligence Solutions 293
Report Centers 293
Report Libraries 296
Key Performance Indicators 300
Building Business Intelligence Dashboards 305
Business Intelligence Everywhere 317
Working with SQL Server Analysis Services 318
Connecting to Analysis Services from Excel 319
Building a Data-Bound Dashboard 324
Summary 329
104899ftoc.qxd 1/29/07 1:44 PM Page xviii
xix
Contents
Chapter 13: Offloading Workbook Calculation to the Server 331
The Benefits 331
Setup and Configuration Considerations 332
Excel Services Settings 332
Deployment Topology Considerations 333
Sample Solution Designs 334
Integrating with Windows Compute Cluster Server 2003 335
Summary 335
Chapter 14: Building Custom Solutions 337
Excel Services Web Service 337
First-Use Information 338
Creating a Custom API Application 340
Local Linking 343
Web Service API Methods 343
GetApiVersion 344
OpenWorkbook 344
GetSessionInformation 345
CloseWorkbook 346
CancelRequest 347
Refresh 348
CalculateA1 349
Calculate 350
CalculateWorkbook 352
GetRangeA1 353
GetRange 354
GetCellA1 356
GetCell 357
SetRangeA1 358
SetRange 360
SetCellA1 362
SetCell 363
GetWorkbook 364
API Sample 365
User-Defined Functions (UDFs) 367
UdfMethodAttribute Class 367
Argument Data Types 368
104899ftoc.qxd 1/29/07 1:44 PM Page xix
xx
Contents
Ranges as Arguments 369
Parameter Arrays as Arguments 370
Return Data Types 370
Returning a Range 371
Creating a UDF 372
ECS XLL UDF 375
Xlviewer Customizations 376
Setting New Defaults and URL Parameters 376
Configurable Properties 378
EWA and API Working Together 379
JavaScript Approach 380
Managed-Code Approach 383
Summary 389
Appendix: Troubleshooting 391
Index 393
104899ftoc.qxd 1/29/07 1:44 PM Page xx
Introduction
Excel is, by far, the most popular spreadsheet tool available. It is used by millions of end users each day
to solve a wide range of problems. It provides solutions that span the gamut from simple list-keeping to
mission-critical trading solutions that drive multimillion dollar trades on Wall Street. Everyone with an
M.B.A. knows how to use it (and probably was already introduced to it somewhere back in middle
school). Every financial department relies on it. Managers in business in every industry and at every
level of the organization make decisions based on the numbers presented by and calculated in Excel.
Given how critical Excel is for business and users, it is not surprising that the need for better management,
distribution, and incorporation of spreadsheets in larger applications is ever-increasing. Excel Services is an
exciting new technology being delivered as part of Microsoft Office SharePoint Server 2007 to address this
need. Excel Services enables the execution and sharing of workbooks on the server, thereby providing
one version of the truth. It enables managed and secure distribution of Excel reports, incorporating
spreadsheets in business intelligence (BI) dashboards and portals, protecting the proprietary informa-
tion in spreadsheets, and building custom applications with Excel-based logic.
The authors of this book led the development of Excel Services at Microsoft. By sharing their insights
into the benefits and usage of Excel Services here, they hope to help you solve your business problems.
Whom This Book Is For
This book is an introduction to Excel Services for all those who want to understand what it is, what it
does, what the benefits are, and how to get started with Excel Services. If you share a need to provide a
solution for your customers or organization, then this book is for you. This book is also targeted at any-
one who is tasked with evaluating and later deploying Office 2007, and, specifically, Office SharePoint
Server 2007. The book is technical and walks you through setting up and using the server, and discusses
the architecture behind the scenes. This book is great if you are an IT developer or technical decision
maker who is considering whether to use Excel Services within your organization. This book is also great
for all Microsoft partners, including system integrators, consulting companies, hosting companies, value-
added resellers, and independent software vendors who want to build and deploy solutions for their
customers based on the new Office technologies. Anyone currently managing or developing solutions
with Excel, Windows SharePoint Services, SharePoint Portal Server, or BI solutions should read this
book to understand the basics of Excel Services.
This book assumes an understanding of Excel and basic knowledge of Excel 2007. It also assumes that
you are familiar to some extent with Windows SharePoint Services. Knowledge of SharePoint Portal
Server would also be a benefit. The last chapter of this book is a coding chapter, and to best understand
it, you need basic coding skills, including knowledge of C# and JavaScript.
104899flast.qxd 1/28/07 4:30 PM Page xxi
What This Book Covers
This book covers the Excel Services functionality that ships as part of Microsoft Office SharePoint Server
2007. Although it mentions other products (such as Excel 2007 and other features of Microsoft Office Share-
Point Server 2007), explaining those products and features is outside the scope of this book.
Because this is the first version of the Excel Services technology, the book begins with the basics, explain-
ing what Excel Services is for and how to use it. The book takes you from deploying an evaluation copy of
the server, to administrating it, and provides step-by-step procedures for how to use the server in each
of the scenarios it was designed for. It also covers the underpinnings of the server, delving into the server’s
architecture.
How This Book Is Structured
The first part of this book, “Overview of Excel Services,” includes the following chapters:
❑ Chapter 1, “Introduction to Excel Services,” explains the problems that Excel Services addresses.
It then discusses what Excel Services is at a high level and what key scenarios are targeted.
❑ Chapter 2, “Getting Started with Excel Services,” walks you through setting up an evaluation
version of the product on your server.
❑ Chapter 3, “Architecture,” explains the main components and how they work.
The second part of this book, “Working with Excel Services,” goes into more detail about various aspects
of the technology, and includes the following chapters:
❑ Chapter 4, “Workbook Support,” discusses what types of workbooks and which Excel features
are supported by Excel Services.
❑ Chapter 5, “External Data,” discusses querying data from external databases into Excel Services,
and the relevant security and performance implications.
❑ Chapter 6, “Capacity and Deployment Planning,” starts by explaining the supported topologies
and then discusses capacity planning.
❑ Chapter 7, “Administration of Excel Services,” drills down into the various administrative settings
and other features intended for system administrators.
❑ Chapter 8, “Security,” discusses the most important security threats, and then explains the features
and recommended configurations to mitigate them.
The third part of this book, “How-To Scenarios,” provides several step-by-step procedures to implement-
ing important Excel Services scenarios, and includes the following chapters:
❑ Chapter 9, “Sharing Workbooks with the Browser,” describes the steps needed to publish a
workbook to the server and view it in the browser.
❑ Chapter 10, “Interacting with Workbooks in the Browser,” describes the functionality available
to interact with the workbook in the browser.
Introduction
xxii
104899flast.qxd 1/28/07 4:30 PM Page xxii