Practical Data Analysis and Reporting with BIRT - Ward John - E-Book

Practical Data Analysis and Reporting with BIRT E-Book

Ward John

0,0
20,53 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

In Detail

BIRT, which stands for Business Intelligence and Reporting Tools, is actually a development framework. Including the word "Tools" in the acronym is appropriate, since BIRT is in fact a collection of development tools and technologies used for report development utilizing the BIRT framework. BIRT is essentially not a product, but a series of core technologies on top of which products and solutions are built, similar in fashion to the Eclipse framework.

The focus of this book is on the most visible and familiar product built with the BIRT framework, which is the BIRT Report Designer. The BIRT Report Designer is an Eclipse plug-in that utilizes BIRT technologies to allow users to design reports in the BIRT document format. You can integrate it with your Java/J2EE applications to produce compelling reports.

Approach

This book is a concise and practical guide aimed at getting the results you want as quickly as possible. It steers the reader through each point of reporting from setup, to scripting, designing, formatting, and deploying BIRT reports using a common example that runs through the book.

Who this book is for

This book is for Java developers who want to create rich reports and get started with BIRT to do this. Readers will need a basic understanding of SQL to follow along.

Sie lesen das E-Book in den Legimi-Apps auf:

Android
iOS
von Legimi
zertifizierten E-Readern

Seitenzahl: 256

Veröffentlichungsjahr: 2008

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Practical Data Analysis and Reporting with BIRT
Credits
About the Author
About the Reviewer
Preface
What This Book Covers
What You Need for This Book
Conventions
Reader Feedback
Customer Support
Downloading the Example Code for the Book
Errata
Questions
1. Introduction
Introduction to Business Intelligence
The Current State of the BI Market
The Need for Open-Source Reporting
What is BIRT
The Origins of BIRT
Features of BIRT
Eclipse Framework
BIRT Distributions
Why BIRT?
Conventions Used in This Book
Summary
2. Installing BIRT
Requirements
Where Do I Get BIRT?
Installing BIRT from the All-in-One Installation
Installing BIRT All-In-One under Linux
Installing iText for PDF Support
Installation of BIRT through the Eclipse Plug-in Update Program
Summary
3. The BIRT Environment and Your First Report
A Basic Scenario
The BIRT Perspective
The BIRT Workbench
The Navigator
The Outline
The Palette
The Data Explorer
Property Editor
Report Designer
Setting up a Simple Project
Creating a Simple Report
Summary
4. Visual Report Components
Adding Labels
Adding Images
Using Text and Dynamic Text
Adding Grids
Summary
5. Working with Data
BIRT Data Capabilities
Understanding the Data Components of BIRT
The Data Source
The JDBC Data Source
Data Sets
Data Set for Flat Files
Tables
Creating Tables Using Drag and Drop
Creating Tables Manually
Groups
Lists
Aggregation
Table of Contents
Crosstab
Summary
6. Report Parameters
Why Parameterize Reports?
Data Set Parameters and Report Parameters
Getting Input from the User
Creating Parameter Binding the Easy Way
Dynamic Report Parameters and Filters
Cascading Parameters
Parameter Grouping and Reports with Multiple Parameters
Summary
7. Report Projects and Libraries
Report Projects
Creating New Report Projects
Importing and Exporting Report Projects
Other Project Options
Libraries
Creating a New Library
Adding Components to a Library
Adding a Visual Element to a Library
Using Components Stored in a Library
Updating Components in the Library to Update Reports
Adding Existing Components in Reports to Libraries
Summary
8. Styles, Themes, and Templates
Style Sheets
Custom Style Sheets
Editing Style Sheets
Alternating Row Colors Using Highlights
Creating Themes
Using External CSS Style Sheets
Importing CSS Files
Using CSS as a Resource
Templates
Building a Report from a Template
Creating a Template
Summary
9. Charts, Hyperlinks, and Drill-Downs
Pie Chart
Modifying Chart Properties
Using Percentages
Gauge Chart
Bar Chart
Summary
10. Scripting and Event Handling
Types of Scripting
Expressions
Using Expressions in Data Elements
Calling Java Objects in Expressions
Event Handling
Contexts
Adding Elements to Reports
Removing Elements from a Report
Adding Sorting Conditions
Scripted Data Source
Using Java Objects as Event Handlers
Summary
11. Deployment
BIRT Viewer
Installing Reports into the Web Viewer
Accessing Reports in the Web Viewer
Command-Line Tools
Report Engine API
Outputting to Different Formats
Summary
12. Practical Example— Building Reports for Bugzilla
The Environment
Requirements
Create the Libraries
First Report—Bug Detail Report
Bug Status
Developer Issues Reports
Summary
Conclusion
Index

Practical Data Analysis and Reporting with BIRT

John Ward

Practical Data Analysis and Reporting with BIRT

Copyright © 2008 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, Packt Publishing, nor its dealers or distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

First published: February 2008

Production Reference: 1140208

Published by Packt Publishing Ltd.

32 Lincoln Road

Olton

Birmingham, B27 6PA, UK.

ISBN 978-1-847191-09-0

www.packtpub.com

Cover Image by Wim Boucquaert (<[email protected]>)

Credits

Author

John Ward

Reviewer

Meenakshi Verma

Senior Acquisition Editor

Douglas Paterson

Development Editor

Nikhil Bangera

Technical Editor

Mithun Sehgal

Editorial Team Leader

Mithil Kulkarni

Project Manager

Abhijeet Deobhakta

Project Coordinator

Patricia Weir

Indexer

Monica Ajmera

Proofreader

Chris Smith

Production Coordinator

Shantanu Zagade

Design Work

Shantanu Zagade

About the Author

John Ward is a consultant for Innovent Solutions, specializing in BIRT and e-commerce search and navigation solutions. Prior to that, John was an Assistant Vice President for Citibank, North America, managing the training MIS group and overseeing development of new technology-based training initiatives. John actively works with and tests BIRT—an open-source reporting platform built on Eclipse—including development work based on BIRT reports and the BIRT APIs. John also maintains The Digital Voice blog at http://digiassn.blogspot.com.

I'd like to thank my wife Claudia for her love, support, and patience throughout the writing of this book, my Grandfather and Father for their wisdom and advice, and my Mother for her encouragement and support.

Rich and Bamm, thanks for giving me the most tedious task in the department. Without it, this book wouldn't have been possible.

And Scott, thanks for talks about BIRT and help with presentations, which provided a good foundation to start with.

About the Reviewer

Meenakshi Verma has been part of the IT industry since 1998. She is experienced in putting up solutions across multiple industry segments using Java/J2EE technologies. Meenakshi has been helping with technical reviews for books published by Packt publishing across varied enterprise solutions. She is currently based in Toronto, Canada and is working with a leading North American Consultancy organization.

Preface

BIRT, which stands for Business Intelligence and Reporting Tools, is an Eclipse-based open-source reporting system for Java and J2EE-based web applications. Including the word "Tools" in the acronym is appropriate, since BIRT is in fact a collection of development tools and technologies used for developing reports utilizing the BIRT runtime framework component on your application server. BIRT isn't essentially a product, but a series of core technologies on top of which products and solutions are built, similar in fashion to the Eclipse framework.

This book has a fast-paced, task-driven, tutorial style, which provides understanding and structure, not just lists of steps to follow. The focus is on the most visible and familiar product built with the BIRT framework, which is the BIRT Report Designer. The BIRT Report Designer is an Eclipse plug-in that utilizes BIRT technologies to allow users to design reports in the BIRT document format. Also covered is the BIRT Charting engine, which lets you add Charts to your application.

What This Book Covers

Chapter 1 introduces readers to the concepts of business intelligence and open-source software.

Chapter 2 discusses the different installation methods for BIRT, and the list of requirements needed to work with BIRT.

Chapter 3 provides an example of the creation of a simple report using the components of BIRT, such as the Navigator, the Outline, and the Property Editor.

Chapter 4 describes the various visual report elements that can be used to design BIRT reports, such as the Palette and Grid components.

Chapter 5 details the data components of BIRT (the Data Source and the Data Set), different types of data that BIRT supports such as XML files, flat text files, and databases, and the creation of all of the elements while connecting to Data Sources in reports and Report Projects.

Chapter 6 describes the Report Parameters and Data Set Parameters with their use in designing BIRT reports.

In Chapter 7 readers are provided with the information related to Report projects, and made familiar with creating a shared development environment using Libraries.

Chapter 8 covers the creation of Styles and Themes to give a consistent appearance to a Reporting Project. It also describes the use of Templates in Report Designs.

Chapter 9 describes the role of Charts, Hyperlinks, and Drill-Downs to enhance the presentation of a report.

Chapter 10 covers some of the Scripting capabilities that BIRT has to offer with Expressions and Event Handlers.

Chapter 11 describes the process of deploying BIRT reports.

Chapter 12 shows a practical example of building reports for Bugzilla.

What You Need for This Book

A basic understanding of the SQL languageBIRT (version 2.2 is used in this book)For BIRT versions prior to 2.2, Java 1.4 is required; for 2.2 and later, Java 1.5 is required.iText is an optional requirement. For versions of BIRT prior to 2.2, iText version 1.3.2.2 is needed; for later versions, iText 1.46 is required.

Reader Feedback

Feedback from our readers is always welcome. Let us know what you think about this book, what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply drop an email to <[email protected]>, making sure to mention the book title in the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or email <[email protected]>.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer Support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the Example Code for the Book

Visit http://www.packtpub.com/files/code/1090_Code.zip, and select this book from the list of titles to download any example code or extra resources for this book. The files available for download will then be displayed.

The downloadable files contain instructions on how to use them.

Errata

Although we have taken every care to ensure the accuracy of our contents, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in text or code—we would be grateful if you would report this to us. By doing this you can save other readers from frustration, and help to improve subsequent versions of this book. If you find any errata, report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the Submit Errata link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata added to the list of existing errata. The existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Questions

You can contact us at <[email protected]> if you are having a problem with some aspect of the book, and we will do our best to address it.

Chapter 1. Introduction

At present, it's a very interesting time for open-source software. No longer is it a novel concept put forth by enthusiasts; new functionality is included into software that is changing our lives, and a lot of it is built on open-source technology. Having been an open-source advocate for some time now, I have seen a phenomenal amount of change and progress in the quality and quantity of Open-Source Software (OSS) projects. From the thoughtful minds of professional software developers, engineers, and hobbyists, tools have sprung up to support any discipline, from programmers to authors, office staff, teachers, students, media, and graphic designers. Where once there was only expensive proprietary commercial software to do particular tasks, now there are a whole handful of new and free alternatives based on OSS.

Open-source projects start—and also die—all the time. Each project starts to address what a user, or group of users, perceives as a relative shortcoming in the current computing landscape. OpenOffice.org was derived from StarOffice to address the lack of an open-source Office suite. Mozilla has grown from the ashes of Netscape to compete with IE (Internet Explorer), which led to the creation of Firefox—it has not only provided an alternative to IE but has also revitalized the browser wars, even garnering attention to its commercial competitor, Opera. Also, there is no end to the innovations that Perl and PHP have brought about.

Even non-free software benefits from OSS. Iterations of Microsoft Windows have utilized versions of FreeBSD-based implementations of the TCP-IP stack, for their network implementations. Commercial routers from companies like Linksys have embedded Linux in them; even gamers are affected, for example the Sony PlayStation 3 and Nintendo Wii are both designed to run Linux.

However, there has always been an area that is severely lacking, and that is the area of business intelligence. While there are solutions such as writing Perl or PHP scripts, these really don't leverage full-fledged business intelligence (the idea that reports and tools can be used by businesses to make strategic decisions, based on short-term and long-term data and trend analysis). There has not been an open-source tool that really addresses this shortcoming. Crafty developers can take the long approach and write out scripts and programs that automate data reporting tasks, but this is a long and complicated process. Proprietary software for doing reporting tasks has been around, such as the report developer inside Microsoft Access for reporting of Access databases or Crystal Reports. These are tools that have been built to automate reporting tasks—such as data retrieval, sorting, aggregation, and presentation—into a format that is meaningful to the user. These kinds of tools have been lacking in the open-source community, and have only begun to gain speed in the last few years.

Introduction to Business Intelligence

There are two major questions if you are reading this book that need to be answered at this point. What is business intelligence, and why do we need it? Business intelligence is a lot like many other technology buzzwords that get thrown around; many people say it, and many people will give you a complicated definition of it. However, the answer is really quite simple.

If I had to give it a formal definition I would say that business intelligence, as it relates to information technology, is any tool or method that allows developers to take data or information, process it, manipulate it, and associate it with related information and present it to decision makers. As for a simplified definition, it's presenting information to decision makers in a way that helps them make informed decisions.

Consider this scenario: You are a manager for a chain of retail stores. You need to figure out what products you should push to the forefront for the upcoming holiday season. You have a two-method approach: First you get the latest buzz from your marketers, who tell you what the new and upcoming products are; your second approach is to look at products that have traditionally sold very well.

In order to project how the current year may go, you need to look at the data you have available. What product categories have traditionally sold well over a 5-year period, or even a 10-year period? Has there been any sort of patterns to these sales figures? What individual items have sold well in that period? Are there any trends? When you look at these figures, can you give a projection on how well these products will do? What items should be put on sale in order to push for higher sales? These are the kinds of questions that a decision maker may need answered.

So the first step in the process is getting to this data, usually located in some place like a data warehouse. If you are looking at a regional level you may have this information stored separately in a localized data mart, with specific data. If you are looking at up-to-the-minute information: you may need access to transactional data. Either way, the first hurdle is getting access to the data.

What do you do once you have access to the data? How do you best format and present the data in some meaningful fashion that can be used to assist in the BI (Business Intelligence) process? This is where BI tools come into play. Using BI tools you have the ability to write reports that can present this oftentimes sporadic and confusing data, in some sort of format that is useful to decision makers. Once this data is presented, trends can be identified, total figures can be aggregated, and decisions can be made.

The Current State of the BI Market

The current state of the BI market is similar to the state of any technology field. It can change at the drop of a hat! At the time of this writing, you can divide the major players in this field into two categories: commercial offerings and open-source offerings. Each category has its own benefits and drawbacks. With the commercial offerings, typically you have familiar names such as Actuate and Business Objects, offering various tools aimed at different levels of business. Some of these tools are large and enterprise reporting platforms that have the ability to process, analyze, and reformat large quantities of data. With commercial offerings, you get product support and years of experience. Oftentimes with the big guys who offer consultation in developing your reports for a fee, you also get the professional services. One of the drawbacks of commercial offerings is the large price associated with them, both in terms of purchasing and in terms of running them. In some companies, in addition to the initial cost (which can at times be in the thousands of dollars) there is also a cost of yearly maintenance fees, upgrade fees, cost of licensing, and cost of ownership that may be typically overlooked. If you are building a large-scale custom application, are you allowed to integrate these products into your application? If so, with what restrictions? Finally, the years of engineering behind a product may leverage an obsolete methodology. Perhaps the technology behind these products is no longer viable or powerful enough to handle the demands of a growing enterprise.

Then, you have your open-source offerings. Currently there are three big names in the open-source reporting realm: JasperReport, Pentaho, and BIRT. Two of these projects, JasperReports and BIRT, are run by commercial companies who make their money by doing professional services for these offerings to small scale and private projects. Again, there are a number of pros and cons associated with open-source solutions. With open-source, you have full access to the source code of the platform you choose. This allows you to add in functionality, embed it with your existing applications, and actively participate in a development community that is oftentimes very large and around the world. There is little initial cost to open-source software in terms of purchasing, as open-source is free. The cons are that there is typically a cost associated with finding individuals who are knowledgeable in open-source.

Sometimes open-source software is not very user friendly. Finally, often there is little to no support for open-source products. This is not the case with large open-source projects, however. With large active development communities, and usually with open-source projects such as Linux, Eclipse, and Mozilla/Firefox, available answers are only an internet search away.

The Need for Open-Source Reporting

Some things are better illustrated with a story. So let me begin this with what brought me to the world of open-source business intelligence. My story starts on a late Sunday evening in 2001. At that time, I was a student intern for a midsized network security monitoring operation BATC (Ball Aerospace and Technologies Managed Network Security). Here I am, landing a dream job for a college student, a paid internship at a high-technology company, working in one of the most exciting fields in the tech industry, network security. From this single department came some interesting projects and concepts such as Sguil (the open-source network security analysis front end for Snort) and SanCP (a network session profiler). Concepts such as Network Security Monitoring (NSM) were being tested and proven over security appliances.

In this particular scenario: we are a department dedicated to providing customers with network security monitoring solutions, using open-source software. This entire NSM philosophy would later be expanded upon and described in "The Tao of Network Security" (Bejtlich 2004) yet, here I am, sitting in my cubicle with a broken keyboard, resting in an office where the A/C shuts off on a timer. So it's boiling hot! All this great technology and cool blinking lights, flashing screens, and on-the-cutting-edge monitoring of Internet traffic catching bad guys doing bad things. The whole setup is something right out of a spy movie, with exciting things happening; such a great opportunity for me, a young college student. Yet, on this particular evening, I am not enjoying my job.

My job here, this evening, is not to monitor the thousands of alerts; nor is it to inspect the exponentially higher amount of network packets, in an effort to protect networks from the insidious under doings of the digital underground. Instead, my job this evening is to do the most dreaded task in the entire operation: the weekly incident report.

Being a company dedicated to open-source, we had tons of open-source software proving that the open-source paradigm was a workable one. Our workstations were all Red Hat Linux systems, which were configured and customized to help us achieve our mission statement. Our back-end servers were all running FreeBSD. Our security console was a custom, in-house developed front-end built on open-source scripting tools (which was the base for what would later become the Sguil Project).

Our network sensors were all built on Snort, and dumped all transactional data into a PostgreSQL data warehouse. Our office productivity suite was an early release of OpenOffice.org. Yet we lacked one important piece of a customer-focused service group: a reporting system.

So, what tools did we use to address the area of reporting? We had scripts. Lots of tedious, boring, and manual scripts that generated lines and lines of ugly text. The scripts took hours to run, mostly due to lack of proper indexing on the reporting tables, because the DBAs refused to listen to us and focused on the transactional databases that housed all our live data. So the scripts were slow, and their output was ugly. The scripts may have outputted RTF documents, but no formatting tags were actually used. Part of our job was to go through each of these reports, cut out duplicate lines, change fonts and font weighting, and manually go through and confirm the accuracy of each of the counts in the summary. This was a time-consuming, tedious, and boring task that was highly error prone: as a result, it required longer validation time. Of course, due to the setup, the scripts were considered part of the Database Administrators' and the system developers' tasks; so we didn't have access to change anything in the event of an issue. If a query was returning funny results in the reports, too bad, because all we saw was an output page with no access to the code that generated it.

Now it's the middle of the night, we're tired, the other guy is griping about having to pick up the slack while I am doing the most tedious task of running the report. It's hot! I'm going through hundreds of pages of numbers, cutting out duplicates, changing summary numbers to reflect correct counts, and changing the formatting. I am sitting here asking myself the same question I ask myself each week when we run these reports: "Isn't there a better way?" This will become a question that always nags at the back of my mind, and it is one that I will always come back to as an unresolved question.

What is BIRT