How to create, print EAN-13 in Eclipse BIRT reports?
Using BIRT Barcode Generator plugin to generate EAN-13 in Eclipse BIRT reports
Here we will learn how to generate EAN-13 barcodes within Eclipse BIRT (Business Intelligence and Reporting Tools) reports. The EAN 13 barcode (originally European Article Number) is a 13 digit linear barcode symbology that serves as a global standard for product identification. It is a superset of the original 12 digit Universal Product Code (UPC) system developed in the United States. EAN 13 is defined by GS1, the standards organisation that also manages Global Trade Item Numbers (GTIN). In Japan, the same symbology is referred to as the Japanese Article Number (JAN). EAN 13 barcodes are used extensively in retail, supply chain, and inventory management worldwide.
The BarcodeLib BIRT EAN-13 Generator is an Eclipse BIRT Custom Extended Report Item built on the BarcodeLib Java Barcode Generator library. It enables you to generate high quality EAN13 barcode images directly in BIRT reports without writing Java code.
All EAN 13 barcode properties are set in the Report Item Property view of your Report Design file (.rptdesign). The plugin supports EAN 13 with optional 2 digit or 5 digit add on symbols, automatic MOD 10 check digit calculation, customization of the human readable interpretation (HRI) with OCR B font, adjustment of quiet zone indicators, lead digit spacing, trail digit spacing, and data validation.
BIRT Barcode EAN-13 Generator Introduction
The BarcodeLib BIRT Barcode EAN 13 Generator is an Eclipse BIRT Custom Extended Report Item that allows you to easily generate and print high quality linear (1D) and two dimensional (2D) barcodes in your BIRT reports. The EAN 13 component specifically targets the EAN 13 symbology, which is valued for its global acceptance, fixed length, and built in check digit for data integrity.
Valid data scope for EAN 13 encoding:
- Numeric digits only: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.
- The data must consist of exactly 12 or 13 digits. If 12 digits are provided, the library automatically calculates the 13th digit as the MOD 10 check digit. If 13 digits are provided, the library validates the check digit and throws an exception if it is incorrect.
How to Generate EAN 13 in a BIRT Report
EAN 13 supports only numeric digits (0 - 9). It includes 12 data digits plus 1 check digit, structured into country code, manufacturer code, product code, and check digit. The following steps summarize the basic generation workflow.
- Select the Image Report Item in your layout. Ensure that the barcode item is placed in the appropriate section of your report (e.g., Detail row of a table, or directly on the page).
- Open Report Item Property and set image source to Dynamic Image. This is typically the default for the barcode custom report item. No change is usually needed.
- Perform Data Binding to map the Image to your Data Set field. Use the Data property to bind the barcode to a data set column.
- Set the core properties
- Type = EAN13
- Data = 12 digit or 13 digit numeric value (via a BIRT expression or static string)
Note
If you provide 12 digits, the library automatically calculates the MOD 10 check digit and appends it to the encoded data and the HRI. If you provide 13 digits, the library validates the check digit. To avoid validation errors, it is recommended to provide only 12 digits and let the library compute the 13th.
EAN 13 Barcode Add on Symbol in BIRT
EAN 13 supports optional 2-digit or 5-digit add on symbols. These are used for supplementary information such as suggested retail price, issue numbers for magazines, or weight information. The add on symbol appears after the main barcode, separated by a special pattern.
- For a 2 digit add on: set Type = EAN13_2
- For a 5 digit add on: set Type = EAN13_5.
- Set the main barcode data in the Data property (12 or 13 digits).
- Set the supplement data in the UPC/EAN Supplement Data property. The supplement data must be exactly 2 or 5 numeric digits, matching the selected Type.
EAN 13 HRI (Human Readable Interpretation) Customization
The human readable interpretation (HRI) for EAN 13 consists of the 13 digits printed below the barcode bars. The GS1 standard recommends using the OCR B font for optimal optical character recognition. You can customize the HRI appearance using the Report Item Property view.
- Text Font: Set to OCR B with a preferred size (e.g., 10 or 11 points). If OCR B is not installed on the system, the library falls back to a default font (typically Arial or Tahoma). For consistent rendering across different servers, you may install the OCR B font or use a widely available fallback like Courier New.
- Text Margin: Defines the vertical space between the bottom of the barcode bars and the top of the HRI text. The minimum recommended space is 0.5X, but a value of 1X provides better visual separation. For example, if X = 2 pixels, set Text Margin = 2 pixels.
Note
If the OCR B font is not installed on the server where the BIRT Report Runtime executes, the barcode image will use a default font. This may affect compliance with GS1 standards. For production deployments, consider embedding the OCR B font or using a system independent font like Courier New which is monospaced and often acceptable.
Advanced EAN 13 Customization in BIRT
You can further customize the appearance of EAN 13 barcodes using additional properties that control the quiet zone indicator, lead digit spacing, and trail digit spacing.
Quiet Zone Indicator
The quiet zone is the blank area on the left and right sides of the barcode. EAN 13 requires a quiet zone of at least 11 modules. Some GS1 specifications allow a small marker (a short vertical line) at the edge of the quiet zone to indicate its boundary.
The Show Quiet ZoneIndicator property controls whether these markers are displayed.
- Default value: true (displays quiet zone markers).
- Set to false : Hides the quiet zone markers. This is often preferred for cleaner label designs.
Note: The quiet zone indicator is not part of the GS1 specification and is optional. It can be useful for debugging or for verifying that the quiet zone is correctly sized. In production retail labels, these indicators are usually omitted.
First and Last Digit Spacing
EAN 13 barcodes have the first digit (the leftmost digit of the 13 digit number) positioned slightly to the left of the barcode, and the last digit positioned to the right. By default, the library uses standard spacing. However, you can adjust the horizontal offset of these digits using the UPCEAN Lead Digit Space and UPCEAN Trail Digit Space properties.
- UPCEAN Lead Digit Space: Adds extra horizontal space (in pixels) before the first digit. Positive values move the first digit to the right; negative values move it to the left.
- UPCEAN Trail Digit Space: Adds extra horizontal space after the last digit. Positive values move the last digit to the right; negative values move it to the left.
Note
These properties affect only the HRI text, not the encoded barcode pattern. Use them sparingly. Excessive spacing may cause the digits to drift outside the quiet zone or overlap with other report elements.
Summary
This comprehensive guide has provided a complete, step by step workflow for generating EAN 13 barcodes in BIRT reports for Eclipse Java projects. All EAN 13 properties are configured in the Report Item Property view of the barcode report item, ensuring consistency and ease of management across your BIRT reports.
Using the BarcodeLib EAN 13 BIRT Generator, you can customize EAN 13 encoding, add on symbols, dimensions, and display properties to meet your BIRT report's specific requirements, whether for retail product labels, inventory management, or supply chain documentation. The plugin is mature, redistributable as a single JAR, and requires no registration key.