Smarten up your data again!

Tutorial: Eclipse BIRT Designer Perspective - Part 2

    

Palette

The BIRT Palette View (Figure 5) lists all report items that can be used to construct a report. The Palette contains some items that are used to layout the structure of the report, like grids, and other items that are bound to data, like tables and charts.

Figure 5: Palette

The palette supports the following report items.

  • Label elements are used for displaying static text. Label elements support localization, hyperlinks and highlighting. 
  • Text elements are used to display static and dynamic text, including the ability to handle multi-line and formatted HTML content. Values from existing data sets, parameters, JavaScript functions, and BIRT script functions can also be injected into the formatted HTML using the BIRT Expression Builder. The element can also be used to create scripts that are executed on the client side by using the <script> tag.
  • Dynamic text elements are used to display CLOB data values.
  • Data elements are the primary element for displaying values from data sets. The value displayed in a data item will be determined by the expression attached to the element and most often contains one or more data set columns. For example an expression for customer contact may look like:

 

dataSetRow["contactLastName"] + ", " + dataSetRow["contactFirstName"] 

 

  • Image elements are used to include both static and dynamic images within a report. BIRT supports retrieving images from a URI, embedding the image in the design (Base64 encoded), dynamic images (BLOB) from a data source, and image files in a resource folder. Each of these image types can also be customized using scripting. For example a resource folder image can be changed using an onCreate script similar to the following example.

 

var myqty = this.getRowData().getColumnValue("QUANTITYORDERED");
if( myqty > 30 ){
        this.file = "green.png";
}else if( myqty > 25 && myqty <= 30){
        this.file ="yellow.png";
}else{
        this.file="red.png";
}

 

 

  • Grid elements are the main layout component within BIRT. They allow a developer to layout sections within a report in logical order using static rows and columns. Dynamic items such as charts and tables are using nested within a grid element.
  • List elements iterate over data sets that are bound to the list. The default list element has a header, footer and detail section. The header and footer are displayed once, while the detail section is evaluated once for every row of the data set that is bound to the list. Lists are one column tables. List elements also support grouping, mapping, sorting, highlights, and filtering.
  • Table elements act much like a List element but support multiple headers, footers, and detail rows.  In addition Table elements support multiple columns. Tables also support grouping, mapping, sorting, highlights, and filtering.
  • Aggregation elements provide functionality to add aggregate data across lists, tables, cross tabs, and groups. The Aggregation Builder supplies thirty different functions such as SUM, MIN, MAX, VARIANCE, MIRR and AVERAGE. This element also supports total aggregation or group aggregation for tables and lists. Aggregated data can also be filtered.
  • The chart element is used to add charting to a report. BIRT provides a three tabbed wizard to configure charts (Select Chart Type, Select Data, and Format Chart). Fourteen primary chart types and many combinations of sub-types are available. Chart elements can be presented in PNG, JGP, BMP, and SVG output, and support many interactive features including drill through and client side scripting. Charts can source data from BIRT data sets, cubes, container elements, or from another report item within the report. The Chart Wizard in Figure 6 demonstrates what can be edited.

Figure 6: Chart Wizard

 

  • The Cross Tab element can be used to visualize data contained within a BIRT data cube. The cross tab element does not have a fixed number of columns or rows. The number of each is determined by the data retrieved from the data cube. This element supports hierarchical aggregation and display of data.
  • Cube dimensions are placed on rows and columns, and aggregated measure data is calculated at the designated intersections. It also supports derived measures, group and grand totals, column and row totals, filtering and highlighting. In addition, the cross tab element supports representing measures with a chart, like in Figure 7. Using parameters and scripts cross tabs can be very dynamic and provide highly interactive visualizations of data.

Figure 7: Chart Report Item
  • The Relative Time Period report item is used within cross tabs to calculate time based values relative to the current time dimension. This report item supports thirteen relative time periods which include functions like Quarter to Date, Period to Date, Current Quarter and Next N Periods.

Property Editor

The Property Editor View (Figure 8) is used to set design-specific properties for elements that have been added to the report. The properties displayed are those available for the specific report item type and will vary. In general most report items will have font and sizing information, localization keys, visibility expressions, hyperlink fields, and table of contents entries. Bound items will contain a tab for binding the report item to a dataset, in addition to grouping, sorting and filtering tabs. 

BIRT also contains a mapping feature where data can be displayed differently depending on an expression. For example, if a data item for week day returns a ‘2’ you could use the mapping feature to display either ‘Monday’ or ‘Tuesday’. Most items also support Highlights, which allow style properties or custom styles to be applied to a report item based on some data value or expression. 

Figure 8: Property Editor

The Sorting tab uses BIRT expressions to apply specific sorting orders. BIRT provides sorting on many report items, such as tables, charts, group sections, and crosstabs. Sorting includes the ability to create a custom sort order as well as setting the collation strength and locale.

Resource Explorer View

BIRT uses a resource folder for storing images, properties files, external global JavaScript functions, jar files and report libraries. The resource folder works as a common area for a project to share virtually any content across reports. When the Web Viewer is deployed the resource folder is configurable within the web.xml for the application. The Resource Explorer View (Figure 9) is used to navigate the current resource folder, which can be configured globally or on a project basis. Report items that have been placed in a library can be explored using this View. The Resource View supports drag and drop functionality, allowing items that have been placed in a library to be used in any report.

Figure 9: Resource Explorer View

Outline View

The Outline View presents a graphical node view of the hierarchy of a report design. This View can be used to select any item within the report and is useful when reports contain many nested report items. This view can also be used to import styles, link to external styles, embed images, link libraries to the report, and easily access any scripts that exist within the report.

Conclusion

In this article we detailed each of the Views that make up the BIRT Report Designer Perspective. For more information on other aspects of the project or for details on contributing please visit the BIRT website

Author Bio:

Jason Weathersby was the BIRT Evangelist at Actuate Corporation and a member of the Eclipse Business Intelligence and Reporting Tools (BIRT) Project Management Committee (PMC). He now works at Mozilla.

Ray Gans is the Community Manager for BIRT Exchange at Actuate Corporation where, as chief liaison between BIRT developers and the company, he is responsible for building relationships with the BIRT developer and user communities. His goals are to drive collaboration between BIRT users to share ideas, knowledge and experiences with each other; build user groups; and monitor the community to help ensure its vitality and growth. Previously, at Sun Microsystems, Ray co-led the team responsible for moving Java SE into open source and was Java Program Manager before that at Apple.

This article appearing JAX Magazine: Pulling Together.

Pages

Jason Weathersby
Jason Weathersby
Ray Gans
Ray Gans

What do you think?

JAX Magazine - 2014 - 05 Exclucively for iPad users JAX Magazine on Android

Comments

Latest opinions