Rails in the Large: How Agility Allows Us to Build One Of the World's Biggest Rails Apps
Neal Ford shows what ThoughtWorks learned from scaling Rails development: infrastructure, testing, messaging, optimization, performance.
Tracking change and innovation in the enterprise software development community

Posted by Jason Weathersby on Dec 20, 2007
Eclipse's Business Intelligence and Reporting Tools (BIRT) project is an open source project based on the popular Eclipse IDE and is used to build and deploy reports in a Java/J2EE environment. Some of the key downloads available with the project include:
Redbook: WebSphere Application Server V7.0: Planning, Concepts, and Design
Consolidation and Virtualization Are NOT Enough: The Case for Non-x86
The 5 Mandates of Software Development Teams - Presto Manifesto
Virtual Software Development Appliances Primer
JBoss versus IBM WebSphere: Cost, Performance, Efficiency, Innovation (IBM wins)
Dynamic Application Infrastructure delivers the innovation, performance and scalability to build, deploy and manage all types of highly robust applications.
The BIRT project had its first major release in the summer of 2005 and has garnered over a million downloads since its inception. To learn more about the BIRT project see http://www.eclipse.org/birt, which includes an introduction, tutorials, downloads, and examples of using BIRT.
We will begin by first describing the BIRT designer, which is used to build report designs, and conclude by discussing the example BIRT Viewer, which is used to deploy the designs and generate the completed reports.
BIRT 2.2 Collage
At the center of BIRT is the report designer, which is a set of Eclipse plug-ins that make up the designer perspective providing drag-and-drop capabilities to quickly design reports. The reports designs are created and stored in an XML format.
Figure 1 - Eclipse BIRT Designer
This Eclipse perspective contains many Eclipse Views that provide the functionality for creating a report. These views are delineated below.
The Report Editor is used to construct the report and acts as a canvas for positioning and formatting report elements. Within this View, there are tabs for Layout, Master Page, Script, XML Source, and Preview.
Figure 2 - BIRT Preview
Before constructing a report, setting up data sources is usually required. To facilitate this task, BIRT provides the Data Explorer View.
Figure 3 - Data Explorer View
This Eclipse view allows the designer to add data sources and data sets to the report design. Essentially, a data source is just the connection. The data set can be thought of as an executed query and the specific columns it returns.
BIRT provides drivers for JDBC, XML, flat file, and scripted data sources. With the release of BIRT 2.2, BIRT also provides a Web Service data source and an improved flat file driver that now supports CSV, TSV, SSV, and PSV file formats.
BIRT also provides a special data set called a Joint Data Set that allows combining existing data sets using inner and outer joins. This feature is very useful when combining data sets from different data sources. In addition, BIRT data sources now support the ability to link or import connection profiles that are stored locally to allow sharing of connection credentials across reports.
The Data Explorer View is also used when adding report parameters and data cubes. Report parameters are parameters that are exposed to the end user of the report and are often used to personalize the report for a given user. Report parameters for example, can be tied to data set parameters to modify a query, used in a BIRT JavaScript expression to change the style and visibility of a report element, or used within a script event to personalize the content based on the selected output format.
Report parameters can be static or dynamic. Static parameters are parameters that allow the user to select from a predefined set of values or to enter a desired value, for example, in a text box. Dynamic parameters are parameters that can be data bound to an existing BIRT data set. For example, a user may select a customer from a list of customers provided by a data set.
In addition, BIRT supports cascading parameters that allow multiple list/combo boxes to be displayed with each subsequent selection list being modified by previously selected values. For example, a cascaded parameter could present a customer list in the first list box and the orders for the given customer in a second list box.
Figure 4 - Cascaded Parameter
With BIRT 2.2, dynamic parameters now support using Java Script expressions for the display text and value of the parameter. This improvement allows the parameter list to be displayed to the end user in a much more logical manner. For example, when developing an order detail report, you may wish to present a dynamic parameter list of all orders. The expression would allow you to also add in the customer name for each order. Figure 5 shows a dynamic parameter list.
Figure 5 - Dynamic Parameter Expression
The Data Explorer View also allows the creation of data cubes. This is a new feature for BIRT 2.2 and is used in conjunction with the new crosstab report element. BIRT data cubes are multi-dimensional cubes, based on one or more BIRT datasets, constructed using the new Cross Tab Cube Builder. See Palette View for more details.
Figure 6 - Cross Tab Cube Builder
In addition to the above features, BIRT now provides two new project types that allow Java developers to create additional data sources. These data sources are based on the Open Data Access (ODA) framework provided by the Eclipse Data Tools Platform (DTP) project. The ODA Designer Plug-in Project is used when constructing the GUI, which is called when a report developer uses your driver. The ODA Runtime Driver Plug-in Project is used when developing the run-time portion of your driver. This plug-in is usually deployed to a run-time environment and is responsible for making the calls to the data source and retrieving the results.
Figure 7 - BIRT Projects
The BIRT Palette View is used to add report items to the report canvas. The Palette View contains the report elements that are used to present the data collected in the Data Explorer View. To use a report, simply drag it from the Palette View to the Report Editor. All BIRT report elements support properties that can be configured in the Property Editor View and are described by the BIRT Report Object Model (ROM).
Figure 8 - Palette View
The palette supports the following report items.
dataSetRow["contactLastName"] + ", " + dataSetRow["contactFirstName"]
Figure 9 - Aggregation element
Figure 10 - Chart Wizard
Figure 11 - BIRT Cross Tab element
The Library Explorer View allows drag-and-drop functionality from existing report libraries into the current report. Libraries in BIRT are effectively report XML snippets that can be used by other reports. These libraries are referenced from reports that use them, meaning that changes in the library are automatically reflected in all reports that use the library. A good example is using a report library to store the company logo. If the company logo changes, only the library needs updating, not the reports that references it. Libraries are referenced relative to the resource folder which is configurable in the designer for design-time and in the web.xml of the Web Viewer for run-time.
Figure 12 - Library Explorer
The Property Editor View is used to set properties for report elements that have been added to the report. The items displayed will be determined by what report element is selected in the Report Editor. The Properties window presents common settings, such as style, width, and font information. Additionally, most report elements support the visibility property that allows hiding content dynamically. To the right of the Properties tab, this view features Sorting, Groups, Map, Highlights, and Filters tabs.
While most of these functions are self explanatory, the Map tab allow dynamic conditions to be built (using the Expression Builder) that dynamically change the display value of a report element. For example, if your month row value is "1", you may want to display "January".
The Highlights tab uses conditions to apply different style formats dynamically, such as showing low sales numbers in red. Most of these functions allow multiple conditions or keys to be placed on an item. One condition may change the color of the font, while another condition may change the font size. One sort key can list the results alphabetically, while another sort key puts "Jones" at the top of the list.
Figure 13 - Property Editor
In addition, with BIRT 2.2, when applying highlights, the report developer can now specify a style instead of setting the style properties manually.
Figure 14 - Style Highlighting
The Outline View presents a graphical hierarchy of the report design and illustrates the report element to container relationship. Report elements can be directly selected within the outline view and is very helpful when you have complex report designs. Additionally with BIRT 2.2, this view can be used to import or link external styles and to view report elements that have implemented script event handlers.
Figure 15 - Outline View
Importing a style sheet copies the values of the style into the report XML. Using an external style sheet allows you to link to a style sheet located in the BIRT resource folder.
BIRT 2.2 also provides two new views for examples. One view displays example reports and the other displays example charts and provides Java code to produce the chart. This view is used when using the chart engine in a Java application.
Figure 16 - Example Views
Once report development is complete, the reports can be deployed using the BIRT example Web Viewer. The viewer has been improved for BIRT 2.2 and is an AJAX based J2EE application that illustrates using the BIRT engine to generate and render report content.
The Web Viewer can be used to generate and render reports, and also supports more interactive features such as table of contents, exporting report content to several formats, client and server-side printing, as well as report pagination. These features are enabled using the Viewer navigation and tool bars. An example of using the Viewer is illustrated below.
Figure 17 - Example Web Viewer
Toolbar
The Viewer toolbar has icons for displaying the table of contents, re-running the report, exporting data, exporting the report to another format, and client and server-side printing. A table of contents is generated automatically based on the report design. The TOC can be customized by modifying the group sections of the report. To access the TOC from the example Viewer, select the
icon.
Figure 18 - Example Table of Contents
The toolbar also supplies an icon to re-run the existing report. This can be useful when the user wants to modify the set of parameters that were used to generate the report. To access the feature, select the
icon.
Figure 19 - Example report parameter dialog containing cascaded parameter
New for 2.2 is an improved data export dialog. This dialog is enabled by selecting the
icon.
Figure 20 - Example Export Data Dialog
The available result sets are displayed in a dropdown list that contains all data bound controls in the report. These result sets are not BIRT data sets, but contain the bound columns from the data container, which are usually retrieved from a data set. The available columns are displayed in the left list box and the dialog has controls to select these columns for export. The data export separator has also been improved to support additional delimiters, such as tabs, semicolons, colons, vertical lines, and tabs. Additionally, the data can be exported using a user-specified encoding.
The Viewer also supports exporting the report to additional formats. Exporting is done using the export report dialog, which can be accessed by selecting the
icon.
Figure 21 - Example Export Report Dialog
This dialog allows the report consumer to export the report to Word, PowerPoint, PDF, PostScript, and XLS formats. Additionally, the user can select all pages or a specific page range to export.
Client-side printing in BIRT is achieved within the example viewer by converting the report to PDF format when the user selects the
icon. The user can print or save the report using standard PDF functionality.
Figure 22 - Client Print Example
The 2.2 example Viewer also adds the capability to do server-side printing. This feature can be disabled with the following setting located in the web.xml.
<context-param>
<param-name>BIRT_VIEWER_PRINT_SERVERSIDE</param-name>
<param-value>OFF</param-value>
</context-param>
Server-side printing can be accessed by selecting the
icon.
Figure 23 - Example Server Side Print Dialog
This dialog will list the available server printers as well as various settings to affect how the report is printed.
Viewer Navigation Bar
The Viewer navigation bar is used when displaying a multi-page report. Pagination is determined by the page-break properties of report elements and groups. These properties can be as simple as page-break before and after or by using the page-break interval, which specifies how many rows for a container element to process before inserting a page break into the emitted HTML. When using the Viewer with the Frameset Servlet mapping, the default behavior for the viewer is to load the first page and to enable the navigation bar controls. The navigation bar contains controls to navigate forward and backward as well as the ability to enter a page to load directly.
Using portions of the Web Tools Platform Project (WTP), BIRT 2.2 now supplies a Web Project. This project type will automatically deploy the example Viewer to your selected application server. In addition, the new BIRT tag library will also be deployed. To use this project type, select a new project, and, under the Business Intelligence and Reporting Tools category, choose Web Project.
Figure 24 - Web Project
The Web Viewer now contains a tag library that can be used to customize the behavior of the Viewer. This tag library can be deployed by either deploying the viewer as normal or by using the BIRT Web Deployment project wizard. In addition, if you desire to have BIRT deployed in one context and include the tag library in a separate context, this can be done by copying the birt.tld file to your WEB-INF\tlds directory and copying coreapi.jar, modelapi,jar, viewerservlets.jar and com.ibm.icu_3.6.1v20070417.jar from the Viewer libs directory to the new context/web-inf/lib directory. Add the following reference to your web.xml:
<jsp-config>
<taglib>
<taglib-uri>/birt.tld</taglib-uri>
<taglib-location>/WEB-INF/tlds/birt.tld<
/taglib-location>
</taglib>
</jsp-config>
Using this approach reports are referenced in relation to the BIRT Viewer, not the new context.
The Viewer tag library contains five tags: param, paramDef, parameterPage, report and viewer. Each tag has multiple attributes that control the behavior of the Viewer.

Figure 25 - BIRT Tag Library
This article touches on some of the new features for BIRT 2.2. To learn more, visit the BIRT website and the BIRT newsgroup.
Neal Ford shows what ThoughtWorks learned from scaling Rails development: infrastructure, testing, messaging, optimization, performance.
Stuart Halloway discusses Clojure and functional programing on the JVM in depth, and touches on the uses of a number of other modern JVM languages including JRuby, Groovy, Scala and Haskell.
Orion Henry and Blake Mizerany talk about the technology behind Heroku and the benefits of the new add-on system.
Chris Riley presents security issues threatening service based systems, examining security threats, presenting measures to reduce the risks, and mentioning available security frameworks.
This talk investigates technical issues encountered when moving to an Agile process.
Don Box and Amanda Laucher present “M”, a declarative language for building data models, domain models or external DSLs. Don Box's demos show some of M’s features and latest changes of the language.
It is four months since the SOA manifesto was announced; InfoQ interviewed the original author’s to get insight into the motivations and the process behind the initiative.
This article explains the impact memory barriers, or fences, have on the determinism of multi-threaded programs.
1 comment
Watch Thread Reply