In a world that celebrates efficiency, people are always looking for new and improved ways to streamline their work and automate redundant tasks. Usually in the world of BIRT that translates to utilizing templates and libraries. But what about the time spent in the Expression Builder? If you find yourself generating the same JavaScript time and time again might it be time to create a custom function or a custom control?
If I’ve not piqued your interest in learning more about custom functions and controls, let’s start with exploring what Innovent Solutions has done and is providing to the community. Located on GitHub, Innovent has a repository storing not only access to an update site but some custom functions and controls we have built.
The update site gives an example of how to deploy custom features into BIRT. These features have been validated for BIRT version 4.5.0, but can be used with any version going back to 2.3.2. The links will guide you on which update site to use for your version.
Using the update instructions there is the opportunity to deploy both the custom function and controls.
If you choose to deploy the custom functions you will notice an addition to the BIRT Functions folder.
The current list of Custom Functions are:
-
AppendLibraryContent: Allows a developer to programmatically add a ReportItem in a library to the end of a report design
-
BindParameters: Use the same parameter multiple times in your query without having to re-bind the parameter
-
BirtLogger: Access to the commons.logging framework from within BIRT Script
-
Coalesce: Returns value if value is not null, otherwise returns default
-
ConvertFIlters: Filter will be replaced with report level parameters
-
DisplayParameters: Dynamically display the parameter values in the report
-
SetChartPalette: Use CSS to control the color and font of the series items
-
TextWrap: Wrap text at specified break point
-
ThrowException: Create an error message that shows up at the end of the report
-
WhereClauseBinding: Binding a parameter and its values to the where clause
The functions update also includes two new Aggregate Functions
-
ConcatenateUnique: Each of the unique items is shown on its own row
-
CountUnique: Counts how many unique values show up in a given field
If you choose to deploy the custom controls you will notice an addition to the Palette view. Under Elements you will see DotBar and RotateText, using these new controls is as easy as drag/drop/configure.
Once deployed using the update site, these controls will be available to be used in all future report designs.
The DotBar gives a visual representation of numeric data. Where as the RotateText will allow text to be rotated to any angle.
Innovent Solutions has been a member of the BIRT project team since 2004 and provides expertise in the use and best practices associated with BIRT.
Comments