Tải bản đầy đủ (.pdf) (794 trang)

Addison wesley BIRT a field guide to reporting 2nd edition jul 2008 ISBN 0321580273 pdf

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (10.87 MB, 794 trang )


BIRT: A Field Guide to Reporting
Second Edition


the eclipse series
SERIES EDITORS

Erich Gamma



Lee Nackman



John Wiegand

Eclipse is a universal tool platform, an open extensible integrated development environment (IDE) for anything and nothing in particular. Eclipse represents one of the
most exciting initiatives hatched from the world of application development in a
long time, and it has the considerable support of the leading companies and organizations in the technology sector. Eclipse is gaining widespread acceptance in both
the commercial and academic arenas.
The Eclipse Series from Addison-Wesley is the definitive series of books dedicated
to the Eclipse platform. Books in the series promise to bring you the key technical
information you need to analyze Eclipse, high-quality insight into this powerful
technology, and the practical advice you need to build tools to support this evolutionary Open Source platform. Leading experts Erich Gamma, Lee Nackman, and
John Wiegand are the series editors.

Titles in the Eclipse Series
John Arthorne and Chris Laffra
Official Eclipse 3.0 FAQs


0-321-26838-5
David Carlson
Eclipse Distilled
0-321-28815-7
Eric Clayberg and Dan Rubel
Eclipse: Building Commercial-Quality Plug-Ins, Second Edition
0-321-42672-X
Adrian Colyer, Andy Clement, George Harley, and Matthew Webster
Eclipse AspectJ: Aspect-Oriented Programming with AspectJ and the Eclipse AspectJ Development Tools
0-321-24587-3
Naci Dai, Lawrence Mandel, and Arthur Ryman
Eclipse Web Tools Platform: Developing Java™ Web Applications
0-321-39685-5
Erich Gamma and Kent Beck
Contributing to Eclipse: Principles, Patterns, and Plug-Ins
0-321-20575-8
Jeff McAffer and Jean-Michel Lemieux
Eclipse Rich Client Platform: Designing, Coding, and Packaging Java™ Applications
0-321-33461-2
Diana Peh, Alethea Hannemann, Paul Reeves, and Nola Hague
BIRT: A Field Guide to Reporting
0-321-44259-8
Dave Steinberg, Frank Budinsky, Marcelo Paternostro, Ed Merks
EMF: Eclipse Modeling Framework
0-321-33188-5
Jason Weathersby, Don French,Tom Bondur, Jane Tatchell, and Iana Chatalbasheva
Integrating and Extending BIRT
0-321-44385-3

For more information on books in this series visit www.awprofessional.com/series/eclipse



BIRT: A Field Guide to Reporting
Second Edition

Diana Peh • Nola Hague • Jane Tatchell

Upper Saddle River, NJ • Boston • Indianapolis • San Francisco
New York • Toronto • Montreal • London • Munich • Paris • Madrid
Capetown • Sydney • Tokyo • Singapore • Mexico City


Many of the designations used by manufacturers and sellers to distinguish their
products are claimed as trademarks. Where those designations appear in this book,
and the publisher was aware of a trademark claim, the designations have been
printed with initial capital letters or in all capitals.
The authors and publisher have taken care in the preparation of this book, but make
no expressed or implied warranty of any kind and assume no responsibility for errors
or omissions. No liability is assumed for incidental or consequential damages in
connection with or arising out of the use of the information or programs contained
herein.
The publisher offers excellent discounts on this book when ordered in quantity for
bulk purchases or special sales, which may include electronic versions and/or custom
covers and content particular to your business, training goals, marketing focus, and
branding interests. For more information, please contact:
U.S. Corporate and Government Sales
(800) 382-3419

For sales outside the United States please contact:
International Sales


Visit us on the Web: informit.com/aw
Copyright© 2008 by Actuate Corporation
All rights reserved. This publication is protected by copyright, and permission must
be obtained from the publisher prior to any prohibited reproduction, storage in a
retrieval system, or transmission in any form or by any means, electronic, mechanical,
photocopying, recording, or likewise. For information regarding permissions,
write to:
Pearson Education, Inc.
Rights and Contracts Department
501 Boylston Street, Suite 900
Boston, MA 02116
Fax: (617) 671-3447
ISBN-13: 978-0-321-58027-6
ISBN-10:
0-321-58027-3
Text printed in the United States at OPM in Laflin, Pennsylvania.
First printing, June 2008


Co nten ts

Foreword. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
About this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
Who should read this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
Contents of this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiv
Typographical conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxviii

Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxix


Part I

Installing BIRT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Chapter 1

Prerequisites for BIRT . . . . . . . . . . . . . . . . . . . . . . . . . . .3

Downloading Eclipse BIRT components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
BIRT Report Designer software requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5
About types of BIRT builds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7

Chapter 2

Installing a BIRT Report Designer . . . . . . . . . . . . . . . . . .9

Installing BIRT Report Designer Full Eclipse Install . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9
Installing BIRT RCP Report Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10
Troubleshooting installation problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Avoiding cache conflicts after you install a BIRT report designer . . . . . . . . . . . . . . . .12
Specifying a Java Virtual Machine when starting BIRT report designer . . . . . . . . . . .12
Installing a language pack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13
Updating a BIRT Report Designer installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14
Updating BIRT RCP Report Designer installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15

Part II

Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . 17


Chapter 3

Learning the Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

About BIRT reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19
Overview of the report design process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19

v


About the report design environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Starting BIRT Report Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Report design views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Report editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Palette . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Data Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Library Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Property Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Navigator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Report design files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Report output formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Previewing a report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Viewing sample reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Tutorial 1: Building a simple listing report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Task 1: Create a new project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Task 2: Create a new report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Task 3: Build a data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Task 4: Build a data set. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Task 5: Lay out the report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Task 6: Sort the data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Task 7: Format the report. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Edit the column headings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Format the column headings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Display first and last names on the same line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Increase the space between rows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Task 8: Create a report title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Next steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Chapter 4

Planning Your Report . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

Identifying the content of the report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Determining how the report will be viewed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Considering international reporting requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Deciding the layout and format of the report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Drawing a mock-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Considering reuse of report components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Managing report design resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Deciding how the report will be deployed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Part III

54
55
56
56
58

58
59
59

Accessing and Binding Data . . . . . . . . . . . . . . . 61

Chapter 5

Connecting to a Data Source . . . . . . . . . . . . . . . . . . . . . 63

About BIRT data sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Accessing data using JDBC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a JDBC data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Managing JDBC drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

vi

21
22
24
25
26
26
26
26
26
26
26
27
28

29
30
32
33
34
36
37
39
42
44
44
45
47
49
50
52

Contents

63
64
64
66


Adding a JDBC driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67
Deleting a JDBC driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69
Restoring a JDBC driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69
Accessing data in a text file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .70
Text file structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .70

Text file data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71
Creating a flat file data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .72
Accessing data in an XML file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73
Accessing a web service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .74
Creating reusable data sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76
Creating a connection profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77
Using a connection profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79
Setting connection properties when a report runs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81
Setting the folder path for text files at run time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82
Setting the database user name and password at run time . . . . . . . . . . . . . . . . . . . . .84
Troubleshooting data source problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .87

Chapter 6

Retrieving Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

About data sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89
Selecting data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .90
Using a SQL query to retrieve data from a JDBC data source . . . . . . . . . . . . . . . . . . .90
Writing a basic SQL query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .90
Combining data from multiple tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91
Using a stored procedure to retrieve data from a JDBC data source . . . . . . . . . . . . . .95
Specifying what data to retrieve from a text file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97
Specifying what data to retrieve from an XML data source . . . . . . . . . . . . . . . . . . . . .98
Specifying what data to retrieve from a web service . . . . . . . . . . . . . . . . . . . . . . . . . .102
Viewing and changing output columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Adding a computed field to a data set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Joining data sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Verifying the data returned by a data set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Specifying the data to retrieve at run time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116

About the Query Text property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Specifying a value for the Query Text property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117

Chapter 7

Binding Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .119

Understanding column bindings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Descriptive names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121
Dynamic updates of calculated data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121
Creating column bindings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .122
Editing and deleting column bindings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124
Copying data elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125
More about column-binding expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .126

Part IV
Chapter 8

Designing Reports . . . . . . . . . . . . . . . . . . . . . . . 129
Laying Out a Report . . . . . . . . . . . . . . . . . . . . . . . . . . .131
Contents

vii


Understanding the layout model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
About the report layout elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Overview of the layout process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating the sections of a report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Organizing elements in a grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Adding rows and columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Deleting rows and columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Organizing elements in a table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Deciding where to place elements in a table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Binding a table to a data set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adjusting table rows and columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Organizing elements in a list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Deciding where to place elements in a list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Binding a list to a data set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Placing report elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Placing report elements side by side . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Inserting a data set field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Inserting a computed field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Inserting an image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Resizing an image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Providing a text alternative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Chapter 9

131
133
133
134
134
135
136
136
137
138
140

140
141
142
142
143
144
144
146
152
152

Displaying Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153

Types of textual elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Deciding which textual element to use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using a dynamic text element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using a label element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using a text element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Applying multiple style formats in a text element . . . . . . . . . . . . . . . . . . . . . . . . . . .
Combining a JavaScript expression with static text in a text element . . . . . . . . . . .
Combining a value from a data set field with static text in a text element . . . . . . .
Formatting dynamic values in a text element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Displaying data set field values that are stored as HTML text . . . . . . . . . . . . . . . . .

153
155
158
159
160
160

161
162
162
163

Chapter 10 Formatting Report Content . . . . . . . . . . . . . . . . . . . . 165
Formatting data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Formatting numeric data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Formatting numeric data in a data element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Formatting numeric data in a text element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Formatting date-and-time data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Formatting date-and-time data in a data element . . . . . . . . . . . . . . . . . . . . . . . . .
Formatting date-and-time data in a text element . . . . . . . . . . . . . . . . . . . . . . . . . .
Formatting string data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Formatting text in a data element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Formatting text data in a text element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Formatting with styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Reusing CSS styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

viii

Contents

166
167
167
168
168
169

170
170
170
172
172
172
177


Importing styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .177
Linking a CSS file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .178
Applying a style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .182
Modifying a style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .182
Deleting a style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .182
Formatting data based on conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .182
Creating a formatting rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .183
Modifying a formatting rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .185
Creating multiple formatting rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .186
Deleting a formatting rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .187
Alternating row colors in a table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .187
Specifying alignment of content in a table or grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .190
Aligning text horizontally . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .190
Aligning content vertically . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .191
Adjusting the spacing of content in a report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .191
Resizing rows and columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .194
Resizing margins, borders, and padding of elements . . . . . . . . . . . . . . . . . . . . . . . . .195
Specifying fixed layout for HTML output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .196
Displaying content across multiple columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .199
Specifying alternate values for display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .201
Hiding elements based on conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203


Chapter 11 Sorting and Grouping Data . . . . . . . . . . . . . . . . . . . .207
Sorting data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .208
Ways to sort data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .209
Sorting string data case-insensitively . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Grouping data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .212
Grouping data by intervals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .216
Grouping string data by intervals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .217
Grouping numeric data by intervals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .218
Grouping date-and-time data by intervals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .219
Sorting data at the group level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .220
Creating multiple groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .224
Changing the order of groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .226
Adding group headings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .227
Inserting group header rows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .228
Displaying group headings in the detail row . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .229
Specifying expressions for group headings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .231
Tutorial 2: Grouping report data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Task 1: Open the report design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .232
Task 2: Save the report as a new file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .233
Task 3: Add the credit limit field to the data set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .233
Task 4: Add credit limit data to the report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .234
Task 5: Group customer data by credit limit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .235
Task 6: Display credit limit ranges in the group header . . . . . . . . . . . . . . . . . . . . . . .238
Task 7: Display aggregate information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .239
Display the number of customers in each group . . . . . . . . . . . . . . . . . . . . . . . . . . .239
Display the number of customers in the report . . . . . . . . . . . . . . . . . . . . . . . . . . . .242

Contents


ix


Task 8: Format the report. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Remove credit limit data from the detail rows . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Display group headings on the first row of each group . . . . . . . . . . . . . . . . . . . .
Separate each group with a line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Task 9: Preview the report in the BIRT report viewer. . . . . . . . . . . . . . . . . . . . . . . . .
Task 10: Display credit limit ranges in the table of contents . . . . . . . . . . . . . . . . . . .

246
246
246
247
248
249

Chapter 12 Aggregating Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
Types of aggregate calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Placing aggregate data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating an aggregation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Filtering aggregate data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Excluding null values from an aggregate calculation . . . . . . . . . . . . . . . . . . . . . . . .
Counting rows that contain unique values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Calculating percentages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a summary report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Hiding details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a top n report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

254

257
259
265
266
267
267
271
272
274

Chapter 13 Writing Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Basic concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Case sensitivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Multiline expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the expression builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Manipulating numeric data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Computing values from multiple numeric fields . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Order of precedence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Division by zero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Converting a number to a string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Manipulating string data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Substituting string values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Combining values from multiple fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Removing null values from combined fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Getting parts of a string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Matching string patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using pattern-matching in filter conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using pattern-matching to search for and replace string values . . . . . . . . . . . . .
Converting a string to a number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Manipulating date-and-time data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Displaying the current date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Getting parts of a date or time as a number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Calculating the time between two dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Calculating a date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using Boolean expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

278
278
279
279
279
282
282
282
283
284
284
285
285
286
287
289
291
291
292
292
293
293
293

294
294

Chapter 14 Filtering Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
Filtering opportunities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297

x Contents


Specifying conditions on row retrieval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .298
Filtering database data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .298
Types of SQL filter conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .299
Filtering XML data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .300
Filtering data after row retrieval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .302
Deciding where to filter in BIRT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .303
Types of BIRT filter conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .305
Creating a filter condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .307
Creating multiple filter conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .313

Chapter 15 Enabling the User to Filter Data . . . . . . . . . . . . . . . .315
About report parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .315
Planning to use report parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .317
Ways to enable user filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .317
Enabling the user to filter at query run time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .317
Creating a report parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .318
Inserting a parameter marker in the SQL query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .320
Creating a data set parameter and binding it to the report parameter . . . . . . . . . . .321
Creating a SQL query at run time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .324
Enabling the user to filter after running the query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .325
Creating a report parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .325

Updating a filter condition when the report runs . . . . . . . . . . . . . . . . . . . . . . . . . . . .325
Designing the presentation of report parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .328
Providing a default value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .329
Providing the user with a list of values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .330
Creating a static list of values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .332
Creating a dynamic list of values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .336
Formatting report parameter values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .338
Organizing report parameters in groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .339
Creating cascading report parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .342
Changing the order in which report parameters appear . . . . . . . . . . . . . . . . . . . . . . .348
Testing the report parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .349
Tutorial 3: Creating and using report parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
Task 1: Create a new report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .351
Task 2: Build a data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .351
Task 3: Build a data set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .351
Task 4: Lay out the data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .352
Task 5: Create a report parameter that prompts for a minimum product quantity .353
Task 6: Create a report parameter that prompts for a vendor name . . . . . . . . . . . . .354
Task 7: Edit the query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .358
Task 8: Create data set parameters and bind them to the report parameters . . . . . .359
Task 9: Test the report parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .360
Task 10: Provide the option to select all vendors . . . . . . . . . . . . . . . . . . . . . . . . . . . . .361
Task 11: Create a title that uses the report parameter values . . . . . . . . . . . . . . . . . . .365

Chapter 16 Building a Report That Contains Subreports . . . . .367
Creating the report structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .368

Contents

xi



Building a report with independent subreports . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Building a report with linked subreports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating the structure of a report with linked subreports . . . . . . . . . . . . . . . . . .
Linking master and detail reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Tutorial 4: Building a report containing side-by-side subreports . . . . . . . . . . . . . . . . .
Task 1: Create a new report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Task 2: Build a data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Task 3: Build a data set for the customer report. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Task 4: Build a data set for the orders subreport . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Task 5: Build a data set for the payments subreport . . . . . . . . . . . . . . . . . . . . . . . . . .
Task 6: Create the customer master report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Task 7: Create the orders subreport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Task 8: Link the orders subreport to the customers master report . . . . . . . . . . . . . .
Task 9: Create the payments subreport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Task 10: Link the payments subreport to the customers master report . . . . . . . . . .
Task 11: Display only customers that have orders or payments . . . . . . . . . . . . . . . .
Task 12: Display the subreports next to one another. . . . . . . . . . . . . . . . . . . . . . . . . .
Task 13: View the outline of the report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Task 14: Format the report. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Highlight the customer names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Edit the column headings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Change the date formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Change the number formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Increase the vertical space between elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Increase the horizontal space between the Orders and Payments tables . . . . . .
Add borders around the tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Increase the space between the table borders and contents . . . . . . . . . . . . . . . . .


368
369
370
371
372
374
374
374
376
378
379
382
385
387
388
389
391
392
393
393
393
394
397
398
402
404
405

Chapter 17 Using a Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
Surveying the types of charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

About area charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
About bar charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
About tube, cone, and pyramid charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
About line charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
About meter charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
About pie charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
About scatter charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
About bubble charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
About stock charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
About difference charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
About Gantt charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Tutorial 5: Creating a standalone chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Task 1: Set up and query the data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Task 2: Add the chart to the report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Task 3: Provide data for a chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Task 4: Enlarge the report design and preview the report . . . . . . . . . . . . . . . . . . . . .
Task 5: Change the chart title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Task 6: Refine the chart appearance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Exploring the chart builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
xii

Contents

409
410
410
411
411
412
413

413
414
414
415
415
416
417
418
420
422
424
425
430


Creating a chart with depth or three-dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . .430
Understanding chart output formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .432
Using a chart as part of a report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .433

Chapter 18 Displaying Data in Charts . . . . . . . . . . . . . . . . . . . . .437
Linking a data set to a chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .437
Understanding the axes of a chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .438
About the axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .438
Defining the axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .439
Plotting different chart types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .439
Plotting the x- and y-axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .440
Grouping and sorting category data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .442
Grouping date-and-time data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .444
Grouping textual data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .444
Grouping numeric data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .444

Sorting category data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .445
Grouping optional Y value data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .446
Grouping Y values in a bar chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .446
Grouping multiple y-axis values in a stock chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . .447
Using multiple y-axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .450
Transposing the chart axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .450
Filtering data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .451
Changing default report parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .452
Creating data bindings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .452
Previewing data and chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .453
Creating a combination chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .455
Defining a meter chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .456
Using multiple meters in a chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .456
Using multiple dials in a chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .457

Chapter 19 Laying Out and Formatting a Chart . . . . . . . . . . . . .459
Formatting specific types of charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .460
Formatting an area chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .460
Formatting a line or a scatter chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .461
Formatting a bar chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .462
Formatting a bubble chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .462
Formatting a difference chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .463
Formatting a Gantt chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .464
Formatting a meter chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .465
Working with the dial size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .465
Working with the dial scale and markings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .467
Working with needle settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .467
Arranging multiple meters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .468
Working with meter chart labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .469
Working with dial regions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .469

Formatting a pie chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .470
Working with leader lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .471
Working with pie sectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .471

Contents

xiii


Exploding sectors of a pie chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Arranging multiple pies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Formatting a stock chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Formatting a three-dimensional chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Working with chart rotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Working with the space between elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting the wall or floor color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting the series depth of a chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Laying out and formatting the chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting the background color for a chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Outlining a chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adding padding around the chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Formatting numbers, dates, and times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Formatting the chart legend, plot, and title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Working with the plot area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting the color, outline, or shadow for the plot . . . . . . . . . . . . . . . . . . . . . . . . . .
Placing and adding space around the plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Specifying the plot size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Formatting the chart title text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Formatting the title area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Working with the legend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Setting the color, outline, or shadow for the legend . . . . . . . . . . . . . . . . . . . . . . .
Placing and adding space around a legend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Showing series item values in a legend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Formatting the legend text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adding a legend title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Formatting axis titles, markers, lines, and labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Working with an axis title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Working with axis markers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adding an axis marker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Formatting axis markers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Working with an axis line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Working with axis labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Defining the axis data type and number format . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Defining where one axis intersects the other . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Defining the scale of an axis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Formatting a series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Stacking series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Hiding a series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Making a series translucent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting the color palette for a series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Working with data points and data point labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adding and formatting a curve-fitting line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

472
473
473
474
474
476
476

477
477
478
480
480
482
485
487
487
488
488
490
491
493
493
494
495
495
495
496
496
497
498
499
499
501
503
504
505
507

507
507
507
508
510
511

Chapter 20 Presenting Data in a Cross Tab . . . . . . . . . . . . . . . . . 515
Tutorial 6: Creating a cross tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
Task 1: Create a new report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
Task 2: Build a data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517

xiv

Contents


Task 3: Build a data set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .517
Task 4: Add a cross tab to the report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .519
Task 5: Organize data for the cross tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .520
Task 6: Insert data in the cross tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .522
Task 7: Add grand totals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .523
Task 8: Format the cross tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .525
Display a string in empty cells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .526
Change the format of the numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .527
Edit the column headings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .529
Use darker lines around the cross tab and the cells . . . . . . . . . . . . . . . . . . . . . . . . .530
Understanding cube terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .532
Setting up data for a cross tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .533
About cubes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .533

Planning the data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .534
Designing the cube . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .535
Designing data sets for a cube . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .535
Comparing OLTP and OLAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .536
Designing a single data set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .537
Designing multiple data sets in a star schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . .538
Building a multi-dataset cube . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .538
Building a cross tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .543
Areas of a cross tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .543
Displaying multiple dimensions in row and column areas . . . . . . . . . . . . . . . . . . . .544
Displaying or hiding dimension levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .546
Displaying multiple measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .547
Adding subtotals and grand totals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .549
Displaying user-defined values in row and column headings . . . . . . . . . . . . . . . . . .551
Sorting cross tab data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .553
Limiting the amount of data the cross tab displays . . . . . . . . . . . . . . . . . . . . . . . . . . .556

Part V

Enhancing Reports . . . . . . . . . . . . . . . . . . . . . . . 557

Chapter 21 Designing a Multipage Report . . . . . . . . . . . . . . . . . .559
Planning the page layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .559
Controlling pagination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .560
Inserting page breaks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .560
Inserting page breaks in a report with multiple sections and groups . . . . . . . . .561
Inserting page breaks in a master-detail report . . . . . . . . . . . . . . . . . . . . . . . . . . . .563
Specifying the number of rows per page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .565
Customizing the master page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .566
Viewing the master page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .566

Designing the page header and footer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .567
Displaying page numbers, the current date, and other text . . . . . . . . . . . . . . . . . .567
Displaying an image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .569
Specifying a header size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .569
Specifying a footer size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .570
Excluding header content from the first page . . . . . . . . . . . . . . . . . . . . . . . . . . . . .570
Displaying an image in the background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .572

Contents

xv


Designing the appearance of the background image . . . . . . . . . . . . . . . . . . . . . .
Positioning the background image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Displaying different content in different output formats . . . . . . . . . . . . . . . . . . . . .
Specifying page size, orientation, and margins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using multiple master pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

573
574
575
576
577

Chapter 22 Adding Interactive Viewing Features . . . . . . . . . . . . 581
Creating hyperlinks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Linking two sections in a report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Defining a bookmark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Defining a hyperlink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Linking to a section in a different report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Linking to external content using a URI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a table of contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the default table of contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Defining a custom table of contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adding interactive chart features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Defining interactivity events and actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chart formats and supported actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adding interactive elements to an HTML report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Identifying report elements for data export . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

581
583
583
584
587
589
591
591
592
594
596
598
598
600

Chapter 23 Building a Shared Report Development
Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
Comparing report designs, libraries, and templates . . . . . . . . . . . . . . . . . . . . . . . . . . . .
About the report design file type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

About the library file type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
About the template file type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Sharing report elements in a library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Dynamic library behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Sharing styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Comparing themes and CSS files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using a style from a theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Designing multiple themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Understanding library name space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Designing libraries for a shared environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Defining a general library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Defining a structures library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Defining a project library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Understanding the resource folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using a library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Accessing report elements from a library in a report design . . . . . . . . . . . . . . . .
Making local changes to a library element in a report design . . . . . . . . . . . . . . .
Using themes and styles from a library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Sharing a report layout as a template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Developing a custom template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Designing template report items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

xvi

Contents

604
604
605

605
606
608
609
609
609
610
611
611
612
612
613
614
616
617
618
618
620
622
623
625


Registering a template with the New Report wizard . . . . . . . . . . . . . . . . . . . . . . .626
Using a custom template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .627

Chapter 24 Localizing Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .629
Overview of the localization process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .630
Assigning a resource file to a report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .631
Assigning a resource key to a label or text element . . . . . . . . . . . . . . . . . . . . . . . . . . . . .633

Changing localized text in a label or text element to static text . . . . . . . . . . . . . . . . . . .634
Assigning a resource key to chart text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .635
Changing localized chart text to static text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .636
Assigning a resource key to a value in a data element . . . . . . . . . . . . . . . . . . . . . . . . . . .637
Assigning a resource key to a report parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .639
Editing a resource file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .641
Previewing a report in different locales . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .642

Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .645
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .707

Contents

xvii


This page intentionally left blank


F or ew o r d

Application development tools and technology have come a long way since
the late 1970s, when I took my first job out of college in Hewlett-Packard
Company’s IT (Information Technology) department. Of course, IT was not
the term we used to refer to the discipline back then; our preferred acronym
was EDP (Electronic Data Processing).
And maybe that difference between simply “processing” data and delivering
“information” was reflected in our development tools. We worked on TTY
terminals connected to 16-bit mini-computers over 2400 baud lines. We used
simple line editors to make changes to our COBOL programs, and we kept

our application data in non-relational hierarchical databases. Debugging was
COBOL WRITE statements, and source code control was keeping full copies
of every version on tape or in separate directories.
Reports for our applications were typically afterthoughts, and they were
done by hand in the same technology we used to develop the base
application, i.e., COBOL. We designed them—when we did design—by
laying them out in pencil on the report design pads that IBM had developed
for RPG and COBOL programmers. Because we created them without much
forethought, and because junior programmers like me often got the
assignment of coding them, our users often found them inadequate, and the
cost of making changes to accommodate their true requirements was high.
But while today’s application developer may scratch his or her head in
wonder at the primitive tools and technologies we employed in building our
base applications in the late 1970s, he or she may not find my description of
our approach to report development so very unfamiliar.

JSP = COBOL and Banded Report Writers = Report Design Pads
The majority of Java developers still hand-code reports for their applications
using JavaServer Page (JSP) technology. This is analogous to our approach of
hand-coding them in COBOL and has all the same downsides: high
development cost, low user satisfaction, and inflexible, high-cost
maintenance.
A minority of Java developers do use tools to develop reports; however,
almost all of these tools—be they commercial or open source—are what’s

xix


known as “banded report writers,” and they support a design metaphor that
has essentially evolved from the old IBM report pads. Each section in the

report writer—header, detail, footer—corresponds to a section in the report
with the detail sections repeating as needed to accommodate rows from the
data source.
Because they were created before the advent of the internet, banded report
writers are not intuitive to web application developers, who are most
comfortable with the web page-oriented design metaphor that one finds in
modern graphical web development tools. In addition, web concepts—such
as tables, graphical object containment and inheritance, cascading style
sheets (CSS), and scripting in web-oriented languages like Java and
JavaScript—are not supported.

Enter BIRT
The Eclipse Foundation’s Business Intelligence and Reporting Tools (BIRT)
project takes report development into the age of the internet. Based on
industry-leading Eclipse IDE and Rich Client Platform (RCP) technology,
BIRT was built from the ground up for web applications.
As Senior Vice President of Engineering for Actuate Corporation, I’m proud
of the leading role my company has played in the project. We’ve leveraged
our 14+ years of experience in the reporting and business intelligence space
and put to work a significant number of full-time developers (or
“committers,” in Eclipse Foundation parlance) on the development of the
platform. In fact, Ohloh, the open source rating website, calculates that it
would cost over $21M to hire a team to write the project from scratch. But
more important than the investment is the result: BIRT is an extensible, fullfeatured reporting platform that is ready for use in and integration with
production applications.
An impressive list of commercial adopters justifies this claim. BIRT is used
extensively in IBM’s Rational and Tivoli product lines, in Borland’s Silk and
Together product lines, in BEA’s AquaLogic product line, in the Zend
Platform to enable reporting in PHP, by Compuware and by SPSS. Likewise,
enterprise IT developers and system integrators have embraced BIRT and are

using it in important business applications.
All of these constituencies—ISVs, IT, and SI developers—contribute to the
Eclipse Foundation BIRT community, which is a vibrant one. The BIRT
newsgroup is especially active and BIRT is one of the most searched-for
terms on the Eclipse website. Feedback from the community has helped to
drive project priorities, give direction on feature implementation, uncover
defects, and once in a while, deliver some “attaboys” to the project team.
Here are just a few comments posted by developers in the Eclipse BIRT
newsgroup:
“I had installed BIRT the other day just to check it out and barely went through
the introductory tutorial. Today I was able to drag and drop my way to replacing
a broken report (600 lines of somebody else’s perl) and all I can really say is it was
almost too easy.”
xx

Foreword


“I've gotten through what I think is a complex development and I'm impressed
with exactly how much BIRT can do.”
“BIRT is an inspiring piece of work that I chose over Crystal Reports.”
“I find BIRT much easier to use and customize than JasperReports/iReport.”
“I think BIRT is one of the best reporting tools today.”
“Lots of credit to the BIRT crosstab team. The crosstab feature looks great.”
“I will recommend BIRT and its community for other people.”
“We love BIRT.”
I hope that you will leverage the information in this book to become a
successful member of the BIRT community as well. And, in the off chance
that you are standing in a bookstore aisle, having picked up this book with no
idea what BIRT is all about, may I suggest that you rush home—after buying

the book, of course—and download the software from the Eclipse BIRT
website:
/>
Take it from me—it’s the best way to prevent yourself from being lumped
into the same category as 1970s COBOL programmers!
Mark Coggins
Senior Vice President of Engineering, Actuate Corporation

Foreword

xxi


This page intentionally left blank


P re fa ce

About this book
BIRT is a powerful reporting platform that provides end-to-end reporting
solutions, from creating and deploying reports to integrating report
capabilities into other enterprise applications. Two companion books, BIRT: A
Field Guide to Reporting and Integrating and Extending BIRT, cover the breadth
and depth of BIRT’s functionality.
Using BIRT Report Designer’s rich set of tools, report developers can create
many reports, simple and sophisticated, without programming. This book
teaches report developers how to create reports using the graphical tools of
BIRT Report Designer. Report developers who want to go beyond the
graphical tools to customize the report-generation process or incorporate
complex business logic in their reports should read the second book,

Integrating and Extending BIRT.
This second edition, newly revised for BIRT 2.2.1, adds updated examples
and covers all the new and improved product features, including cross tabs
and OLAP cubes, new chart types, web services as a new data source, new
report output formats, the capability for reports to reference Cascading Style
Sheets, and the localization of report parameter and data values.

Who should read this book
This book is intended for people who have a basic need for reporting. You
need not be an expert at creating reports nor do you need years of
programming experience. Familiarity with the following subjects, however,
is useful:


HTML, for formatting report content



SQL, for writing basic queries to extract data from a database for a report



JavaScript, for writing basic expressions to manipulate data in the report

xxiii


This book provides many examples of formatting with HTML, and writing SQL
queries and JavaScript expressions, but it is not designed to teach you HTML,
SQL, or JavaScript.


Contents of this book
This book is divided into several parts. The following sections describe the
contents of each of the parts.

Part I, Installing BIRT
Part I introduces the currently available BIRT reporting packages, the
prerequisites for installation, and the steps to install and update the packages.
Part I includes the following chapters:


Chapter 1, Prerequisites for BIRT. BIRT provides a number of separate
packages for BIRT Report Designer as downloadable archive (.zip) files on
the Eclipse web site. Two of the packages are stand-alone modules and
another requires an existing Eclipse environment. This chapter describes the
prerequisites for each of the available report designer packages.



Chapter 2, Installing a BIRT Report Designer. BIRT provides two report
designers as separate packages, which are downloadable archive (.zip) files
on the Eclipse web site. This chapter describes the steps required to install
and update each of the available report designers. The chapter also shows
how to troubleshoot installation problems and install a language pack that
provides localization support.

Part II, Getting Started
Part II provides an overview of the report creation process and introduces the
report design environment. Part II includes the following chapters:



Chapter 3, Learning the Basics. This chapter presents fundamental concepts of
reporting and provides a tutorial. Report developers learn that the report
design process begins with a paper and pencil sketch of the proposed report
layout and continues through specifying data, laying out the report,
formatting, previewing, and testing. In addition, this chapter orients the
reader to the software. To accomplish that objective, the chapter provides a
tutorial that walks the reader through a creation of a complete report.



Chapter 4, Planning Your Report. This chapter explains the planning process in
greater detail. Planning is essential to creating effective and efficient reports.
A thorough understanding of user requirements and objectives makes the
development process smoother and achieves better results. This chapter
discusses the types of requirements and other information that a report
developer should consider when determining how to set up, format, and
distribute a report.

xxiv P r e f a c e


×