Contents

Foreword

Preface

About this book

Who should read this book

Contents of this book

Typographical conventions

Syntax conventions

Acknowledgments

Part 1 Installing and Deploying BIRT

Chapter 1 Introducing BIRT Report Designers

Understanding BIRT components

Understanding Eclipse BIRT packages

About types of BIRT builds

Chapter 2 Installing a BIRT Report Designer

Installing BIRT Report Designer Full Eclipse Install

Installing BIRT RCP Report Designer

Troubleshooting installation problems

Avoiding cache conflicts after you install a BIRT report designer

Specifying a Java Virtual Machine when starting BIRT report designer

Installing a language pack

Updating a BIRT Report Designer installation

Updating BIRT RCP Report Designer installation

Chapter 3 Installing Other BIRT Packages

Installing Chart Engine

Installing BIRT Data Tools Platform Integration

Installing BIRT Demo Database

Installing Report Engine

Installing BIRT Samples

Installing BIRT Source Code

Installing BIRT Web Tools Integration

Chapter 4 Deploying a BIRT Report to an Application Server

About application servers

About deploying to Tomcat

About deploying to other application servers

Placing the BIRT report viewer on an application server

Installing the BIRT report viewer as a web application

Testing the BIRT report viewer installation

Changing the BIRT report viewer context root

Changing the BIRT report viewer location

Understanding the BIRT report viewer context parameters

Verifying that Apache Tomcat is running BIRT report viewer

Placing fonts on the application server

Viewing a report using a browser

Using connection pooling on Tomcat

Setting up a report to use connection pooling

Using a jndi.properties file

Configuring a JNDI connection object on Tomcat

Part 2 Understanding the BIRT Framework

Chapter 5 Understanding the BIRT Architecture

Understanding the BIRT integration

About the BIRT applications

About BIRT Report Designer and BIRT RCP Report Designer

About the BIRT Viewer

About the BIRT engines and services

About the design engine

About the report engine

About the generation services

About the presentation services

About the chart engine

About the data engine and services

About data services

About the ODA framework

About the types of BIRT report items

About standard report items

About custom report items

About the chart report item

About the Report Object Model (ROM)

About the types of BIRT files

About report design files

About report document files

About report library files

About report template files

About custom Java applications

About a custom report designer

About a custom Java report generator

About extensions to BIRT

Chapter 6 Understanding the Report Object Model

About the ROM specification

ROM methods

ROM properties

ROM slots

ROM styles

About the ROM schema

About the rom.def file

Understanding ROM elements

About the primary ROM elements

About report item elements

About report items

Understanding report item element properties

About data report elements

Part 3 Scripting in a Report Design

Chapter 7 Using Scripting in a Report Design

Overview of BIRT scripting

Choosing between JavaScript and Java

Using both JavaScript and Java

Events overview

Engine task processes

BIRT Web Viewer

BIRT processing phases

BIRT event types

Parameter events

Report design events

Types of data source and data set events

ReportItem events

Event order sequence

Preparation phase operation

Generation phase operation

About data source and data set events

About data binding

About page break events

About chart event order

About table and list event order

Completion of the generation phase

Presentation phase operation

Event order summary

Chapter 8 Using JavaScript to Write an Event Handler

Using BIRT Report Designer to enter a JavaScript event handler

Creating and using a global variable

Creating and using page variables and scripts

Understanding execution phases and processes

Using the reportContext object

Using getOutputFormat

Using reportContext to retrieve the report design handle

Passing a variable between processes

Using getAppContext

Getting information from an HTTP request object

Using the this object

Using this object methods

Using the this object to set a report item property

Using the row object

Getting column information

Getting and altering the query string

Changing data source connection properties

Getting a parameter value

Determining script execution sequence

Providing the ReportDesign.initialize code

Providing code for the scripts you want to track

Providing the ReportDesign.afterFactory code

Tutorial 1: Writing an event handler in JavaScript

Task 1: Create the report design

Task 2: Create a counter in Table.onCreate

Task 3: Conditionally increment the counter

Task 4: Display the result

JavaScript event handler examples

JavaScript onPrepare example

JavaScript onCreate examples

JavaScript onRender examples

Cross-tab script examples

Calling external JavaScript functions

Calling Java from JavaScript

Understanding the Packages object

Understanding the importPackage method

Using a Java class

Placing Java classes

Issues with using Java in JavaScript code

Calling the method of a class in a plug-in

Chapter 9 Using Java to Write an Event Handler

Writing a Java event handler class

Locating the JAR files for a BIRT event handler

Extending an adapter class

Making the Java class visible to BIRT

Associating a Java event handler class with a report element

BIRT Java interface and class naming conventions

Writing a Java event handler

Using event handler adapter classes

Using event handler interfaces

About the Java event handlers for report items

Using Java event handlers for a data source element

Using Java event handlers for a data set element

Using Java event handlers for a scripted data source element

Using Java event handlers for a scripted data set element

Using Java event handlers for a report design

Understanding the BIRT interfaces

About the element design interfaces

About the methods for each report element

About the IReportElement interface

About the element instance interfaces

Using the IReportContext interface

Using the IColumnMetaData interface

Using the IDataSetInstance interface

Using the IDataSetRow interface

Using the IRowData interface

Java event handler example

Report level events

Report item events

Debugging a Java event handler

Chapter 10 Working with Chart Event Handlers

Chart events overview

Understanding the Chart script context

Using the Chart instance

Chart instance getter methods

Chart instance setter methods

Chart instance methods

Accessing the Chart instance in an event handler

Understanding the external context

Understanding when chart events fire

Prepare phase

Data binding phase

About the beforeDataSetFilled event

About the afterDataSetFilled event

Building phase

About the beforeGeneration event

About the afterGeneration event

Rendering phase

Rendering phase script events

Rendering blocks

Rendering series

Rendering data points and data point labels

Rendering axes

Rendering legend items

Writing a Java chart event handler

Setting up the chart event handler project

Java chart event handler examples

Writing a JavaScript chart event handler

Using the simplified charting API

Getting an instance of a chart item

Understanding the sub-interfaces of IChart

Chapter 11 Using Scripting to Access Data

Using a Scripted Data Source

Tutorial 2: Creating a scripted data source

Task 1: Create a new report design

Task 2: Create a scripted data source

Task 3: Create a scripted data set

Task 4: Write the open( ) and close( ) methods of the data source

Task 5: Write the open( ) method of the data set

Task 6: Write the fetch( ) method of the data set

Task 7: Place the columns on the report layout

Writing the scripted data set in Java

Using a Java object to access a data source

Performing initialization in the data set open( ) method

Getting a new row of data in the data set fetch( ) method

Cleaning up in the data set close( ) method

Deciding where to place your Java class

Deploying your Java class

Using input and output parameters with a scripted data set

Creating a web services data source using a custom connection class

Chapter 12 Debugging Event Handlers

Checking the syntax of JavaScript expressions

Debugging JavaScript event handlers code

Debugging Java event handler code

Debugging report execution exceptions

Creating a debug configuration

Tutorial 3: Debugging a report that contains Java and JavaScript code

Task 1: Preparing the report for debugging

Task 2: Setting a JavaScript breakpoint

Task 3: Setting a Java breakpoint

Task 4: Create the debug configuration

Task 5: Debugging the report

Part 4 Integrating BIRT into Applications

Chapter 13 Understanding the BIRT APIs

Package hierarchy diagrams

About the BIRT Report Engine API

Creating the BIRT ReportEngine instance

Using the BIRT Report Engine API

EngineConfig class

ReportEngine class

IReportRunnable interface

IReportDocument interface

IEngineTask interface

IGetParameterDefinitionTask interface

IDataExtractionTask interface

IRunTask interface

IRenderTask interface

IRunAndRenderTask interface

Report engine class hierarchy

Report engine interface hierarchy

About the Design Engine API

Using the BIRT Design Engine API

DesignConfig class

DesignEngine class

SessionHandle class

ModuleHandle class

ReportDesignHandle class

LibraryHandle class

DesignElementHandle class

Individual element handle classes

Design engine class hierarchy

DesignElementHandle hierarchy

ReportElementHandle hierarchy

ReportItemHandle hierarchy

ElementDetailHandle hierarchy

StructureHandle hierarchy

Design engine interface hierarchy

About the BIRT Chart Engine API

Using the BIRT Chart Engine API

Chart engine class hierarchy

chart.aggregate class and interface hierarchy

chart.datafeed class and interface hierarchy

chart.device class and interface hierarchy

chart.event class and interface hierarchy

chart.exception class hierarchy

chart.factory class and interface hierarchy

chart.log class and interface hierarchy

chart.model interface hierarchy

chart.model.attribute class and interface hierarchy

chart.model.component interface hierarchy

chart.model.data interface hierarchy

chart.model.layout interface hierarchy

chart.model.type interface hierarchy

chart.render class and interface hierarchy

chart.script class and interface hierarchy

chart.util class hierarchy

Chapter 14 Programming Using the BIRT Reporting APIs

Building a reporting application

About the development environment

About plug-ins in BIRT home

About libraries in BIRT home

About required JDBC drivers

Setting up the build path and accessing Javadoc

Modifying a report design using the API

About the deployment environment

Generating reports from an application

Setting up the report engine

Configuring the BIRT home

Configuring the report engine

Setting up a stand-alone or WAR file environment

Starting the platform

Creating the report engine

Using the logging environment to debug an application

How to use BIRT logging

Opening a source for report generation

Understanding an IReportRunnable object

Understanding an IReportDocument object

Accessing a report parameter

Preparing to generate the report

Setting the parameter values for running a report design

Adding to the report engine’s class path

Providing an external object to a report design

Generating a binary report document

Preparing to render a formatted report

Setting up the rendering options

Rendering formatted output

Accessing the formatted report

Checking the status of a running report task

Cancelling a running report task

Programming the structure of a report design

About BIRT model API capabilities

Opening a report design for editing

Configuring the design engine to access a design handle

Using an IReportRunnable object to access a design handle

Using a report item in a report design

Accessing a report item by iterating through a slot

Accessing a report item by name

Examining a report item

Accessing the properties of a report item

Modifying a report item in a report design

Accessing and setting complex properties

Understanding property structure objects

Adding a report item to a report design

Accessing a data source and data set with the API

About data source classes

About data set classes

Using a data set programmatically

Saving a report design

Creating a report design

Chapter 15 Programming Using the BIRT Charting API

About the chart engine contents

About the environment for a charting application

Configuring the chart engine run-time environment

Verifying the environment for a charting application

About the charting API and the chart structure

About chart visual components

About chart data

Understanding static data

Understanding dynamic data

Using the charting API to create a new chart

Modifying chart properties

Understanding simple and complex properties

Setting plot properties

Setting legend properties

Setting axes properties

Using series

Adding a series to a chart

Creating a category series

Creating an orthogonal series

Setting series properties

Associating data with a series

Adding a series definition to a chart

Setting up the default aggregation for the chart

Changing the aggregation for secondary value series

Adding a chart event handler

Adding a Java chart event handler

Adding a JavaScript chart event handler

Using a chart item in a report design

Accessing an existing chart item

Creating a new chart item

Getting a design engine element factory object

Setting the chart type and subtype

Creating sample data

Getting an extended item handle object

Setting up the report item as a chart

Preparing a data set and data columns

Binding the chart to the data set

Set any other report item properties

Adding the new chart to the report design

Saving the report design after adding the chart

Putting it all together

Using the BIRT charting API in a Java Swing application

Understanding the chart programming examples

api.data examples

DataCharts example

GroupOnXSeries example

GroupOnYAxis example

api.data.autobinding example

api.format example

api.interactivity examples

api.pdf example

api.preference example

api.processor example

api.script examples

api.viewer examples

Chart3DViewer example

CurveFittingViewer example

DialChartViewer example

SwingChartViewerSelector example

SwingLiveChartViewer example

SWTChartViewerSelector example

builder example

radar.ui example

report.api examples

MeterChartExample example

SalesReport example

StockReport example

report.design examples

report.design.script examples

view example

Part 5 Working with the Extension Framework

Chapter 16 Building the BIRT Project

About building the BIRT project

Installing a working version of BIRT

Configuring Eclipse to compile BIRT and build the viewer JAR files

Downloading and extracting the correct version of the BIRT source code

Importing, building, and testing the BIRT project

Building new JAR files to display BIRT output

Building the viewservlets.jar file

Building the chart-viewer.jar file

Chapter 17 Extending BIRT

Overview of the extension framework

Understanding the structure of a BIRT plug-in

Understanding an extension point schema definition file

Understanding a plug-in manifest file

Understanding a plug-in run-time class

Working with the Eclipse PDE

Understanding plug-in project properties

Understanding the Eclipse PDE Workbench

Creating the structure of a plug-in extension

Creating the plug-in extension content

Building a plug-in extension

Generating an Ant build script

Testing a plug-in extension

Deploying the extension plug-in

Creating an update site project

Installing available software

Downloading the code for the extension examples

Chapter 18 Developing a Report Item Extension

Understanding a report item extension

Developing the sample report item extension

Downloading BIRT source code from the CVS repository

Creating a rotated label report item plug-in project

Defining the dependencies for the rotated label report item extension

Specifying the run-time package for the rotated label report item extension

Declaring the report item extension points

Creating the plug-in extension content

Understanding the rotated label report item extension

Understanding RotatedLabelItemFactoryImpl

Understanding RotatedLabelUI

Understanding RotatedLabelPresentationImpl

Understanding GraphicsUtil

Understanding RotatedLabelCategoryProviderFactory

Understanding RotatedLabelGeneralPage

Deploying and testing the rotated label report item plug-in

Deploying a report item extension

Launching the rotated label report item plug-in

Developing an advanced report item

Defining the report item model

Defining the report item UI design

Defining the report item presentation

Improving the report item UI design

Using the Image UI provider

Using the Figure UI Provider

Creating a report item builder

Creating a context menu

Creating a property editor

Binding the report item to data

Changes in the model definition

Changes in the report item presentation

Changing the report item UI to support expressions

Adding data binding to the builder

Adding data binding to the property page

Chapter 19 Developing a Report Rendering Extension

Understanding a report rendering extension

Developing a CSV report rendering extension

Creating a CSV report rendering plug-in project

Defining the dependencies for the CSV report rendering extension

Declaring the emitters extension point

Understanding the sample CSV report rendering extension

Understanding the CSV report rendering extension package

Understanding CSVReportEmitter

Understanding CSVTags

Understanding CSVWriter

Understanding CSVRenderOption

Testing the CSV report rendering plug-in

About ExecuteCSVReport class

About the report design XML code

Developing an XML report rendering extension

Creating an XML report rendering plug-in project

Defining the dependencies for the XML report rendering extension

Declaring the emitters extension point

Understanding the sample XML report rendering extension

Understanding the XML report rendering extension package

Understanding XMLReportEmitter

Understanding XMLTags

Understanding XMLFileWriter

Understanding XMLRenderOption

Understanding LoadExportSchema

Testing the XML report rendering plug-in

Chapter 20 Developing an ODA Extension

Understanding an ODA extension

Developing the CSV ODA driver extensions

About the CSV ODA plug-ins

Downloading BIRT source code from the CVS repository

Implementing the CSV ODA driver plug-in

Understanding the ODA data source extension points

Understanding dataSource extension point properties

Understanding ConnectionProfile properties

Understanding the dependencies for the CSV ODA driver extension

Understanding the sample CSV ODA driver extension

Understanding Driver

Understanding Connection

Understanding Query

Understanding ResultSet

Understanding ResultSetMetaData

Understanding DataSetMetaData

Understanding Messages

Understanding CommonConstants

Developing the CSV ODA user interface extension

Creating the CSV ODA user interface plug-in project

Understanding the ODA data source user interface extension points

Understanding the ConnectionProfile extension point

Understanding the propertyPages extension point

Understanding the dataSource extension point

Understanding the sample CSV ODA user interface extension

Implementing the ODA data source and data set wizards

Understanding the org.eclipse.birt.report.data.oda.csv.ui.impl package

Understanding the org.eclipse.birt.report.data.oda.csv.ui.wizards package

Understanding Constants

Understanding CSVFilePropertyPage

Understanding CSVFileSelectionPageHelper

Understanding CSVFileSelectionWizardPage

Understanding FileSelectionWizardPage

Testing the CSV ODA user interface plug-in

Developing a Hibernate ODA extension

Creating the Hibernate ODA driver plug-in project

Understanding the sample Hibernate ODA driver extension

Understanding HibernateDriver

Understanding Connection

Understanding DataSetMetaData

Understanding Statement

Understanding ResultSet

Understanding HibernateUtil

Building the Hibernate ODA driver plug-in

Developing the Hibernate ODA user interface extension

Understanding the sample Hibernate ODA user interface extension

Understanding HibernatePageHelper

Understanding HibernateDataSourceWizard

Understanding HibernatePropertyPage

Understanding HibernateHqlSelectionPage

Building the Hibernate ODA user interface plug-in

Testing the Hibernate ODA user interface plug-in

Chapter 21 Developing a Data Extraction Extension

Understanding a data extraction extension

Developing an XML data extraction extension

Creating an XML data extraction plug-in project

Defining the dependencies for the XML data extraction extension

Declaring the data extraction extension point

Understanding the XML data extraction extension

Implementing the data extraction interfaces

Understanding the XML document format

Understanding XMLDataExtractionImpl methods

Testing the XML data extraction plug-in

About the report design XML code

Chapter 22 Developing a Fragment

Understanding a fragment

Developing the sample fragment

Creating a fragment project

Understanding the sample fragment

Building, deploying, and testing a fragment

Chapter 23 Developing a Charting Extension

About BIRT charting extension points

Setting up the build environment

Extending the chart model

Creating an EMF model

Completing the new SeriesImpl

Implementing the extension points

Design-time plug-in extensions

Chart UI-types extension point

Series composite extension point

Run-time Plug-in extensions

Chart model types extension point

Data processor extension point

Model Renderer Extension Point

Debugging this example

Glossary

Index

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset