Tài liệu Apress - Pro SQL Server 2008 Reporting Services (2008)01 doc

40 452 1
Tài liệu Apress - Pro SQL Server 2008 Reporting Services (2008)01 doc

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

this print for content only—size & color not accurate spine = 0.8052" 424 page count Books for professionals By professionals ® Pro SQL Server 2008 Reporting Services Dear Reader, SQL Services 2008 Reporting Services (SSRS) is the latest version of a technology that has grown in both popularity and features in the years since its introduction in SQL Server 2000. As DBAs, report designers, and .NET developers, we each have pushed all versions to the very limit. Because we have worked so closely with SSRS over the years and continue to do so in our day-to-day businesses, we were anxious to learn about the updated features promised in SQL Server 2008 Reporting Services. Now we want to pass on what we have learned to you, our readers. Reporting Services in SQL Server 2008 brings a plethora of new and exciting features to the table. One of the most anticipated new features is the Microsoft Word rendering capability. We certainly look forward to harnessing the power of Word to format the reports we give our clients. Those who work in enterprise environments will appreciate the performance enhancements brought about by severing the former tie between Reporting Services and Internet Information Server. Still others will be very pleased at the new ability to use rich text in sup- port of mail merge form letters. And there are the new Tablix properties, which combine the best of the Matrix and Table report objects. New features abound in SQL Server 2008 Reporting Services, and we hope you’ll be as eager to learn about them as we were. You will find all the new features just mentioned, and more besides, described in this, the third edition of a book we have been especially fond of writing. It is our hope—as with the first two editions—that you are able to utilize the real-world approach of this book to produce and deliver professional quality reports. Cheers, Rodney Landrum, Shawn McGehee, and Walter J. Voytek III US $39.99 Shelve in Databases/SQL Server User level: Intermediate–Advanced Landrum, McGehee, Voytek III Pro SQL Server 2008 Reporting Services The eXperT’s Voice ® in sQl serVer Pro SQL Server 2008 Reporting Services cyan MaGenTa yelloW Black panTone 123 c Rodney Landrum, Shawn McGehee, and Walter J. Voytek III Companion eBook Available THE APRESS ROADMAP Beginning SQL Server 2008 Express Edition Beginning SQL Server 2008 for Developers Pro T-SQL 2008 Programmer’s Guide Beginning SQL Queries Pro SQL Server 2008 Reporting Services Beginning Database Design www.apress.com SOURCE CODE ONLINE Companion eBook See last page for details on $10 eBook version ISBN-13: 978-1-59059-992-1 ISBN-10: 1-59059-992-6 9 781590 599921 5 3 9 9 9 A step-by-step guide to creating effective business reports using Microsoft’s powerful new reporting technology Rodney Landrum Shawn McGehee Walter J. Voytek III Rodney Landrum and Walter J. Voytek III, coauthors of Pro SQL Server 2000 Reporting Services Pro SQL Server 2005 Reporting Services Pro SQL Server 2008 Reporting Services ■■■ Rodney Landrum, Shawn McGehee, and Walter J. Voytek III Landrum_992-6 FRONT.fm Page i Friday, August 1, 2008 3:53 PM Pro SQL Server 2008 Reporting Services Copyright © 2008 by Rodney Landrum, Shawn McGehee, and Walter J. Voytek III All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN-13 (pbk): 978-1-59059-992-1 ISBN-10 (pbk): 1-59059-992-6 ISBN-13 (electronic): 978-1-4302-0652-1 Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1 Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. Lead Editor: Jonathan Gennick Technical Reviewer: Fabio Claudio Ferracchiati Editorial Board: Clay Andres, Steve Anglin, Ewan Buckingham, Tony Campbell, Gary Cornell, Jonathan Gennick, Matthew Moodie, Joseph Ottinger, Jeffrey Pepper, Frank Pohlmann, Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh Project Manager: Sofia Marchant Copy Editor: Ami Knox Associate Production Director: Kari Brooks-Copony Production Editors: Laura Cheu, Kelly Gunther Compositor: Susan Glinert Stevens Proofreader: Liz Welch Indexer: Broccoli Information Management Artist: Dina Quan Cover Designer: Kurt Krames Manufacturing Director: Tom Debolski Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail orders-ny@springer-sbm.com, or visit http://www.springeronline.com. For information on translations, please contact Apress directly at 2855 Telegraph Avenue, Suite 600, Berkeley, CA 94705. Phone 510-549-5930, fax 510-549-5939, e-mail info@apress.com, or visit http:// www.apress.com. Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Special Bulk Sales–eBook Licensing web page at http://www.apress.com/info/bulksales. The information in this book is distributed on an “as is” basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work. The source code for this book is available to readers at http://www.apress.com. Landrum_992-6 FRONT.fm Page ii Friday, August 1, 2008 3:53 PM This book is dedicated to the memory of John Baumann Landrum_992-6 FRONT.fm Page iii Friday, August 1, 2008 3:53 PM Landrum_992-6 FRONT.fm Page iv Friday, August 1, 2008 3:53 PM v Contents at a Glance About the Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii About the Technical Reviewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix ■ CHAPTER 1 Introducing the Reporting Services Architecture . . . . . . . . . . . . . . . . 1 ■ CHAPTER 2 Report Authoring: Designing Efficient Queries . . . . . . . . . . . . . . . . . 17 ■ CHAPTER 3 Introduction to Reporting Services Design . . . . . . . . . . . . . . . . . . . . . 35 ■ CHAPTER 4 Building Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 ■ CHAPTER 5 Using Custom .NET Code with Reports . . . . . . . . . . . . . . . . . . . . . . . 143 ■ CHAPTER 6 Rendering Reports from .NET Applications . . . . . . . . . . . . . . . . . . . 167 ■ CHAPTER 7 Deploying Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201 ■ CHAPTER 8 Managing Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 ■ CHAPTER 9 Securing Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273 ■ CHAPTER 10 Delivering Business Intelligence with SSRS . . . . . . . . . . . . . . . . . . 307 ■ CHAPTER 11 Creating Reports Using Report Builder 1.0 and 2.0 . . . . . . . . . . . . 337 ■ INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391 Landrum_992-6 FRONT.fm Page v Friday, August 1, 2008 3:53 PM Landrum_992-6 FRONT.fm Page vi Friday, August 1, 2008 3:53 PM vii Contents About the Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii About the Technical Reviewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix ■ CHAPTER 1 Introducing the Reporting Services Architecture . . . . . . . . . 1 Understanding the Benefits of SSRS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 SQL Server 2008 Reporting Services Enhancements . . . . . . . . . . . . . 5 SSRS and Business Intelligence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Exploring the SSRS Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 SSRS Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 The SSRS Report Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Client Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Installing and Configuring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Deploying SSRS Securely . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 ■ CHAPTER 2 Report Authoring: Designing Efficient Queries . . . . . . . . . . . 17 Introducing the Sample Relational Database . . . . . . . . . . . . . . . . . . . . . . . 18 Introducing the Schema Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Knowing Your Data: A Quick Trick with a Small Procedure . . . . . . . 19 Introducing Query Design Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Creating a Simple Query Graphically . . . . . . . . . . . . . . . . . . . . . . . . . 21 Creating an Advanced Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Using a Parameterized Stored Procedure . . . . . . . . . . . . . . . . . . . . . . . . . 29 Using Case and ISNULL to Evaluate the Parameters . . . . . . . . . . . . 32 Testing the Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Landrum_992-6 FRONT.fm Page vii Friday, August 1, 2008 3:53 PM viii ■ CONTENTS ■ CHAPTER 3 Introduction to Reporting Services Design . . . . . . . . . . . . . . . 35 Exploring the Elements of BIDS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Setting Up a Basic IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Understanding Report Definition Language (RDL) . . . . . . . . . . . . . . . 39 Adding a Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Setting Up Data Sources and Datasets . . . . . . . . . . . . . . . . . . . . . . . 41 Setting Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Setting Up Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Laying Out a Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 Setting Up Pagination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 Using Report Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 ■ CHAPTER 4 Building Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Creating a Report with the Report Wizard . . . . . . . . . . . . . . . . . . . . . . . . . 86 Building Reports from Scratch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 Formatting the Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 Adding Subtotals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 Adding Interactivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 Setting Report Parameters with Stored Procedures . . . . . . . . . . . . . . . . 117 Working with Multivalued Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Applying a Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 Adding a Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 Adding Tablix Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 Report and Group Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 Adding the New Gauge Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 Adding the Final Touches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 ■ CHAPTER 5 Using Custom .NET Code with Reports . . . . . . . . . . . . . . . . . . 143 Using Embedded Code in Your Report . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 Using the ExceedMaxVisits Function . . . . . . . . . . . . . . . . . . . . . . . . 145 Using the ExceedMaxVisits Function in a Report . . . . . . . . . . . . . . 148 Accessing .NET Assemblies from Embedded Code . . . . . . . . . . . . 151 Landrum_992-6 FRONT.fm Page viii Friday, August 1, 2008 3:53 PM [...]... components of SQL Server 2008, including SQL Server Integration Services (SSIS), SQL Server Analysis Services (SSAS), and of course SSRS We will use BIDS throughout the book to show how to design and deploy SSRS reports and Analysis Services projects SQL Server Management Studio (SSMS) With SQL Server 2008, Microsoft continues to build on its management platform with SQL Server Management Studio (SSMS) Microsoft... stored procedures, and NET application projects, as well as full installation instructions, in the Source Code/Download section of the Apress Web site (http://www .apress. com) Landrum_99 2-6 C01.fm Page 1 Tuesday, July 22, 2008 2:17 PM CHAPTER 1 ■■■ Introducing the Reporting Services Architecture W hen Microsoft announced in 2003 that it was going to release SQL Server Reporting Services (SSRS) as a SQL Server. .. Landrum_99 2-6 FRONT.fm Page xii Friday, August 1, 2008 3:53 PM Landrum_99 2-6 FRONT.fm Page xiii Friday, August 1, 2008 3:53 PM About the Authors ■ RODNEY LANDRUM is a senior SQL Server DBA and author living in Pensacola, Florida He writes regularly for SQL Server Magazine, Simple Talk (http://www.simple-talk.com), and SQLServerCentral.com When not writing T -SQL queries or covering his geek arm with SQL and... be located on the same SQL Server, assuming the data source is a SQL Server database The data source can be any supported data provider, such as SQL Server, Oracle, Lightweight Directory Access Protocol (LDAP), or Analysis Services It’s possible to configure a single server to act as both the SSRS report server web service and report server database as well as the data source server However, this isn’t... overall reporting solution Landrum_99 2-6 C01.fm Page 7 Tuesday, July 22, 2008 2:17 PM CHAPTER 1 ■ INTRODUCING THE REPORTING SERVICE S A RCHITEC TURE Business Intelligence Development Studio (BIDS) BIDS is a limited version of Visual Studio 2008 that is included with the SQL Server 2008 base installation With BIDS, developers can create entire projects for each of the supported components of SQL Server 2008, ... features in the next section and in detail throughout the book Landrum_99 2-6 C01.fm Page 5 Tuesday, July 22, 2008 2:17 PM CHAPTER 1 ■ INTRODUCING THE REPORTING SERVICE S A RCHITEC TURE SQL Server 2008 Reporting Services Enhancements The following are the most significant enhancements made to the SSRS technology in SQL Server 2008 Report Builder/Data Modeler The Report Builder application, a feature... tools that in previous versions of SQL Server would have been executed individually SSMS replaces Enterprise Manager and Query Analyzer, offering a much more elaborate set of tools for creating and managing SQL Server objects and queries In addition to managing SQL Server and Analysis Services servers, administrators can use SSMS to manage instances of their SSRS reporting servers We will show how to use... enhancements that have been incorporated into the long-awaited release of SQL Server 2008 SSRS has taken its place as a key component in the latest release of SQL Server and can no longer be thought of as just an add-on The new features in SSRS 2008 push the technology one step further into becoming the reporting development environment of choice for programmers and designers, especially those who are... an integral part of SQL Server 2008 and is available in many editions, from Express to Enterprise When you purchase SQL Server, you get SSRS as well Web-enabled: Because SSRS is a Web-based reporting solution, a single deployed report is accessible to a variety of clients, from the browser to custom Windows Forms Also, because reports are primarily accessed via Hypertext Transfer Protocol (HTTP) or... SQL Server 2008 version of SSRS, including Tablix properties, rich text support with HTML tags, and an entire chapter devoted to ad hoc or user-developed reporting with Report Builder 1.0 and Report Builder 2.0 In addition, we will cover SharePoint integration with SSRS, not just with SharePoint Report Viewer Web Parts, but also with a full-blown SharePoint deployment The following is a chapter-by-chapter . owner and the publisher. ISBN-13 (pbk): 97 8-1 -5 905 9-9 9 2-1 ISBN-10 (pbk): 1-5 905 9-9 9 2-6 ISBN-13 (electronic): 97 8-1 -4 30 2-0 65 2-1 Printed and bound in the. THE APRESS ROADMAP Beginning SQL Server 2008 Express Edition Beginning SQL Server 2008 for Developers Pro T -SQL 2008 Programmer’s Guide Beginning SQL Queries

Ngày đăng: 17/12/2013, 02:15

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan