Birt a field guide to reporting 1st edition diana peh all chapter instant download

Page 1


https://ebookgate.com/product/birt-a-field-guideto-reporting-1st-edition-diana-peh/

More products digital (pdf, epub, mobi) instant download maybe you interests ...

A Field Guide to Otherkin First Edition Lupa

https://ebookgate.com/product/a-field-guide-to-otherkin-firstedition-lupa/

Green A Field Guide to Marijuana 1st Edition Dan

Michaels

https://ebookgate.com/product/green-a-field-guide-tomarijuana-1st-edition-dan-michaels/

A Field Guide to Conservation Finance 1st Edition Story

Clark

https://ebookgate.com/product/a-field-guide-to-conservationfinance-1st-edition-story-clark/

Field Guide to Illumination SPIE Field Guide Series

Angelo V. Arecchi

https://ebookgate.com/product/field-guide-to-illumination-spiefield-guide-series-angelo-v-arecchi/

Field Guide to Diffractive Optics SPIE Field Guide Vol FG21 Yakov Soskind

https://ebookgate.com/product/field-guide-to-diffractive-opticsspie-field-guide-vol-fg21-yakov-soskind/

Energy Assessment and Reporting Methodology 2nd ed Edition Field

https://ebookgate.com/product/energy-assessment-and-reportingmethodology-2nd-ed-edition-field/

Clinical Trials A Practical Guide to Design Analysis and Reporting 1st Edition Duolao Wang

https://ebookgate.com/product/clinical-trials-a-practical-guideto-design-analysis-and-reporting-1st-edition-duolao-wang/

A Field Guide to the Mammals of Egypt Richard Hoath

https://ebookgate.com/product/a-field-guide-to-the-mammals-ofegypt-richard-hoath/

Field Guide to Finding a New Career in Health Care

Field Guides to Finding a New Career 1st Edition S. J. Stratford

https://ebookgate.com/product/field-guide-to-finding-a-newcareer-in-health-care-field-guides-to-finding-a-new-career-1stedition-s-j-stratford/

BIRT:AFieldGuidetoReporting

This page intentionally left blank

BIRT:AFieldGuidetoReporting

DianaPeh•AletheaHannemann•NolaHague

UpperSaddleRiver,NJ•Boston•Indianapolis•SanFrancisco NewYork•Toronto•Montreal•London•Munich•Paris•Madrid Capetown•Sydney•Tokyo•Singapore•MexicoCity

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 corpsales@pearsontechgroup.com

For sales outside the United States please contact: International Sales international@pearsoned.com

Visit us on the Web: www.awprofessional.com

ThisBookIsSafariEnabled

The Safari® Enabled icon on the cover of your favorite technology book means the book is available through Safari Bookshelf. When you buy this book, you get free access to the online edition for 45 days.

Safari Bookshelf is an electronic reference library that lets you easily search thousands of technical books, find code samples, download chapters, and access technical information whenever and wherever you needit.

To gain 45-day Safari Enabled access to this book:

■ Go to http://www.awprofessional.com/safarienabled

■ Complete the brief registration form

If you have difficulty registering on Safari Bookshelf or accessing the online edition, please e-mail customer-service@safaribooksonline.com.

Library of Congress Cataloging-in-Publication Data

BIRT, a field guide to reporting / Diana Peh ... [et al.]. p. cm.

Includes index.

ISBN 0-321-44259-8 (pbk. : alk. paper)

1.Computer software--Development.2.Application software--Development.3.Client/server computing.I.Peh, Diana.

QA76.76.D47B57 2006 005.1—dc22

Copyright © 2006 Actuate Corporation

2006013999

All rights reserved. Printed in the United States of America. 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

75 Arlington Street, Suite 300 Boston, MA 02116

Fax: (617) 848-7047

ISBN 0-321-44259-8

Text printed in the United States on recycled paper at R.R. Donnelley in Crawfordsville, Indiana. First printing, October 2006

Foreword

Preface.

About this book

Who should read this book

Contents of this book

Typographical conventions

Avoiding cache conflicts after you install a BIRT report designer

Specifying which Java Virtual Machine (JVM) to use when you start a BIRT report designer

Task 2: Create a new report.

Task

Task 4: Build a data set.

Task 5: Lay out the report

Task 6: Sort the

Task 7: Format the report.

Edit the column headings

Format the column headings

Display first and last names on

Deciding

Drawing

Deciding

Accessing data using JDBC

Preparing to access a database

Creating a JDBC data source

Managing JDBC drivers

Adding a JDBC driver

Deleting a JDBC driver

Restoring JDBC drivers

Accessing data in text files

Preparing to access your text file

Text file rules

Text file data types

Accessing XML data

Preparing to access XML data

Changing the data source for a data set

Selecting data

Using a SQL query to retrieve data

Creating a SQL query using SELECT

Combining

Using

Specifying

Specifying

Viewing and changing output columns

Previewing a data set

Adding a computed field to a data set

Joining data sets

Using additional data set options

Creating a dynamic query

Setting data set cache preferences

Chapter 8Binding Data

Understanding column bindings

Descriptive names

Dynamic updates of calculated data

Creating column bindings

Editing and deleting column bindings

More about column-binding expressions

Part IVDesigningReports

Chapter 9LayingOutaReport

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

Adjusting table rows and columns

Organizing elements in

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 data set fields

Inserting computed fields

Inserting

Chapter 10DisplayingText

Types of textual elements

Deciding which textual element to use

Using a dynamic text

Using a label element

Using a text element

Applying

Combining a

Combining

Formatting

Displaying data set field values that are stored as HTML

Formatting data

Formatting numeric data

Formatting numeric data in a data element

Formatting numeric data in a text

Formatting date-and-time data

Formatting date-and-time data in a

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

Creating styles

Importing styles

Applying a style

Modifying a style

Deleting

Formatting

Modifying a formatting rule

Creating multiple formatting

Deleting a formatting rule

Alternating row colors in a table

Specifying alignment of content in a table or grid

Aligning text horizontally

Aligning

Adjusting the spacing of content in a report

Resizing rows and columns

Resizing margins, borders, and padding of

Displaying content across multiple columns

Hiding elements based on conditions

Chapter 12Sorting and Grouping Data

Ways to sort data

Sorting string data case-insensitively

Grouping data

Grouping data by intervals

Grouping string data by intervals

Grouping numeric data by intervals

Grouping date-and-time data by intervals

Sorting data at the group level

Creating multiple groups

Changing the order of groups

Adding group headings

Displaying group headings in the detail row

Specifying expressions for group headings

Tutorial 2: Grouping report data.

Task 1: Open the report design.

Task 2: Save the report as a new file

Task 3: Add the credit limit field to the data set

Task 4: Add credit limit data to the report

Task 5: Group customer data by credit limit

Task 6: Display credit limit ranges in the group header.

Task 7: Display aggregate information

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

Chapter 13Aggregating Data

Types of aggregate calculations

Placing aggregate data

Writing aggregate expressions

Accessing aggregate functions in the expression builder

Filtering

Excluding null values from an aggregate calculation

Counting

Calculating percentages

Creating a summary report

Using 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

Getting parts of a string

Matching

Using pattern-matching in filter conditions

Using pattern-matching to search for and replace string values

x Contents

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

Chapter 15Filtering Data

Filtering opportunities

Specifying conditions on row retrieval

Filtering database data

Types

Filtering XML data

Filtering

Deciding where to filter in BIRT

Creating a filter condition

Creating multiple filter conditions

Chapter 16EnablingtheUserto FilterData

About report parameters

Planning to use report parameters

Ways to enable user filtering

Enabling the user to filter at query run time

Task 1: Creating a report parameter.

Task 2: Inserting a parameter marker in the SQL query

Task 3: Creating a data set parameter and binding it to the report parameter

Enabling the user to filter after running the query

Task 1: Creating a report parameter.

Task 2: Updating a filter condition when the report runs.

Designing the presentation of report parameters

Providing a default value

Providing the user with a list of values

Creating a static list of values

Creating a dynamic list of

Formatting

Organizing

Changing the order in which report parameters appear

Building a report with independent

Building a report with linked subreports

Creating the structure of a report with linked subreports

Linking master and detail reports

Tutorial 3: Building a report with 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 orpayments.

Task 12: Display the subreports next to one another.

Task 13: 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

Tutorial 4: Creating a chart.

Task 1: Set up the report design file.

Task 2: Add the chart to the report

Task 3: Providing data for a chart

Task 4: View the chart

Task 5: Updating the chart title.

Task 6: Refine the chart appearance.

Next steps

Exploring the chart builder

Select Chart Type

Select Data

Positioning a chart

Understanding types of charts

About area charts

About bar charts

About line charts

About meter charts

About pie charts

About scatter charts

About stock charts

Understanding chart output formats

Chapter 19DisplayingDatainCharts

Understanding

Using expressions to set up chart series

Selecting a chart data set

Aggregating information for a chart

Setting up an expression in the chart builder

Formatting the data that an expression returns

Defining series expressions in different chart types

Defining series in an area, bar, or line chart

Defining series in a meter chart

Defining series in a pie chart

Defining series in a scatter chart

Defining series in a stock chart

Defining series in a combination chart

Sorting category series or base series data

Grouping category data

Working with data on a chart axis

Understanding value and category

Defining the axis data type and number format

Defining where one axis intersects the other

Defining the scale of an axis

Using multiple y-axes

Transposing the chart axes

Setting

Setting the background color for a chart

Outlining

Setting the wall or floor color of a chart

Adding padding around the chart

Formatting the chart plot, title, and legend areas

Working with the plot area

Setting the color, outline, or shadow for the plot

Placing and adding space around the

Specifying the plot size

Working with the chart title

Formatting title text

Setting a background color, outline, or shadow for the title

Placing or adding padding around a chart title

Working with the legend

Setting the color, outline, or shadow for the legend

Hiding a legend

Placing and adding space around a legend

Showing series item values in a legend

Formatting the text that appears in the legend

Adding a legend title

Formatting an axis

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

Formatting a series

Setting the series type

Hiding a series

Making a series translucent

Setting the color palette for a series

Adding and formatting a curve-fitting line

Stacking series

Working with different series types

Setting the series depth of a chart with depth or a three-dimensional chart

Formatting a three-dimensional chart

Formatting an area-chart series

Formatting a bar-chart series

Formatting a line or a scatter-chart series

Formatting a meter-chart series

Formatting a stock-chart series

Part VEnhancingReports

Controlling pagination

Inserting

Inserting

Inserting page breaks in a master-detail report

Specifying

Customizing the master page

Viewing the master page

Designing the page header and footer

Displaying page numbers, the current date, and other text

Displaying an image

Specifying a header size

Specifying a footer size

Excluding header content from the first page

Displaying an image in the background

Designing the appearance of the background image

Positioning the background image

Displaying different content in a PDF and HTML report

Specifying page size, orientation, and margins

Using multiple master pages

Chapter 22Adding Interactive Viewing Features

Creating hyperlinks

Linking two sections in a report

Linking to a section in a different report

Linking to external content using a URI

Creating a table of contents

Adding interactive chart features

Adding interactivity events and actions

Linking a chart to a report

Exporting report data

Comparing report designs, libraries, and templates

Dynamic library behavior

Understanding library name space

Designing libraries for a shared environment

Defining

Creating

Accessing

Making local changes to a library element in a report

Using

Sharing

Overview of the localization process .

Assigning a resource file to a report

Assigning a resource key to a label or text element

Changing localized text in a label or text element to static text

Assigning a resource key to chart text

Changing localized chart text to static text

Assigning a resource key to a report parameter

Editing a resource file

Previewing a report in different locales

Glossary

Index

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 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 aims to take 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 10+ 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. And while BIRT is a relatively young project that is only in its second major release, I think this investment is apparent in the rich and robust technology that the project provides. BIRT is an extensible, full-featured reporting platform that is ready for use in and integration with production applications.

We are seeing evidence of significant adoption already. A number of ISVs, including some very big names, have or will integrate BIRT technology into products. And BIRT is not just for Java programmers. Zend Technologies, the leader in PHP technology, is integrating BIRT technology into their Eclipsebased IDE and their Zend Platform so that PHP programmers will be able to design and run BIRT reports seamlessly in their PHP applications. Likewise, enterprise IT developers and system integrators have embraced BIRT and are already integrating it into important business applications.

All of these constituents—ISVs, IT, and SI developers—contribute to the Eclipse Foundation BIRT community, which is a vibrant one. BIRT often leads all other Eclipse projects in liveliness on the Eclipse project dashboard and is one of the most searched-for terms on the Eclipse web site. (Liveliness is a metric that measures project activity based on bug fixing, project e-mails, and newsgroup postings.) 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.”

“I gave BIRT 2.0 M3 a test run and wanted to comment on it. First of all, excellent tool, you did a wonderful job. I did a report on an existing db table and it took me almost no time to get it up and running.”

“We are an ASP (application service provider) and loving the BIRT project! Great work guys!”

“Have upgraded to 2.0 M2 and must say—it rocks!... Thanks for all the great work.”

“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 web site: http://www.eclipse.org/birt

Take it from me—it’s the best way to prevent yourself from being lumped into the same category as 1970s COBOL programmers!

This page intentionally left blank

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.

With 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.

The first edition of this book described the functionality available in BIRT 2.0.1. To order the BIRT 2.0.1 book (ISBN 0-321-47804-5), call 1-800-811-0912 for singlecopy orders, or 1-800-382-3419 for corporate purchases or bulk orders.

The current book, the second edition, describes the functionality available in BIRT 2.1. New features in BIRT 2.1 include the capability to join data sets, use named data expressions, insert page breaks before and after groups of data, use multiple master pages to design a report with different page layouts, use multiple data sets to define cascading report parameters, and create a new type of stock chart.

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

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, InstallingBIRT

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 each of the available report designers.

■ Chapter 3, Updating a BIRT Installation. BIRT packages are Eclipse-based, so it is easy to update any of them from earlier releases to release 2.1 or later. This chapter describes how you can install the latest packages without interrupting your work.

Part II, GettingStarted

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

■ Chapter 4, 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 5, 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.

Part III, AccessingandBindingData

Part III discusses the tasks necessary to connect to an external data source, extract, and prepare data for use in a report. Part III includes the following chapters:

■ Chapter 6, ConnectingtoaData Source. Report data comes from many different information systems. An important step in developing a report is ensuring you can connect to a system that provides data. This chapter explains how to access data in JDBC databases, text files, and XML data sources.

■ Chapter 7, Retrieving Data. Data sources typically contain more data than is needed in an effective report. This chapter explains how to define data sets to retrieve only the data required for a report. Specifically, this chapter describes retrieving data from JDBC databases, text files, and XML sources.

■ Chapter 8, Binding Data. The data sets you create retrieve the data you want to use in a report. Before you can use or display this data in a report, you must first create the necessary data bindings. A data binding defines an expression that specifies what data to display. This chapter explains how to create and manage data bindings.

Part IV, DesigningReports

Part IV describes the tasks that a report developer completes to design reports using BIRT Report Designer. Part IV includes the following chapters:

■ Chapter 9, LayingOutaReport. A report developer places and arranges report data on a page to determine how report users view the information. This chapter provides an overview of the layout model and describes the report elements that BIRT Report Designer provides for organizing and displaying data. This chapter also describes techniques for creating report sections and placing report elements.

■ Chapter 10, DisplayingText. Much of the information in any report is textual. Textual information can be static text or values derived from data set fields. Text can be as short as a single word, or span paragraphs or pages. This chapter describes the different types of textual elements that BIRT Report Designer provides, and how to use each type of element.

■ Chapter 11, FormattingReport Content. Formatting different types of data within a report improves the clarity and visual appeal of the report. This chapter describes many formatting techniques, including how to change the display of dates, numbers, or currency values, format report elements based on conditions, and adjust the spacing between report elements.

■ Chapter 12, Sorting and Grouping Data. Almost all reports require that a report developer structure the data that comes into the report. Grouping and sorting are two ways of structuring data to ensure that the critical relationships among various pieces of information in a report are apparent to the report user. For example, a report developer can use grouping and sorting with sales data to organize the data by region, then by office, and finally by sales representatives. This chapter also includes a tutorial.

■ Chapter 13, Aggregating Data. One of the key features of any report is the ability to display summary, or aggregate, information. For example, a sales report can show the overall sales total, sales subtotals by product type, region, or sales representative, average sales amount, or the highest or lowest sales amounts. This chapter describes the common types of aggregate calculations, and explains how to write aggregate expressions and where to place them in a report.

■ Chapter 14, Writing Expressions. To obtain the necessary data for a report, it is often necessary to use expressions to manipulate the raw data that comes from a data source. This chapter explains how to write JavaScript expressions and provides many examples of manipulating data, including how to convert numbers to strings, combine values from multiple data set fields, search and replace string values, get parts of a string, and calculate the time between two dates.

■ Chapter 15, Filtering Data. Often the data from a data set includes information that is not relevant in a particular report. To exclude this extraneous information from the report, a report developer filters the data to use only the data that pertains to the report. This chapter discusses how to use BIRT Report Designer to filter data and how to enable filtering in the external data set.

■ Chapter 16, EnablingtheUserto FilterData. A report developer can use parameters to enable report users to determine which part of the data they see in the report. For example, in a report of nationwide sales figures, filtering can be used to display the data for a user-specified region. This chapter shows how to set up a report that enables a user to specify parameter values to determine what data appears in a report. This chapter also shows how to design report parameters to improve their usability and presentation.

■ Chapter 17, Building a Report That ContainsSubreports. This chapter provides examples of building and organizing subreports in a report. This chapter also includes a tutorial that provides an example of a master-detail report. This tutorial illustrates and reviews many of the topics from earlier chapters. A reader can complete the tutorial and practice applying the basic principles to build a more complex report that includes both side-by-side subreports and data set parameters.

■ Chapter 18, UsingaChartinaReport. The graphical presentation of summary data is another way of improving the effectiveness of a report. A chart can serve as a report in itself or provide a synopsis of more complex data that

appears in a report. Charts often provide an additional view of the data, highlighting or extending the information that appears in a report. This chapter introduces the types of charts that a developer can create and discusses the steps that are required to add a chart to a report. The chapter includes a tutorial that introduces a reader to the chart features.

■ Chapter 19, DisplayingDatainCharts. Setting up chart data differs somewhat from selecting typical report data and requires some specific knowledge about how to process data to produce effective charts. To modify which data appears and the arrangement of the data in the chart, you must use series, grouping, and axis settings. This chapter discusses how to define data expressions and use axis settings. Specifically, this chapter explains how to define chart series expressions, sort and group series data, and work with data on a chart axis.

■ Chapter 20, Laying Out and Formatting a Chart. Like chart data, the steps to lay out and format a chart are distinct from the layout and formatting options for a typical report. This chapter explains how to work with the visual elements of a chart to produce the desired appearance. The tasks include positioning elements in the chart area, adding and formatting titles and labels, and changing the style of the series elements available in each chart type.

Part V, EnhancingReports

Part V discusses features you can add to a report to improve usability and increase productivity when working with suites of reports. Part V includes the following chapters:

■ Chapter 21, DesigningaMultipage Report. Most reports display on multiple pages. Often, report developers want to specify where page breaks occur and they want to display information, such as page numbers and report titles, on every page. This chapter explains how to control pagination in a report and how to design a page layout.

■ Chapter 22, Adding Interactive Viewing Features. To make a report more useful, you can add interactive features, such as hyperlinks or bookmarks. This chapter describes how to create and use bookmarks and tables of contents. It also describes how to add interactive features, such as highlighting, to charts.

■ Chapter 23, BuildingaSharedReport DevelopmentFramework. To support a consistent appearance for a suite of reports, BIRT provides two ways to share the report development among designers. A report library contains standard report elements, such as data sources, a company logo, or a set of styles. A report template combines report elements from libraries or the BIRT palettes to provide a predefined layout and master page. Report designers who use these tools increase their productivity.

■ Chapter 24, Localizing Text. To support international data or produce reports that can be viewed in multiple locales or languages requires planning and an

understanding of the issues that are associated with working with resource files. This chapter provides an overview of the localization process and procedures for localizing text in a report.

Glossary. This section contains a glossary of terms that are useful to understanding all parts of the book.

Typographical conventions

TableP-1 describes the typographical conventions that are used in this book.

TableP-1 Typographical conventions

ItemConventionExample

Code examplesCourier font

File namesInitial capital letter, except where file names are case-sensitive

Key combinationA + sign between keys means to press both keys at the same time

StringName = "M. Barajas";

SimpleReport.rptdesign

Ctrl+Shift

Menu itemsCapitalized, no boldFile

Submenu itemsSeparated from the main menu item with a small arrow

File➛New

User input Courier font 2006

John Arthorne and Chris Laffra observed, “It takes a village to write a book on Eclipse.” In the case of the BIRT books, it has taken a virtual village in four countries to create these two books. Our contributors, reviewers, AddisonWesley editorial, marketing, and production staff, printers, and proofreaders are working in Austin, Boston, Closter, Indianapolis, Inman, Los Angeles, Paris, San Francisco, San Jose, Shanghai, South San Francisco, Upper Saddle River, and Windsor.

We want to thank Greg Doench, our acquisitions editor, who asked us to write a book about BIRT and has been holding his breath ever since to see if we could possibly make the schedule that we set for ourselves. Of course, we want to acknowledge the staff at Addison-Wesley who are working to support our schedule. In particular, we would like to acknowledge John Fuller, Mary Kate Murray, Julie Nahil, Sandra Schroeder, and Beth Wickenhiser. We also want to thank Mike Milinkovich at the Eclipse Foundation and Mark Coggins at Actuate Corporation for providing the forewords for the books.

We particularly want to acknowledge the many, many managers, designers, and programmers too numerous to name who have worked diligently to produce BIRT, giving us a reason for these two books. You know who you are and know how much we value your efforts. The following technical staff members at Actuate Corporation have been of particular assistance to the authors: Linda Chan, Wenbin He, Petter Ivmark, Rima Kanguri, Nina Li, Wenfeng Li, Yu Li, Jianqiang Luo, David Michonneau, Kai Shen, Aniruddha Shevade, Pierre Tessier, Krishna Venkatraman, Mingxia Wu, Gary Xue, Jun Zhai, and Lin Zhu. In addition, we want to acknowledge the support and significant contribution that was provided by Paul Rogers.

Creating this book would not have been possible without the constant support of the members of the Developer Communications team at Actuate Corporation. Many of them and their families sacrificed long personal hours to take on additional tasks so that members of the team of authors could create this material. In particular, we wish to express our appreciation to two writers who contributed original material for these books. Mary Adler wrote the initial version of “Adding Interactive Viewing Features.” Tigger Newman wrote material about accessing data sources, working with data sets, filtering data,

and using parameters for release 1.0.1, which were the basis of several chapters in the first published edition. Paul Reeves revised that material for that same edition. Terry Ryan pulled together the terminology in the glossary that accompanies each of the books. In addition, Frances Buran, Chris Dufour, Bruce Gardner, Wennie Huang, Richard Kang, Melia Kenny, Cheryl Koyano, Madalina Lungulescu, Liesbeth Matthieu, Audrey Meinertzhagen, and Lois Olson all contributed to the success of the books.

xxviii Acknowledgments

Another random document with no related content on Scribd:

»Se mies petti isäsi ja koetti pettää sinutkin ja sinä vihaat häntä yhtä paljon kuin minäkin?»

»Koko sydämestäni vihaan häntä.»

»Miksi siis… miksi annoit minut hänen käsiinsä?»

»Siksi… siksi että…»

Heikko ääni kuului makuuhuoneesta. Roma kuuli sen, mutta Rossi ei tuskallisten tunteittensa raivossa kuullut mitään.

»Ehkä hän kiusasi sinua? Tiesin aina, että hän tulisi niin tekemään. Sinä olit köyhä ja hän käytti sitä hyväkseen. Niinkö hän teki, Roma?»

»Voi, jos voisin puolustaa itseäni…»

»Tai ehkä hän lupasi sinulle jotakin. Hän oli hyvä sinulle, kun minä olin jättänyt sinut yksin ja ilman ystäviä. Voisin melkein antaa hänelle anteeksi, jos… Lupasiko hän sinulle jotakin, Roma?»

»Lupasi.»

»Ah!»

»Hän lupasi pelastaa sinun henkesi.»

»Minun henkeni! Ja sinä petit minut siitä syystä, että hän lupasi pelastaa henkeni! Etkö tiennyt, että olisin mieluummin moneen kertaan antanut henkeni kuin nähnyt työni menevän pirstaleiksi? Sinä tiesitsen!»

Hänen äänensä oli kohonnut raivon huudoksi.

»Ennenkuin suostuin avioliittoomme, selitin kaikki sinulle. Sanoin sinulle, että elämäni ja vapauteni on joka hetki vaarassa. Mutta sinä et pelännyt. Sinä olit niitä naisia, joiden mielestä vaimon tulee jakaa miehensä elämäntyö, jos hän voi, ja ellei hän voi sitä tehdä, tulee hänen astua syrjään eikä olla esteenä miehelleen.»

Roma ei vastannut, vaan istui tuijottaen eteensä silmät täynnä kyyneliä, kun Rossin ääni muuttui ivalliseksi.

»Kun erosimme kirkon ovella, piti sinun olla niin uljas. Tapahtuipa mitä tahansa minulle, sinä et pettäisi, sinä olit valmis kaikkeen. Sinä olit valmis jakamaan maanpakoni, vankilani ja vaikkapa kuolemanikin ja viimeiseen saakka sinun tuli pysyä lujana ja uskollisena. Ja nyt, siitä syystä, että vihollinen lupaa säästää minua… säästääminua, oi Jumalani!… Oi, oi, oi!»

»Davido», sanoi Roma ja lausuessaan tuon nimen hän puhkesi nyyhkytyksiin, »en voi pyytää sinua antamaan anteeksi…»

»Antamaan anteeksi!» huudahti Rossi, »pyydä anteeksi niiltä köyhiltä — niiltä köyhiltä, joiden kohtaloa koetin keventää — niiltä naisraukoilta ja lapsiraukoilta, joitten täytyy tässä ylellisyyden ja turmeluksen keskellä nähdä nälkää ja kurjuutta.»

Roma katsoi yhä vielä hänen kärsiviin kasvoihinsa koettamatta pidättää kyyneliään.

»Minä olisin uskaltanut henkeni sinun suojaasi, Roma. Kaikki muut väijyivät ja vainosivat minua, mutta Giuseppe Rosellin tyttäreen luotin koko sielullani.»

Roma katsoi häneen säihkyvin silmin. Davido Rossin kasvoissa ei näkynyt enää vihaa, vaan masentavaa surua. Hänen ihanteensa oli särkynyt, hänen uskonsa oli kuollut.

»Minä kuvittelin jos jonkinlaista kotiintuloa, Roma, mutta en koskaan tätä. Kun kuulin sinun kärsimyksistäsi, odotin sitä päivää, jolloin saisin kostaa niille, jotka olivat sinua loukanneet. Ja nyt…»

Rossin silmät tulivat täyteen kyyneliä ja hänen äänensä sortui.

»Davido, sinä et voi antaa minulle anteeksi, sen tiedän aivan hyvin. Enkä minä tahdo puolustautua enkä syyttää ketään muuta» (hän katsoi hermostuneesti makuuhuonetta kohti ja korotti sitten ääntään) »olkoonpa hän kuka tahansa ja kuinka kurjasti hän lieneekään kohdellut minua, mutta jos voisin puhua — jollei suuni olisi suljettu — jos uskaltaisin selittää…»

Ja taas kuului heikko ääni viereisestä huoneesta.

»Tiesin, mitä sanoisit, rakas, — tiesin, että olisit antanut elämäsi moneen kertaan ennemmin kuin olisit pelastanut sen kadottamalla kaiken, minkä hyväksi olit tehnyt työtä ja minkä toivoit toteutuvan. Ja ehkä minun olisi pitänyt tehdä tuo suuri uhraus alistumatta koettelemuksissa. Mutta minä en ole mikään sankaritar, Davido, enkä voinut kohota niin korkealle kuin sinä. Minä olen vain heikko vaimoraukka, joka rakastaa sinua, ja kun sanoin, että kuolemakin on löytävä minut uskollisena, ajattelin omaa kuolemaani, en sinun, enkä minä voinut nähdä sinun kuolevan.»

Davido Rossi olisi tahtonut itkeä, hän olisi tahtonut nyyhkyttää kuin lapsi.

»Ei ole sinun syysi, jos rakkautesi minuun nyt on kuollut. Minäkin toivoin kuolevani ennenkuin tulit tänne.

»Luulen, että sieluni jo onkin kuollut ja tässä minä lasken sen sinun jalkaisi juureen. En voi toivoa anteeksiantoa, mutta jos sinun sydämesi voisiantaa minulle anteeksi…»

Rossi tunsi sieluunsa tulvivan rakkautta ja anteeksiantoa.

»Mutta minä tiedän, että se on mahdotonta…»

»Ei mikään ole mahdotonta, Roma. Me olemme kaikki lapsia Jumalan kädessä, erehtyviä, pieniä lapsia, ja jos Hänen rakkautensa valo, joka valaisee elämän kirjan, voisi valaista vielä kahden onnettoman tien…»

Roman sydän sykki, ja hän nousi ylös loistavin silmin.

»Roma, minä myönnän, että päästyäni pakoon poliisin käsistä tulin tänne kostaakseni. He ajavat minua takaa ja saavat epäilemättä minut kiinni. Mutta jos sinä vakuutat minulle, että ainoastaan rakkautesi sai sinut syyttämään minua — rakkautesi eikä mikään muu — niin vaikka olen petetty ja sortunut ja vaikka minut ajetaan maanpakoon tai tuomitaan kuolemaan — niin…»

»Sen vakuutan! Minä vakuutan!»

»Vanno se, Roma.»

»Minä vannon…»

»Tuo nainen valehtelee», sanoi ääni heidän takanaan.

Paroni seisoi makuuhuoneen ovella.

Paroni oli mennyt makuuhuoneeseen yksinomaan paetakseen semmoisen miehen näkyvistä, joka oli karannut vanki ja siis melkein samassa tilassa kuin mielipuoli, jonka mielipuolisuus tietysti kiihtyisi paronin läsnäolosta. Huomatessaan, että Rossi oli tyyni, jopa jalomielinenkin vaaran hetkenä, paroni häpesi piilopaikkaansa ja aikoi astua ulos. Huolimatta ylpeydestään hänen oli pakko kuulla heidän keskustelunsa, ja häntä nöyryytti petetyn miehen ylevyys.

Roman kiihkeä vakuutus, että hän vihasi paronia, koski häneen hyvin kipeästi, ja vielä kipeämmin hän tunsi oman alemmuutensa, kun Roma syvästi vakuutti rakkauttaan Rossiin.

Annunziatan ritari! Kuninkaan serkku! Pääministeri! Diktaattori! Tuo kaikki oli merkinnyt jotakin tunti sitten. Mutta mitä se oli nyt? Ei mitään tuon naisen silmissä verrattuna pienimpäänkin pyyntöön sen mitättömän miehen huulilta, jota hän, paroni, oli ylenkatsonut.

Tuska oli sietämätön. Ensi kerran paronin elämässä hänen ajatuksensa, jotka tavallisesti olivat hyvin selvät ja terävät, menivät sekaisin. Seisoen liikkumatta oven takana, kun Roman rukous ja Rossin anteeksianto kaikui hänen korvissaan, hän tunsi oman huonoutensa selvemmin kuin koskaan ennen. Tuo kiihoitti hänessä

tulisen vihan. Nöyryytys oli liian suuri. Roma oli menetetty. Hän luuli tulevansa hulluksi.

Hän katsoi revolveria, jonka hän oli siepannut, kun Roma pudotti sen. Hän tutki sitä ja sai selville, että se oli ladattu, veti hanan, työnsi revolverin päällystakkinsa oikeaan taskuun ja avasi oven.

Rossi ja Roma eivät ensin nähneet häntä. Roman loistavat silmät, joissa kyyneleet kiilsivät, katsoivat hellästi Rossiin. Kun paroni kuuli hänen äänensä soinnun, kävi hänen mustasukkaisuutensa raivokkaammaksi kuin koskaan.

Hetken äänettömyyden jälkeen Rossi alkoi puhua. »Roma», sanoi hän, »mitä tuo herra tekee täällä?»

Paroni nauroi ja koetti selvittää ajatuksia, jotka kiehuivat hänen aivoissaan.

»Eikö olisi järkevämpää kysyä, mitä te teette täällä? Minun ymmärtääkseni tämä on tämän neidin huoneisto. Tämä neiti kuuluu minulle, ja kun hän syytti teitä tuomarin edessä, tapahtui se minun toivostani ja pyynnöstäni.»

Hän ei seisahtunut, vaan jatkoi uudistaen entiset sanansa ajatusten hyöriessä sekaisin hänen päässään.

»Tämä neiti on minun. Hän on ollut minun alusta alkaen, ja jos hän on teille sanonut, että teidän puheenne piazzalla ei ollut totta, on hän valehdellut. Luonnon ja järjen lain nojalla minä olen tämän vaimon mies, ja jos joku toinen mies tunkeutuu meidän väliimme, ei tuo toinen mies voi olla muuta kuin hänen rakastajansa.»

Rossi astui askeleen eteenpäin, mutta Roma kiiruhti väliin. Paroni tarttui lujasti taskussa olevaan revolveriin ja sanoi:

»Olkaa varuillanne, herra. Jos mies loukkaa minua, tulee hänen olla valmis kantamaan seuraukset… Minulla ei ole mitään syytä puhua pahaa tästä neidistä, koska minun samalla täytyy puhua pahaa omasta itsestäni. Mutta se, mitä te sanoitte piazzalla, oli totta sanasta sanaan, ja nyt, kun te olette tunkeutunut väliimme, on luonnollista, että sanon sen teille.»

Rossi hengitti syvään, mutta koetti hillitä itseään. Hänen kätensä olivat lujasti pusertuneet ja huulet kiinni.

»Te pyydätte minua uskomaan, että tämä neiti, jonka kanssa minä olen naimisissa, on toisen miehen vaimo. Eikö niin? Ellette voi todistaa sanojanne, ilmoitan, että minuutin perästä heitän teidät pää edellä ulos ikkunasta. Jos voitte sananne todistaa, saatte tehdä samoin minulle.»

Paroni koetti nauraa. »Tämä neiti on ainoa todistaja», sanoi hän. »Kysykää häneltä. Kuullaan, kieltääkö hän mitä olen sanonut.»

»Hän kieltää! Roma, anna anteeksi, että kysyn sinulta, mutta tuollainen panettelu, joka koskee hyvän naisen kunniaa, on syöstävä panettelijan omille silmille. Älä pelkää, rakas! Tiedäthän, että uskon sinua enemmän kuin ketään muuta maailmassa. Sano, että tuo mies valehtelee, niin uskon sen.»

Roma näki voiton katseen, jonka Rossi loi häneen ja vaipui tuolille. Nyt oli tullut se kamala hetki, jota hän oli pelännyt. Kohtalon kovan iskun tähden Rossi ei ollut saanut hänen kirjeitään vielä, ja hänen vihollisensa kertoi kertomuksen ennen häntä.

Mitä hänen oli tehtävä? Hän olisi sanonut vaikka mitä tuolla hetkellä ja uskonut Jumalan antavan sen anteeksi. Mutta tässä ei auttaisi kieltokaan. Tekipä mitä tahansa, seuraukset tulivat olemaan yhtä kamalia. Jos hän kielsi paronin kertomuksen, täyttäisi Rossi uhkauksensa. Jos hän ei kieltänyt, kohtaisi paronille aiottu kosto häntä, Romaa. Hän muisti paronin uhkauksen ja vapisi.

Roma katsoi hetken avutonna Rossista paroniin ja paronista takaisin Rossiin. Hän koetti puhua, mutta ei voinut. Vihdoin sai hän sanotuksi:

»Davido, jos voisin kertoa sinulle kaikki…»

»Kaikki! Enhän tahdo tietää muuta kuin yhden asian, Roma.»

Rossi katsoi häneen ikäänkuin hakien. Tutkivan tuomarin silmät eivät ole kysyvämmät.

»Roma, etkö ymmärrä, armas? Tuo mies — anna anteeksi, armas — tuo mies sanoo, että ennenkuin menit naimisiin minun kanssani, sinä… sinä olit ollut hänen omansa. Sitä hän tarkoittaa, ja se on valhetta, eikö niin?»

Roma ei vastannut, ja paroni naurahti. Se kidutti Rossia, ja epäluulo, jota hän oli koettanut tukahduttaa siitä asti kun hän astui tähän taloon, palasi taas kaksinkertaisena.

»Puhu, Roma. Isäsi tähden, oman kunniasi tähden, puhu!»

»Jos minä voisin sanoa sinulle…»

»Eihän sinun tarvitse sanoa muuta kuin myöntää tai kieltää.»

»Jos olisit saanut kirjeeni Englantiin…»

»Kirjeesi! Mitä niistä nyt? Roma, tuo mies syyttää sinua petoksesta aviomiestäsi kohtaan mitä arimmassa asiassa. Sen hän ehkä tekee huonossa tarkoituksessa, toivoen erottavansa meidät, mutta hän lausuu tuon syytöksensä muka todistukseksi siitä, että kun sinä petit minut tuomarin edessä, täytit vain hänen toivomuksensa. Se on valhe, eikö niin? Sano, että se on valhe! Jumalan tähden sano!»

Roma muisti, kuinka Rossi pari minuuttia sitten oli avaamaisillaan sylinsä hänelle ja sydämen taistellessa tuskaa vastaan, joka sulki hänen suunsa, hän koetti katsoa Rossiin rakkauden katsein. »Jos voisin vain katsoa häneen», ajatteli hän ja kohotti kalpeat kasvonsa. Mutta hän ei nähnyt Rossin silmissä muuta kuin tutkivan tuomarin katseen.

»Etkö voi luottaa minuun, Davido?» sanoi hän vavisten ankarasti.

»Luottaa sinuun? Enkö ole luottanut sinuun kyllin kauan? Enkö voi vaatia, että tällaisena hetkenä puhut suoraan?»

Ääni, jolla Rossi tuon lausui, ei ollut hänen oman äänensä kaltainen, ja hänen kasvonsa olivat synkät.

»Roma, miksi sinä itket? Ethän tahtone sanoa, että tuo mies puhuu totta?»

Sitten eräs ajatus johtui Roman mieleen ja tyynnytti hetkeksi hänen tunteittensa myrskyn. »Davido», sanoi hän, »muistatko, mitä sanoin kirjeessäni ystävästäni…»

»Ystävästäsi?»

»Minä sanoin häntä ystäväkseni.»

»No niin?»

»Ystävä-raukkani olin minä itse», sanoi hän peittäen korvansa käsillään.

Oli hetken äänettömyys.

»Sinä tarkoitat, että kun kirjoitit ystävästäsi, joka oli joutunut toisen miehen uhriksi ennen naimisiinmenoaan, kirjoitit itsestäsi?»

»Niin», sanoi Roma arasti.

»Ja sanomatta minulle sanaakaan annoit minun naida sinut?»

Roma ei vastannut, mutta ajatteli: »Hänen sydämensä on tunteva sääliä. Hän on muistava mitä hän vastasi minulle käskiessään ystävää luottamaan miehensä rakkauteen. Hän tuntee hetken tuskaa… mutta hänen jalompi luontonsa on voittava… ja hän on sanova: hän rakastaa minua ja on viaton, ja jos joku isku häntä kohtaa, on se ensin kohtaava minua.»

Mutta kun Rossi puhui taas, oli hänen äänensä aivan käheä.

»Jos asia on niin, ei tässä ole muuta sanottavaa. Nainen, joka saattoi tehdä sen, voi tehdä mitä tahansa. Ei ole mitään, johon en luulisi hänen pystyvän.»

Roma katsoi häneen rukoillen, mutta Rossin katse oli ankaran tuomarin, joka oli tutkinut ja tuominnut hänet.

»Davido», sanoi hän, »sinä käskit minua kertomaan kaikki ja minä tein sen, ja jos olisit saanut kirjeeni…»

Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.