How to create, print barcodes in BIRT reports?
Using BIRT Barcode Generator plug-in to generate QR Code, 2d, 1d barcodes in Eclipse BIRT reports
This page provides a comprehensive guide for BIRT report developers and system integrators who need to incorporate barcode generation capabilities into Eclipse BIRT (Business Intelligence and Reporting Tools) reports.
BIRT is an open source reporting platform that allows developers to design and deploy data driven reports. The BarcodeLib BIRT Barcode Generator is a plugin built on the BIRT Custom Extended Report Item Framework. It enables the creation and printing of high quality linear (1D) and two dimensional (2D) barcode images directly within BIRT reports, including both the BIRT Report Designer and the BIRT Report Runtime environment.
The BarcodeLib BIRT Barcode Generator plugin supports more than 20 linear barcode symbologies (such as Code 39, Code 128, EAN 8, EAN 13, UPC A, UPC E) and several 2D symbologies (including QR Code, PDF 417, and Data Matrix). It is fully compatible with the latest barcode symbology ISO standards and is based on the reliable BarcodeLib Barcode for Java generation library. The plugin can be installed into any BIRT version 2.5.2 or later (up to the latest 4.15.0) and requires JDK 1.5.0_22 or a later version.
Requirements and Prerequisites
Before installing the BarcodeLib BIRT Barcode Generator plugin, you must ensure that your development and runtime environments meet the minimum requirements.
- BarcodeLib BIRT Barcode plugin JAR file
The plugin is distributed as a single JAR file. For evaluation purposes, you can download a free trial package that contains the file named com.barcodelib.barcode.birt_7.0.0.v20240517.jar (version number may vary). The licensed version replaces the trial JAR.
- Eclipse BIRT version
The plugin is compatible with BIRT version 2.5.2 or later. It has been tested up to BIRT 4.15.0 and supports both the BIRT Report Designer (the Eclipse based IDE) and the BIRT Report Runtime (the headless engine for report deployment). Earlier versions may work but are not officially supported.
- Java Development Kit (JDK)
JDK version 1.5.0_22 or any later version (including JDK 6, 7, 8, 11, 17) is required. The plugin relies on standard Java libraries and does not require any additional native components.
Note about Java environment:
The BIRT Report Designer typically includes its own embedded Java runtime, but you may need to ensure that the system JDK is properly set in the PATH environment variable. If you encounter "class not found" errors during barcode generation, check that the JDK version meets the minimum requirement and that the Eclipse IDE is launched using a compatible JRE.
Installing the Barcode JAR for the Latest BIRT Versions (4.10 to 4.15.0)
The installation procedure below is for BIRT versions 4.10, 4.11, 4.12, 4.13, 4.14, and 4.15.0. These versions use the Eclipse Equinox framework with a bundles.info configuration file to manage plugins.
- Copy the downloaded jar file "com.barcodelib.barcode.birt_7.0.0.v20240517.jar" (version number may vary) to your Eclipse plugins directory. The typical path is:
{Eclipse home}\eclipse\plugins\.
Replace {Eclipse home} with the root directory where Eclipse BIRT is installed (e.g., C:\birt\eclipse).
- Edit the bundles.info configuration file
- Navigate to the following subdirectory:
{Eclipse home}\configuration\org.eclipse.equinox.simpleconfigurator\
- Open the file named bundles.info with a plain text editor (such as Notepad or Visual Studio Code).
- Add the following line at the end of the file (ensure no extra spaces or line breaks):
com.barcodelib.barcode.birt,7.0.0,plugins/com.barcodelib.barcode.birt_7.0.0.v20240517.jar,4,false
- Save the file and close the editor.
- Clean temporary configuration files (recommended)
To ensure that Eclipse reloads all plugin information correctly, navigate to the {Eclipse home}\configuration\ folder. Remove all temporary files and subfolders except the following essential items:
- The entire subfolder org.eclipse.equinox.simpleconfigurator (keep all files inside it).
- The file org.eclipse.update\platform.xml (keep the file, but you may delete other content inside the org.eclipse.update folder).
- The file config.ini (keep this file).
Deleting temporary files forces Eclipse to re read the bundles.info configuration on the next startup.
- Restart Eclipse BIRT Report Designer
Close all Eclipse applications completely. Launch the Eclipse BIRT IDE again. The plugin should be loaded automatically.
-
In the BIRT Report Designer, locate the Palette view (usually on the right side of the window). Under the "Report Items" section, you should see a new entry named BarcodeLib.Barcode. If you see this item, the installation was successful.
Note about plugin loading speed:
After successful installation, you may notice that Eclipse startup becomes slightly slower because the bundles.info configuration forces a plugin reload each time. This is normal. Once you have confirmed that the barcode plugin works, you can optionally revert the bundles.info change described in the above section to improve loading speed.
Quick to Create the first barcode in BIRT report
Here we will learn how to build a new BIRT report project and add a static Code 128 barcode to the report layout. This is a basic test to confirm that the plugin is functioning correctly.
- Create a new BIRT report project, and add a new BIRT report to the project
- Drag the barcode item onto the report layout
In the Palette view, locate the BarcodeLib.Barcode item under "Report Items". Drag it and drop it onto the report design surface (e.g., into the "Detail" band of a new table, or directly onto the page).
- Configure the barcode properties
Select the barcode item on the layout. In the Properties view, go to the General tab. You will see a property named Data. Enter a value such as 1234567890. The barcode type defaults to Code 128. You can change the type by selecting a different value from the Barcode Type drop down list (e.g., CODE39, QRCODE).
- Preview the report
Click the View Report button on the toolbar (or press Alt+Shift+F1). The BIRT report will generate and open in an internal web browser preview. You should see a Code 128 barcode image printed on the report.
Note about static barcode generation:
The static barcode does not depend on any data source. It is useful for testing the plugin installation and for reports that always print the same identifier (e.g., a company logo or a fixed reference number).
Note about barcode size:
By default, the barcode may be too small or too large. You can adjust the Bar Width (X) and Bar Height (Y) properties in the General tab to control the module width and overall height. For Code 128, a typical X value is 2 pixels and Y is 50 pixels for screen display.
Printing Barcodes in a Report with Data from a Database
Most real world BIRT reports need to generate barcodes dynamically based on data retrieved from a database. Here we will explain how to add a data source, create a data set, bind barcode items to database columns, and display a list of barcodes in a table.
- Add a data source to the report
In the BIRT report design interface, switch to the Data Explorer view (usually on the left). Right click on Data Sources and select New Data Source.
- In the "New Data Source" window, choose the appropriate driver. For testing, you can select Classic Models Inc. Sample Database if your BIRT installation includes it. This is a built in example database (Apache Derby).
- Click Next and then Finish. The data source appears under "Data Sources".
- Add a data set to the report
Right click on Data Sets in the Data Explorer and select New Data Set.
- In the "New Data Set" window, select the data source you just created. Click Next.
- In the query builder, you can write a SQL query. For the sample database, enter:
SELECT CUSTOMERNUMBER, CUSTOMERNAME FROM CUSTOMERS
- Click Next and then Finish.
- In the "Edit Data Set" dialog, you can review the columns. Click OK.
- Insert a table into the report layout
From the Palette, drag a Table item onto the report layout. In the "Insert Table" dialog, accept the default settings (e.g., 3 columns). Click OK. The table will appear with a header row, a detail row, and a footer row.
- Bind data set columns to the table cells
- In the Data Explorer, expand the data set you created. You will see the columns CUSTOMERNUMBER and CUSTOMERNAME.
- Drag CUSTOMERNUMBER onto the first cell of the Detail Row in the table.
- Drag CUSTOMERNAME onto the second cell of the Detail Row.
The table will now display the customer number and name for each record.
- Add a barcode to the third column of the detail row
- From the Palette, drag the BarcodeLib.Barcode item onto the third cell of the Detail Row (the empty cell to the right of the name).
- Select the barcode item. In the Properties view, go to the General tab.
- In the Data property, instead of typing a static value, enter a dynamic expression that references the data set column. For example:
row["CUSTOMERNUMBER"]
- Ensure that the Barcode Type is set to CODE128 (or another type suitable for numeric data).
- Optionally, adjust the X and Y properties to control size.
- Preview the report
Click View Report. The report will query the database and display a table where the third column contains a Code 128 barcode for each customer number.
Note:
When generating a report with hundreds or thousands of barcodes, the barcode generation may increase report processing time. To improve performance, consider generating barcodes only for a filtered data set or using a barcode symbology that is faster to render (e.g., Code 128 rather than a 2D barcode). The BIRT Barcode plugin is optimized for Java, but large reports may still require tuning.
Summary
This guide has provided a complete, step by step workflow for integrating barcode generation into Eclipse BIRT reports using the BarcodeLib BIRT Barcode Generator plugin. You have learned how to:
- Install the plugin for recent (4.10+) BIRT versions, including editing the bundles.info configuration file and cleaning temporary files.
- Troubleshoot common installation issues such as the barcode item not appearing in the Palette, using the Equinox reconciler setting to force plugin loading.
- Update or reinstall the plugin when upgrading from trial to licensed versions or recovering from a corrupted installation.
- Create simple BIRT reports with static barcodes to verify the plugin functionality.
- Generate dynamic barcodes from database data by binding the barcode item to data set columns, including handling null values and formatting expressions.
The BarcodeLib BIRT Barcode Generator is fully compliant with ISO standards and requires no Java programming knowledge. It works both in the BIRT Report Designer (for interactive design) and in the BIRT Report Runtime (for headless report generation in production environments). By following the procedures and notes in this guide, you can reliably add barcodes to any BIRT report, whether for retail labels, shipping documents, inventory tracking, or identification cards.