Using Advanced and Third-Party Report Items 324Using Advanced and Third-Party Controls for Parameter Selection 335 Part Three: Enabling End User Reporting with Report Builder 339 Chapter
Trang 2Reporting Services
Paul Turley Todd Bryant James Counihan Dave DuVarney
Trang 4Reporting Services
Paul Turley Todd Bryant James Counihan Dave DuVarney
Trang 5Professional SQL Server 2005 Reporting Services
Copyright © 2006 by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
Library of Congress Cataloging-in-Publication Data:
Professional SQL Server 2005 reporting services / Paul Turley [et al.].
REPRESEN-Trademarks:Wiley, the Wiley logo, Wrox, the Wrox logo, Programmer to Programmer, and related trade dress are marks 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 SQL Server is a 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.
trade-Wiley also publishes its books in a variety of electronic formats Some content that appears in print may not be available in electronic books.
Trang 6Quality Control Technicians
Leeann HarneyJoseph NiesenCharles SpencerRobert Springer
Media Development Specialists
Angela DennyKit MaloneTravis Silvers
Proofreading and Indexing
TECHBOOKS Production Services
Credits
Trang 8About the Authors
Paul Turley
Paul Turley is a senior consultant for Hitachi Consulting He architects database, reporting and businessintelligence solutions for many prominent consulting clients In addition to Reporting Services, he hascreated reporting solutions using Crystal Reports, Active Reports, and Access Since 1988, he has man-aged IT projects, designed and programmed applications using Visual Basic 3, 4, 5, 6, ASP.NET,ADO.NET, and SQL Server He obtained his MCSD certification in 1996 and other certifications includeMCDBA, IT Project+, and Microsoft Solutions Framework (MSF) Practitioner
He designed and maintains www.Scout-Master.com, a web-based service that enables Boy Scout units to manage their membership and advancement records online using ASP.NET, SQL Server, andReporting Services
Paul authored Beginning Transact SQL for SQL Server 2000 and 2005 He has been a contributing author
on books and articles including Professional Access 2000 Programming, Beginning Access 2002 VBA, and
SQL Server Data Warehousing with Analysis Services, all from WROX Press.
My deepest appreciation goes to my wife, Sherri, and our children: Josh, Rachael, Sara, and Krista for their support and understanding Writing two books over the past year and a half has been a challenge for all of us Rachael: You did a great job managing my screen shots Sara, you are a champion and a fighter, and I appreciate your strength and example to everyone around you Thanks to my folks and extended family who make me proud to be who and where I am.
My appreciation to everyone at Hitachi Consulting for their support and contributions Hitachi is a stellar organization with top-notch people who know how to get business done Your support over the past year is appreciated.
Paul contributed Chapters 1, 2, 4, 5, 6, 7 and Appendixes C and D to this book.
Paul may be contacted at pault@scout-master.com
Todd Bryant
Todd Bryanthas been creating custom data-focused applications and reporting solutions since the earlyeighties He began using Microsoft technologies in 1998, and the love affair began Todd has been con-tract programming, teaching, and developing custom courseware ever since He is currently workinghalf-time as a software architect for SoftWyre, a Little Rock, Arkansas, based software development com-pany as well as training half-time at Netdesk Corporation in Seattle, where he concentrates on enterprisesolutions, Com+ services, and object-oriented programming using both VB.NET and C# His certifica-tions include the MCSD, MCSE, MCDBA, and MCT certifications from Microsoft; the CNA certificationfrom Novell; and both CompTIA’s A+ and CTT+
I would like to thank my family and friends for putting up with me during many months of late night work I want to thankTodd Meister, our technical Editor He was a joy to work with and made the pro- cess much more enjoyable.
Todd contributed Chapter 13 and Appendix B to this book.
Trang 9of Professional SQL Server Reporting Services.
I want to thank my wife Stephanie for putting up with another summer of weekends behind the puter I’d also like to thank the other authors for giving so much of their time to make this second book a reality.
com-Dave contributed Chapters 2, 3, 8, and 9 to this book.
Trang 10Our sincere thanks go to the members of the Reporting Services product team at Microsoft, who have beenvery supportive and accessible A large portion of this book’s content is a direct result of the numerousmeetings and phone calls and hundreds of e-mails exchanged with our friends in the Reporting Servicesgroup at Microsoft We’ve had the privilege of working with many folks at Microsoft on these two booksover the past three years and greatly appreciate their many contributions In particular, we’d like to thankJason Carlson, Brian Welcker, Chris Hays, Carolyn Chau, Tudor Trufinescu, Lukasz Pawlowski, FangWang, and Rajeev Karunakaran
A big thank you goes to Andrew Bryan at Dundas Software for his help with the charting features The
integration in the product is awesome, and your assistance and support have been invaluable
Our editors at Wiley, Katie Mohr and Tom Dinse, have been terrific to work with, and Todd Meister did
an awesome job on the technical review
The Business Intelligence team at Hitachi Consulting has been a tremendous source of support andlearning Thanks for giving us the space to push the envelope Special thanks to Hilary Feier, MikeLuckevich, Carr Krueger, Reed Jacobson, Tory Tolton, Ted Corbett, Martin Powdrill, Patrick Husting,Steve Muise, Stacia Misner, Jeanne Barnham, Scott Cameron, and too many others to mention by name
Our consulting clients deserve a lot of the credit for affording us the opportunity to put this product infront of real businesses and corporate decision makers The rules prevent us from acknowledging all ofthose we’d like to here For the many with whom we’ve had the pleasure of sharing your work spaces,attending your meetings, and bringing your servers to a grinding halt while developing reporting solu-tions, you deserve our gratitude in a large measure
Trang 12Chapter 1: What Can You Do with Reporting Services? 3
Chapter 2: Introduction to Microsoft SQL Server Reporting Services 2005 19
How Does SQL Server Reporting Services Meet This Challenge? 24
Trang 13Business Intelligence Solutions 25
Trang 14Extending Reporting Services 37
Trang 15Defining the Report Structure 82
Trang 17Pie Charts 233
Chapter 7: Report Solution Patterns and Recipes 261
Working with the Strengths and Limitations of the Architecture 269
Trang 18Using Advanced and Third-Party Report Items 324
Using Advanced and Third-Party Controls for Parameter Selection 335
Part Three: Enabling End User Reporting with Report Builder 339
Chapter 8: Reporting Services Report Models 341
Trang 20Chapter 11: Report Server Administration 457
Part Five: Reporting Services Integration
Chapter 12: Integrating Reporting Services into Custom Applications 487
Embedding a Server-Side Report in a Windows Application 527
Trang 21Chapter 13: Extending Reporting Services 537
Migrating Access Reports
Appendix B: Reporting Services Object Model 589
Appendix C: Transact SQL Command Syntax Reference 619
Trang 22Appendix D: Transact SQL System Variables and Functions 637
Trang 24Foreword I
Many people have asked me, “How can you be so passionate about reporting when it is so mundane?”
To me, the most exciting thing about reporting is that it is so very common Like basic transportation,everybody uses it in some way or another A report is a piece of art meant to covey a message, but unliketraditional art, that message changes based on the data driving it The potential to help, and be used by,millions of people and companies is one of the reasons I started writing software and eventually joinedMicrosoft No other company can reach out to so many people by making great products accessible
Reporting is a very broad topic covering areas ranging from packing lists and telephone bills to ad hocanalysis and Excel spreadsheets When designing Microsoft SQL Server Reporting Services, I startedwith a simple definition for it: an information delivery platform While this definition is also very broad,
it did allow us to focus on our design, while leaving us significant room to expand in later versions Thisbook will help you understand the power of Reporting Services and to fully utilize its capabilities
Information is not just data; it is data that has been transformed into something meaningful This formation is important Any tool can read and display data; what people really need for doing their jobs
trans-is well-thought-out, correct, and pertinent information There are many tools that let anyone with access
to data build “views” or “reports.” However, often these users are unfamiliar with all of the nuances ofthe data storage and can produce inaccurate results or inadvertently affect the performance of the dataengine Reporting Services acts as the official source so that there is only one version of the truth thateveryone uses
In the future, Microsoft plans to take this even further by integrating with Information Rights Management
so that not only does the information come from a single source, but it is also certified, can expire, and isaccess-controlled even after it is delivered to the end user The data does not always exist in one database
or even come from a database For those of us who have spent careers working with corporate data, this
is a painful truth Very few reports (or sets of reports that give you sufficient insight) come from a singlesource Building some type of data mart or data warehouse is the best solution, but it is not always possibledue to timing, policy, or budgetary constraints Reports must be able to retrieve data from any source andcombine them in a single report
What good is information if you do not have it when you need it? Delivering information is more thanjust processing it and making it available; it is providing information when you need it, in any format,and on any device you have The common case today is the ubiquitous online access via HTML in abrowser This is perfect when you have a computer and connectivity to the server However, as we allknow, nothing is perfect We need the reports when we are on a plane, in a car, with the customer, at thegame, on the production floor, and so on This may include your pager, telephone, fax machine, laptop,paper, and other devices We also need different capabilities: interactivity, pixel perfect printing, integra-tion into applications like MS Excel for “what-if” scenarios and additional analysis, universal access viaPDF, and so on A single format and a single delivery channel is not enough, but how do you knowwhich ones you will need? Reporting Services insulates you from these choices All reports may be dis-tributed in any channel or rendered in any format Report design is independent of how it will be con-sumed It is the responsibility of the system to provide the report as accurately as possible, given theconstraints of the specific format or channel requested
Trang 25Building a platform is very different from building a solution In fact, the goals are in many cases pletely opposed A platform is successful if the developers and administrators have complete access to allaspects of the product They need to be able to optimize, extend, restrict, embed, and replace parts of theproduct to meet their needs This means that all of the APIs are available and documented, all formats areopen and described, and every component is configurable or replaceable While there are always restric-tions due to the many tradeoffs in software design, this was the goal when building Reporting Services.Very much like Windows, SQL Server, or Visual Studio, Reporting Services is designed to enable develop-ers to build on a solid foundation and mold it to meet the business needs in significantly less time and withmore functionality, but without losing the flexibility and power of building it themselves.
com-Looking into the future, there’s an endless list of features and scenarios that Microsoft will add to makethe platform more powerful with little or no additional in-house development required I have men-tioned some, and there are many that haven’t even been considered yet
We look forward to hearing from all of our customers about what is important to them, and how we canmake designing, building, and operating their information delivery systems easier, faster, and (I hope)more fun
Jason Carlson
SQL Server Reporting Services Product, Unit Manager, Microsoft
Jason Carlson is the Product Unit Manager for SQL Server Reporting Services He joined Microsoft in
1996 as a program manager for Visual Source Safe and Repository In 1997, the Repository team joined SQL Server and Jason became the development manager for SQL Server Meta Data Services In 2001,
he built a team and started work on v1 of Reporting Services Before joining Microsoft, Jason owned
and operated an independent software development company This company provided consulting and
vertical software solutions for healthcare and telecommunications.
Trang 26Foreword II
Agility In business today, key decisions must be made daily or weekly rather than monthly or quarterly.Leading companies realize that to increase the speed of competitive response—their corporate agility—they need to delegate as much decision-making authority as possible to employees on the front lines.Real-time bidding systems, reverse auctions, accurate costing on spot production, build-to-order manu-facturing, a worldwide labor force, and globalization are just a handful of the trends in today’s businessclimate that demand better decisions faster
To be successful in this new model, employees need the best quality information they can possibly get.Information must be accurate, timely, and reliable, and it must be the information they need Whetheryour employees are trying to maximize revenues by intelligently attacking new markets or minimizingexpenses through astute purchasing, they absolutely must have the right information at their fingertips
Microsoft’s release of SQL Server Reporting Services marks an important milestone in the world of ness intelligence: information truly accessible to the masses By building reporting functionality directlyinto Microsoft’s Enterprise Data Platform, SQL Server, software developers and information architectscan now count on the availability of a high-quality, scalable, and robust architecture on which to buildtheir reporting systems
busi-For the past 20 years, business intelligence (BI) has been working its way deeper and deeper into theenterprise Previously the domain of a handful of highly skilled analysts high in the corporate ivorytower, BI is now in the hands of line managers, department heads, and knowledge workers at the veryedge of today’s organizations
In the past, dependable reporting systems could be horrendously expensive, with organizations forced
to deploy robust reporting services only where the greatest gains could be realized Microsoft’s standing objective of reducing information technology cost to spur adoption is again evident in the SQLServer Reporting Services licensing model This technology is licensed to anyone currently licensed forSQL Server and so essentially represents no additional cost This is a fantastic development for softwaredevelopers and users alike; it will dramatically increase the adoption and distribution of detailed, accu-rate, and timely reporting and will push quality BI even further down into the enterprise
long-In this excellent book, the authors walk us through SQL Server Reporting Services from the basics ofpractical reporting through deployment and management of reporting solutions written for BI Solutionarchitects, designers, and developers; it is certainly a most valuable resource
David Cunningham
President & CEO, Dundas Software
Dundas Software has provided charting and graphing technology under license to Microsoft for inclusion in SQL Server and 2000 and 2005 Reporting Services Dundas also offers aadditional data visualization charting and gauge extensions for Reporting Services as add-on products.
Trang 28Over the past three years, we’ve been using SQL Server Reporting Services to build reporting, businessintelligence, and decision-support solutions for large and small companies As consultants and instruc-tors, we spend our time in front of many people who need serious solutions to meet business problems
In 2003 and 2004, we wrote the first edition of Professional SQL Server Reporting Services At that time,
I knew that Reporting Services was going to be a big deal and I also knew that writing a book aboutsomething as substantial as this product, wasn’t going to be a walk in the park—so I wanted to workwith a capable, well-rounded team Fortunately, I have had the pleasure of working with some verysmart, hard-working individuals who love technology and solving problems Reporting Services was anew product two years ago so we did a lot of research and learned some lessons along the way Sincethen, we’ve learned even more by putting reporting solutions in front of many business users and con-sulting customers
This book was written to cover the features of SQL Server 2005 Reporting Services Although it doesn’taddress the differences, most of the material may be applied to SQL Server 2000 Reporting Services
What We’ve Learned
I’m not saying that we know absolutely everything there is about this product—we’re learning moreabout it on every project, but we’ve certainly made it our mission to be as versed as possible Please bearwith me as I toot my horn about those with whom I’ve had the pleasure to work alongside For the firstedition of this book, we worked primarily with the beta product We have had many conversations withmembers of the Reporting Services product team at Microsoft as we put the product through its paces
to learn what Reporting Services could and couldn’t do We did our homework, and we wrote about itswonderful capabilities But as with most Microsoft products, we found that there are about 18 differentways to perform each task Since then, we have deployed Reporting Services in dozens of corporateenvironments We’ve helped business users understand their reporting needs and then designed report-ing solutions for many types of organizations We’ve integrated reports into web sites and portals, intranetsites, and desktop applications We’ve trained hundreds of users, developers, and administrators andhave presented at conferences We’ve designed reports for savings and investment banks, support cen-ters, software companies, sales and customer management system vendors, sportswear companies, andtheme park and entertainment companies We’ve learned a lot about how not to design reports and how
to build reporting solutions more efficiently This book is based on this foundation of experience
Who Is This Book For?
There are a number of other books written about Reporting Services Some are for beginners and others forserious developers and advanced report designers Leonard Nimoy’s character Mr Spock once said that
“the needs of the many outweigh the needs of the few.” While this generally may be a true statement,
Trang 29we’ve made it a point to address the needs of the many without sacrificing the needs of the few We wanted
to write a book that would meet the needs of the broad audience of report designers, developers, trators, and business professionals, without sacrificing any content To meet this objective, we’ve dividedthis book into five sections: “mini-books,” if you will Depending upon your needs, you may spend more
adminis-of your time focusing on the material in one adminis-of these sections and using the others for reference This book
is written for the novice report designer and the expert interested in learning to use advanced functionality.For the application developer, we will cover programming in reports and custom applications that inte-grate reports You will also learn about report server administration and security issues
A common practice among development groups at Microsoft is to profile their target users and to evengive these personas names and profiles As we’ve come to know more about the types of folks who useReporting Services in various ways, we thought it might be interesting to do something similar The fol-lowing are descriptions of three fictitious people who are characteristic of the more common ReportingServices users we have worked with See if you can identify with any of these descriptions:
Report Designer
Mary works in the financial group for a company that provides consumer services She is a savvy worker who possesses a wide range of office skills She has worked in this group for several yearsand could easily do her boss’s job She understands her company’s business processes, financial report-ing practices, invoicing, and billing systems She’s not a computer genius but she knows her way aroundword processing, spreadsheets, e-mail, and simple database reporting Mary started using MicrosoftAccess a few years ago and used the wizards to create some simple reports from data exported from the HR and customer billing systems After a while, she learned how to write queries and build Accessreports without the wizards, with custom formatting, groups, and summaries Two years ago, she learned
computer-to use Crystal Reports computer-to report on the data in the company’s data warehouse She has designed severalreports with charts and pivots to analyze sales trends and profitability
Mary’s focus is out-of-the-box reporting, getting reports designed and deployed as easily as possible,using the tools readily available within the product She may design standard server-based reports thatusers will access from a central report server via the corporate intranet She may also want to create herown ad hoc, client-side reports from data models created by an administrator or more advance designer
The following sections of the book will be of most interest to Mary:
Part I: Getting StartedPart II: Report DesignPart III: Enabling End User Reporting with Report Builder
Application Developer
Joe has been writing database applications for several years, starting with small projects in Access andVisual Basic 5.0 In 2001, he began using Microsoft NET programming tools and landed a programmingposition in the company’s Information Technology group Joe has designed many of the company’s websites and portals using the Visual Basic NET and C# programming languages Most of the reports Joehas created were written from scratch as custom web pages He has worked a little with a few special-ized reporting applications He wants to add reporting capabilities to some of the company’s custombusiness applications
Trang 30As far as Joe is concerned, writing simple reports is for others to do His focus will likely be to add ing, custom formatting, and conditional logic using program code and query script He will also designhis reports so that they fit right into applications as an integrated part of a solution He may also want tocreate customized management utilities to automate report server maintenance routines.
filter-Joe understands that Reporting Services offers many flexible options for integrating reports into ent application interfaces He may want to build reports into a custom Windows desktop application,web application, SharePoint Portal or mobile device application
differ-Joe will be most interested in these sections:
Part II: Report DesignPart V: Reporting Services Integration and the Reporting Services Web Services
Systems Engineer
Bob is our Network Engineer and Database Administrator He is more concerned with the security andstability of the corporate servers than with the aesthetics and features of each report He will want tomake sure our report managers, designers, developers, and users, are organized into roles and that thereport server is appropriately secured Bob will install and configure options on the report server Hewill schedule maintenance tasks, optimize the database and queries, and provide ongoing maintenanceand disaster recovery
Bob will find these sections most useful:
Part III: Enabling End User Reporting with Report BuilderPart IV: Report Server Administration
Business Leader
As a business owner, corporate executive or project manager; you may be the consumer of a reportingsolution or the director of the development effort Perhaps you have enlisted the services of a businessintelligence consulting firm to architect a decision-support system to help you run your business Youneed to be informed about your options and understand the capabilities of the products and technolo-gies used to create your solution This book will help you to understand these features and the choicesnecessary to put them into practice The implementers of this solution will look to you for businessrequirements and feature choices Chapters 1, 2, and 3 are a good place to start The first section ofChapter 7 discusses how to define and manage reporting business requirements and specifications This will serve as a communication forum between you and your report designers
What Does This Book Cover?
This book is divided into five sections These include “Introduction,” “Authoring Reports,” “Managing Reports,” “Report Delivery,” and “Advanced Topics,” containing the following chapters.
Trang 31Part I: Getting Started
Chapters 1, 2, and 3 provide an introduction to the capabilities and features of Reporting Services You’lllearn about its extensible architecture, which makes it a very powerful and flexible addition to nearly allexisting business systems This section will build a foundation of understanding upon which you willlearn to design, deploy, manage, and, perhaps, customize business intelligence and reporting solutions
Chapter 1, “What Can You Do with Reporting Services?,” provides a high-level overview of the ties and opportunities to incorporate Reporting Services into your business environment You’ll learnabout general application and reporting technology You’ll earn how to deliver important information ondemand using subscriptions You’ll explore various solution types ranging from out-of-the-box reports
capabili-to simple and advanced application integration
Reports can be server-based or client-side reports embedded into an application Report Builder reportsalso allow nontechnical users to create their own ad hoc reports without installing or learning to use spe-cial software
Chapter 2, “Introduction to Microsoft SQL Reporting Services 2005,” briefly discusses the history ofReporting Services and the architecture upon which it is built You’ll see that this is not just anotherreporting application but a new approach for accessing data and delivering results in a variety of for-mats, using different delivery methods Each report definition is stored as an RDL file; a simple andportable standard XML file, making it easy to deploy a report to any server Reporting Services can becompletely secured Reports may be managed and viewed using the Report Manager web interface ormay be built into custom applications, using the provided ReportViewercontrols or through customrendering Delivery options include scheduled subscriptions Content may be cached to improve perfor-mance and conserve server resources
Chapter 3, “Reporting Services Architecture,” details the mechanics of the Reporting Services ture Reporting Services is implemented as an ASP.NET Web service, which provides a wealth of capabil-ities for enterprise-wide reporting You will explore the different functional areas of Reporting Servicesand how they relate to user and business needs You’ll learn about the platform’s features and thereporting lifecycle—from report design to delivery
architec-Part II: Report Design
Designing reports can be as simple as running a wizard or may be a highly complex development cess to define advanced features In Chapters 4, 5, 6, and 7, you’ll learn about how reports actually pro-cess and render data and then how to use parameters and expressions to define creative report solutions
pro-Chapter 4, “Basic Report Design,” starts with the fundamentals and teaches you to create basic reportsusing simple design tools You’ll learn the essentials about what you need to get started building basicreports using the Report Wizard and common report designer features You’ll be introduced to the fun-damental building blocks of report design: report items and report layout properties
After you explore the basics, you’ll learn about grouping data, lists and data regions, using tables andthe matrix reports, defining drill-through reports, and using charts You’ll also learn to write expressionsand custom code to extend formatting and apply business logic, and to design reports for mobiledevices
Trang 32Chapter 5, “Designing Data Access,” reveals that reports are based on a data source and ReportingServices may be used to present data from many different data sources You’ll learn to define stand-alone and shared data sources, queries and data sets, and use parameters to filter data at the databaseand to filter data at the Report Server You’ll learn to use new parameter features introduced in the latestversion of the product.
This chapter is a primer on Transact-SQL queries and stored procedures You’ll also learn to buildreports using Analysis Services and the MDX Query Builder Query examples are provided for OraclePL/SQL, Sybase, and Access SQL dialects
Chapter 6, “Advanced Report Design,” helps you take design elements to the next level and learn to atively use data groups and combinations of report items Calculations and conditional formatting may
cre-be added by using simple programming code Whether you are an application developer or a reportdesigner, this chapter contains important information to help you design reports to meet your user’srequirements and to raise the bar with compelling report features
Chapter 7, “Report Solution Patterns and Recipes,” takes you into the real world of business problemsand reporting solutions You’ll start by learning how to document business requirements and to managesuccessful report projects
This chapter presents report design from a different view: not the nuts and bolts but the overall pattern
of design We have assembled an extensive list of models and instructions to show you how to build eral detailed report solutions to address a variety of specific business problems This chapter serves as apractical guide to designing reports and building reporting solutions in the real world It contains sev-eral examples of advanced report designs as recipes to solve specific business problems You will applythe techniques you’ve learned in the previous three chapters to implement specific functionality
sev-Part III: Enabling End User Reporting with Report Builder
Report Builder technology puts simple report design into the hands of everyday users without requiringcomplex design tools These two chapters introduce the Report Builder platform and the tools used todefine data sources and semantic metadata models Using the elements you deploy, your users can cre-ate simple reports without installing software or learning the intricacies of report design
Chapter 8, “Reporting Services Report Models,” shows you that a Report Model is the key componentbehind performing ad hoc end user queries A model provides the means to navigate through either aSQL Server database or an Analysis Services database This chapter will teach you to build a ReportingServices Report Model using sample data
Chapter 9, “Report Builder,” covers Report Builder, a platform for defining ad hoc reports using pared data structures You’ll learn to use the Report Builder application with a familiar Microsoft Officeinterface for building reports Using predefined report layouts, users can fulfill various reporting needswith ease You’ll learn to easily format, to sort and filter data, and to perform calculations Finally, you’lllearn how to manage and administer Report Builder models and reports
Trang 33pre-Part IV: Administering Reporting Services
Report server administration has an important job: to keep data secure and available to the right users.Server-side reports can be configured and secured to optimize performance and to provide the rightinformation to the appropriate user communities Chapters 10 and 11 teach you to use all of the toolsnecessary to configure and manage your report server
Chapter 10, “Report Management,” teaches you how to use management tools and Reporting Servicesfeatures to publish reports and manage execution and delivery You’ll learn to create automated scriptsand custom solutions to manage all of the Report Server content You’ll revisit the stages of report execu-tion from an administrator’s point of view and learn how to optimize them You’ll also learn how toautomate report delivery and server management
Chapter 11, “Report Server Administration,” is a comprehensive administrator’s guide You’ll explorethe related considerations for reporting requirements and deployment scenarios for Reporting Services.You’ll learn about the configuration tools and utilities, backup and restore procedures, and monitoring aReporting Services instance for issues and optimal performance
Part V: Reporting Services Integration and the Reporting Services Web Services
Practically all of the built-in functionality in Reporting Services can be automated and preformedthrough custom program code This includes report rendering and the core services of the reportingenvironment: data access, rendering formats, security, and delivery Chapter 12 covers how reports may
be integrated into applications, and Chapter 13 will teach you how to write custom extensions to thestandard features of Reporting Services
Chapter 12, “Integrating Reporting Services into Custom Applications,” shows you that ReportingServices is a flexible reporting tool that can be easily incorporated in different applications In this chap-ter, you’ll learn to use URLs to access reports from document and web page links, use the ReportingServices Web service to programmatically render reports and use the ReportViewercontrols to embedreports into custom Windows forms and ASP.NET web form applications You’ll learn to display reports
in web portals using SharePoint Web Parts and other techniques You can use programmatic rendering,URL or the ReportViewercontrols to create custom report viewers and parameter interfaces Examplesare provided in C# and VB.NET
Chapter 13, “Extending Reporting Services,” shows you that Reporting Services is a robust and scalableproduct for enterprise report processing In this advanced programming tutorial, you will learn to usethis modular and extensible architecture Programming classes, interfaces, and APIs give programmersthe ability to customize, extend, and expand the product to support their enterprise business intelligence(BI) reporting needs This chapter introduces you to most of the areas within Reporting Services thatallow customization and some of the reasons that you may wish to extend the product Developers canextend practically every feature by implementing their own security architecture and add custom dataaccess, rendering formats, and report delivery mechanisms
Chapter 13 is written for serious application developers using object-oriented programming techniques,with examples in C# and VB.NET
Trang 34The appendices at the end of this book include information for migrating Access Reports, a sive Reporting Services object programming reference, Transact-SQL syntax, commands, and functions
comprehen-What You Need to Use This Book
To use SQL Server Reporting Services and to run the samples presented in this book, you will need:
❑ SQL Server 2005, any edition An evaluation version of SQL Server and Reporting Services may
be downloaded from Microsoft at www.microsoft.com/sql
❑ Windows 2000, Windows Server 2003, or Windows XP Professional
❑ Internet Information Services is required to install the Report Server
❑ Pentium II class PC with a 500-MHz processor or better and at least 256 MB of RAM
The complete source code for the samples is available for download from our web site at www.wrox.com For programming examples, there are versions available in both Visual Basic Net and C#
Source Code
As you work through the examples in this book, you may choose either to type all the code manually oruse the source code files that accompany the book All the source code used in this book is available fordownload at www.wrox.com Once at the site, simply locate the book’s title (either by using the Searchbox or by using one of the title lists) and click the Download Code link on the book’s detail page toobtain all the source code for the book
After you download the code, just decompress it with your favorite compression tool Alternatively, youcan go to the main Wrox code download page at www.wrox.com/dynamic/books/download.aspxtosee the code available for this book and all other Wrox books
Errata
We make every effort to ensure that there are no errors in the text or in the code However, no one is fect, and mistakes do occur If you find an error in one of our books, like a spelling mistake or faultypiece of code, we would be very grateful for your feedback By sending in errata you may save anotherreader hours of frustration; at the same time, you will be helping us provide even higher-quality infor-mation
per-To find the errata page for this book, go to www.wrox.comand locate the title using the Search box or one
of the title lists Then, on the book details page, click the Book Errata link On this page, you can view allerrata that has been submitted for this book and posted by Wrox editors A complete book list includinglinks to each book’s errata is also available at www.wrox.com/misc-pages/booklist.shtml
Trang 35If you don’t spot “your” error on the Book Errata page, go to www.wrox.com/contact/techsupport.shtmland complete the form there to send us the error you have found We’ll check the informationand, if appropriate, post a message to the book’s errata page and fix the problem in subsequent editions
of the book
p2p.wrox.com
For author and peer discussion, join the P2P forums at p2p.wrox.com The forums are a web-based tem for you to post messages relating to Wrox books and related technologies and interact with otherreaders and technology users The forums offer a subscription feature to e-mail you topics of interest ofyour choosing when new posts are made to the forums Wrox authors, editors, other industry experts,and your fellow readers are present on these forums
sys-At http://p2p.wrox.comyou will find a number of different forums that will help you not only asyou read this book but also as you develop your own applications To join the forums, just follow thesesteps:
1. Go to p2p.wrox.com, and click the Register link
2. Read the terms of use, and click Agree
3. Complete the required information to join as well as any optional information you wish to vide, and click Submit
pro-4. You will receive an e-mail with information describing how to verify your account and plete the joining process
com-You can read messages in the forums without joining P2P but in order to post your own messages, you must join.
Once you join, you can post new messages and respond to messages other users post You can read sages at any time on the web If you would like to have new messages from a particular forum e-mailed
mes-to you, click the Subscribe mes-to this Forum icon by the forum name in the forum listing
For more information about how to use the Wrox P2P, be sure to read the P2P FAQs for answers to tions about how the forum software works as well as many common questions specific to P2P and Wroxbooks To read the FAQs, click the FAQ link on any P2P page
Trang 36ques-Part I
Getting Star ted
Chapter 1: What Can You Do with Reporting Services?
Chapter 2: Introduction to Microsoft SQL Server Reporting Services
2005
Chapter 3: Reporting Services Architecture
Trang 38What Can You Do with Repor ting Ser vices?
In 2003 and 2004, we wrote the first edition of Professional SQL Server Reporting Services At that time,
I knew that Reporting Services was going to be a big deal, and I also knew that writing a book onsomething as substantial as this product wasn’t going to be a walk in the park — so I wanted to workwith a capable, well-rounded team Fortunately, I have had the pleasure of working with some verysmart, hard-working individuals who love technology and solving problems Reporting Services was
a new product two years ago, so we did a lot of research and learned some lessons along the way.Since then, we’ve learned even more by putting reporting solutions in front of many business usersand consulting customers
What We’ve Learned
I’m not saying that we know absolutely everything there is about this product — we’re learningmore about it on every project, but we’ve certainly made it our mission to be as well versed as pos-sible Please bear with me as I toot my horn about those whom I’ve had the pleasure to workalongside For the first edition of this book, we worked primarily with the beta product We havehad many conversations with members of the Reporting Services product team at Microsoft as weput the product through its paces to learn what Reporting Services could and couldn’t do We didour homework, and we wrote about its wonderful capabilities But as with most Microsoft prod-ucts, we found that there are about 18 different ways to perform each task Since then, we havedeployed Reporting Services in dozens of corporate environments We’ve talked to business users
to understand their reporting needs and then designed reporting solutions for many types of nizations We’ve integrated reports into web sites and portals, intranet sites, and desktop applica-tions We’ve trained hundreds of users, developers, and administrators and have presented atconferences We’ve designed reports for savings and investment banks, support centers, software
Trang 39orga-companies, sales and customer management system vendors, sportswear orga-companies, and theme parkand entertainment companies We’ve learned a lot about how not to design reports and how to buildreporting solutions more efficiently This book is based on this foundation of experience.
Who Uses Reporting Services?
Probably one of the most significant lessons of the past two years spent teaching training courses onReporting Services is how diverse the demographics of the audiences are I’m not talking about age andgender but the roles and backgrounds of those who design and implement reporting solutions As anapplication developer, I was accustomed to teaching programmers and other technology professionalswhose life quest is to make the world a better place by writing software However, I quickly learned thatthere wasn’t a stereotypical report designer Some are very business-focused and aren’t necessarily inlove with technology and program code Many are simply charged with managing or facilitating a line
of business They need tools to get information quickly and don’t want to reinvent the wheel or workwith cumbersome tools The figures in the following table aren’t substantiated by any kind of survey orstudy but are merely my objective observation of those who attend Reporting Services training classes
Approximate Percentage Role
15% System Administrators
30% Software Developers
40% Business Information Workers
Wait a minute! This is a book about creating reports to display information in meaningful and ing ways I can’t just display this information in a boring list, so I’ve created a simple report and put itinto a chart (an exploded, semitransparent doughnut chart to be specific) shown in Figure 1-1
interest-Of those who are working seriously with Reporting Services, have attended classes, or have engagedconsulting services, about one-sixth are nontechnical business managers Members of this role aremainly interested in the bigger picture: how reports can address their analytical needs and help themmake informed decisions These folks have little interest in the implementation details or the technologyused to make it work They direct people who can do the detail work
System administrators consist of server system builders, hardware professionals, and database trators In smaller organizations, this role is often shared with the software developer Administratorsare typically concerned with the setup and ongoing maintenance of servers and the infrastructure tokeep reporting solutions available and working They typically spend their time and energy managingsecurity and optimizing the system for efficiency
adminis-The software developer represents slightly less than one-third of the audience To achieve advanced ing features, software developers will write complex queries and custom programming code to processbusiness rules and give reports conditional formatting and behavior Developers typically feel right athome with the report design environment because it’s very similar to familiar programming tools
Trang 40report-Figure 1-1
The largest group of reporting professionals is not the software developers or other technical experts.They have strong computer user skills, but they don’t spend their time writing code and using tools likeVisual Studio, Enterprise Manager, or SQL Server Management Studio They are regular business userswho need to design reports to run their businesses As a software developer, coming to this realizationwas a wake-up call As I taught Reporting Services 2000 classes for Microsoft, I often spent a large por-tion of the classroom time just teaching students to use the Visual Studio user interface It was new tothem and unlike any other application they were accustomed to Report designers who have been usingother tools such as Crystal Reports, for example, will typically be a little intimidated by the ReportingServices design tools because they may be unfamiliar and may seem to be more “raw” and developer-centric than what they’re used to using In order to take advantage of advanced report capabilities, theseindividuals must either acquire some simple programming skills or work with software developers toadd custom code and expressions to their reports
Application and Repor ting Technolog y
The definition of reporting is changing Like so many components of the computer/information industry,the lines between one thing and another have become very fuzzy This applies to so many concepts in ourindustry For example, many traditional desktop applications now run in a web browser Are these client
or server applications? These days it’s hard to draw a line and categorize a business solution Not longago, if an application opened in a web browser it was considered to be a server-side application — all ofthe processing occurred on a web server Likewise, if an application ran from an icon on your computer, itwas a client-side application, where all of the files and processing occurred on your own computer Haveyou attended an Internet hosted meeting or seminar? If so, you probably navigated to a site in your webbrowser, entered a meeting number, and, magically, you were looking at PowerPoint slides and a demon-stration running on the presenter’s desktop computer Although you may have started from a web page