How to generate, print Code 128 barcode in BIRT reports?

Generate barcode Code 128 images in BIRT Reports

BIRT Code 128 Generator to Generate Code-128 in BIRT Reports, Code-128 Barcode Generation

  • Easy to generate Code 128 barcodes in BIRT reports
  • Simple to redistribute BIRT Code 128 barcode library (jar)
  • No registration key or activation code required
  • Generating high quality Code 128 Bar Code images in GIF, PNG, JPG format
  • Flexible barcode settings to adjust size, image, rotation, font, etc
  • Completely developed in Eclipse BIRT Custom Extended Report Item framework.
  • Mature BIRT Code128 barcode generation plugin using Java Barcode Generator library

This page will guide you through generating Code 128 (a high-density linear barcode symbology) images in BIRT (Business Intelligence and Reporting Tools) reports within Eclipse Java projects. All Code 128 property settings are configured exclusively in the Report Item Property view of your Report Design (.rptdesign) file, ensuring consistency and ease of management across your enterprise BIRT reports.


How to create, print Code 128 barcodes in Eclipse BIRT reports?

  1. Download BIRT Code 128 Generator plugin
  2. Install BIRT barcode generation plugin jar file into BIRT report project
  3. Start to Create










BIRT Barcode Code 128 Generator Introduction

Top
BIRT Barcode is an Eclipse BIRT Custom Extended Report Item which helps you easily generate and print high quality 1D (linear) and 2D (matrix) barcodes in your BIRT reports.

Barcode Code-128 Introduction

Code 128 is a very high-density barcode symbology. (A special version of it called GS1-128 is used extensively world wide in shipping and packaging industries.) It is used for alphanumeric or numeric-only barcodes.

BIRT Code 128 Generator - Valid Data Scope

  • All 128 characters of ASCII: A-Z, a-z, 0-9, etc
  • Values 128-255 in accordance with ISO 8859-1. There are referred to as extended ASCII.

Code 128 Generators

OnBarcode provides several Code 128 Generator components and software, including .NET Code 128 Generator, Java Code 128 Generator, C# Code 128 Generator, VB.NET Code 128 Generator, Code 128 Generator.




How to Generate Code 128 in BIRT Report

Top
Below is a simple Code 128 generation sample in BIRT Report. For more, view here: BIRT Barcode Generator - Developer Guide
  1. Copy com.onbarcode.barcode.birt_2.2.1.jar to Eclipse plugins directory "\eclipse\plugins\"
  2. Create a new empty report in your BIRT Report barcoding project
  3. Open View "Palette", and add report item "Barcode" to your created BIRT report
  4. Right click the report item you have added, and select "Properties" menu item to adjust barcode properties
  5. All barcode properties are in the "General" tab. Note that the values for "Data" and "UPC/EAN Supplement Data" should be arounded by """", unless you are inputting expression
  6. Preview the report and a Code 128 barcode image is printed on your BIRT report
  7. To encode barcode data from BIRT report data set, input expression to "Data" property like "row["CUSTOMERNUMBER"]"





BIRT Barcode Code 128 Generator - Property Settings

Top
Category Properties Value Comments
Basic Property: Data Type: expression
Default: ""
  • If you encode the barcode data text directly, the text string should be around by " " ", such as "12345"

  • If you encode the barcode data from dataset, input the expression, such as row["CUSTOMERNUMBER"]
Barcode value to encode.

Code 128 Valid Data Char Set:

  • all 128 characters of ASCII

  • values 128-255 in accordance with ISO 8859-1. There are referred to as extended ASCII.

Property: Add CheckSum Char Type: boolean
Default: false
Add CheckSum Char property is not applied here.
 
Code 128
Special
Property: Code 128 Code Set Type: int
Default: AUTO
4 valid code sets: AUTO, A, B, C
Property: processTilde Type: boolean
Default: false
Set the processTilde property to true, if you want use the tilde character "~" to specify special characters in the input data.

  • 1-byte character: ~0dd/~1dd/~2dd (character value from 000 ~ 255); ASCII character '~' is presented by ~126
    Strings from "~256" to "~299" are unused
  • 2-byte character (Unicode): ~6ddddd (character value from 00000 ~ 65535)
    Strings from "~665536" to "~699999" are unused
 
Barcode
Size
Related
Property: Unit of Measure Type: int
Default: 0 (pixel)
Unit of meature for all size related settings in the library.
Valid values: 0: pixel; 1: inch; 2: cm.
Property: X Type: float
Default: 1
Width of barcode bar module (narrow bar), default is 1 pixel
Property: Y Type: float
Default: 30
Height of barcode bar module, default is 30 pixel
Property: Left Margin Type: float
Default: 0
Barcode image left margin size.
Property: Right Margin Type: float
Default: 0
Barcode image right margin size.
Property: Top Margin Type: float
Default: 0
Barcode image top margin size.
Property: Bottom Type: float
Default: 0
Barcode image bottom margin size.
Property: Resolution (in dpi) Type: int
Default: 72
Barcode image resolution in DPI (Dots per inch).
Property: Rotate Type: int
Default: 0 (rotate angle in 0 degree)
Valid values:

  • 0 (rotate angle in 0 degree)
  • 90 (rotate angle in 90 degree)
  • 180 (rotate angle in 180 degree)
  • 270 (rotate angle in 270 degree)
 
Font
Style
Property: Show Text Type: boolean
Default: true
If true, display barcode data text under the barcode, otherwise do not display.
Property: Text Font Size Type: int
Default: 11
Barcode text font size.
Property: Text Margin Type: float
Default: 6
Space between barcode and barcode data text, default is 6 pixels


Code 128 Barcode Data Characters Encoding in BIRT Reports

Code 128 supports a wide range of data characters and code sets, all configurable in the Report Item Property view of the Image Report Item. Let's break down the key encoding details and how to configure them in BIRT.


Code 128 Data Character Set

Code 128 barcode supports the following data characters, which you can configure directly in the Report Item Property view:
  • All 128 Full ASCII characters defined in ISO/IEC 646. This is the default character set and works for most standard text data in BIRT reports (e.g., product IDs, URLs).
  • Extended ASCII characters (values 128-255 of ISO/IEC 8859-1, Latin Alphabet 1) are supported using the Function Character (FNC4). You don't need to manually input FNC4. Enable the "SupportExtendedASCII" property in the Report Item Property view, and the library will automatically encode these characters.
  • 4 non-data function characters (FNC1-FNC4), which we'll cover in detail later.
  • 4 code set selection characters, used to switch between Code 128's three data code sets.
  • 3 Start characters (one for each code set), which initiate the barcode encoding.
  • 1 Stop character, which terminates the barcode and ensures proper scanning.



Code 128 Data Code Sets in BIRT

Code 128 barcode has three unique data code sets, each with a subset of ASCII characters and auxiliary characters. You can configure the code set in the Report Item Property view:
  • Code Set A: Supports ASCII characters 00-95 (control characters and uppercase letters) and special characters. Ideal for data that includes control characters (e.g., tabs, line feeds).
  • Code Set B: Supports ASCII characters 32-127 (printable characters, lowercase letters, uppercase letters, and symbols). Ideal for most standard text data in BIRT reports.
  • Code Set C: Supports numeric pairs (00-99), allowing efficient encoding of numeric data (each pair encodes two digits in a single codeword). Ideal for large numeric data (e.g., serial numbers, phone numbers).
Configuring code sets in BIRT is simple:
  • To let the library automatically select the best code set (recommended for most BIRT reports), set the "BarcodeType" property to "CODE128" in the Report Item Property view. The library will analyze the data and choose the most efficient code set.
  • To manually select a code set, set the "BarcodeType" property to:
    • "CODE128A" for Code Set A
    • "CODE128B" for Code Set B
    • "CODE128C" for Code Set C


Note: Manually selecting a code set that is incompatible with your data (e.g., Code Set C for non-numeric data) will cause encoding errors. Always use the "CODE128" auto-selection option if you're unsure about the data type.


Code 128 Function Characters (FNC) in BIRT

Function Characters (FNC) define instructions to barcode reading devices for special operations. You don't need to manually input FNC characters. Enable the appropriate property in the Report Item Property view, and the library will automatically encode them:
  • FNC1: Used for GS1 system data (GS1-128). Enable the "FNC1Enabled" property in the Report Item Property view to encode GS1 data (we'll cover this in detail later).
  • FNC2: Used for message append. Enable the "FNC2Enabled" property if you need to append multiple Code 128 barcodes into a single message.
  • FNC3: Instructs the barcode reader to interpret the data as instructions for initialization or reprogramming. Enable the "FNC3Enabled" property if your use case requires this functionality.
  • FNC4: Used to represent Extended ASCII characters (values 128 - 255). Enable the "SupportExtendedASCII" property (which automatically uses FNC4) to encode these characters.


Code 128 Check Digit in BIRT

Code 128 barcode requires a mandatory check digit (checksum) character, calculated using module 103 (mod 103). Here's how it works in BIRT:
  • The check digit is automatically calculated and added by the Code 128 library. You do not need to manually configure it.
  • The check digit is not displayed in the Human Readable Interpretation (HRI) and will not be returned by barcode decoders.
  • The "AddCheckSum" property (common in barcode libraries) is not applicable for Code 128. The library will always calculate and add the check digit before the Stop character, regardless of this property's setting.


Code 128 Barcode Human Readable Interpretation (HRI) in BIRT

The Human Readable Interpretation (HRI) is the text displayed alongside the Code 128 barcode (typically below or above it). It should be printed without violating the barcode's quiet zones, and you can configure its position and appearance in the Report Item Property view.


Render HRI Below the Code 128 Barcode

By default, most Code 128 libraries render the HRI below the barcode. To configure this in BIRT:
  • Select the Image Report Item and open the Report Item Property view.
  • Enable the "ShowHRI" property (set to "true"). This displays the HRI text.
  • Set the "HRIPosition" property to "Below" (this is the default setting for most libraries).
  • Configure HRI formatting (font, size, color) using the "HRIFont", "HRIFontSize", and "HRIFontColor" properties in the Report Item Property view.
  • Ensure the "BottomMargin" property is set to a sufficient value to avoid overlapping the HRI with other Report Items.



Code 128 Barcode Dimension Size in BIRT Reports

Customize the size and dimensions of your Code 128 barcodes in BIRT reports using the Report Item Property view. You can adjust module size, height, quiet zones, and unit of measure to ensure scannability. All aligned with BIRT's layout features.

The following Code 128 dimension settings are configurable in the Report Item Property view:
  • UOM (Unit of Measure): Select the unit for size settings (PIXEL, CM, or INCH). This ensures consistency with the report's Master Page settings.
  • X (Width of narrow element): The width of each Code 128 module. The minimum module width is defined by your application's specifications; smaller modules create smaller barcodes but may be harder to scan, especially in printed BIRT reports.
  • Y (Bar module height): The height of the Code 128 barcode. A minimum height of 10mm (or 40 PIXEL) is recommended for scannability.
  • Quiet Zones: Set "LeftMargin" and "RightMargin" to define the empty space around the Code 128. The minimum quiet zone width is 10X (10 times the narrow element width), as per Code 128 standards.
  • TopMargin/BottomMargin: Control the space above and below the barcode, especially important if the HRI is enabled.













Common Asked Questions

What is the barcode Code 128 text code?

Code 128 barcode is a high-density 1d barcode symbology, which encodes digits, letters, control characters, and full ASCII 128 characters. Using BIRT barcode generator plugin, you can easily encode, create, insert, customize and print Code 128 barcode images in BIRT report template in Exclipse BIRT IDE.

What is Code 128 barcode used for?

Code 128 barcode is a common linear barcode type used in:
  • Food and non-food industries
  • Shipping and packing industry
  • Health, public sector and government bodies
You can easily create, print standard Code 128 barcode images in Eclipse Report Designer using OnBarcode BIRT Barcode Generator plugin.

What is the check digit for code 128?

Code 128 barcode contains a mandatory check digit (checksum) character, which is based on module 103 (mod 103). Using BIRT barcode blugin, the generator software will automatically calculate the check character and insert into the Code 128 barcode in BIRT reports.

What is Code 128 barcode maximum length?

The Code 128 ISO standard does not define the maximum number of characters in a single Code 128 barcode.

However some Code 128 standards will provide the limits. GS1-128 has limits the maximum length of Code 128 data to 48 characters.

Using Eclipse BIRT Barcode plugin, you will encode and generate ISO standard Code 128 and application approved Code 128 barcodes, such as GS1-128 in BIRT Designer and BIRT Report Viewer.

How to scan, read Code 128 barcodes?

You can download and install OnBarcode free Code 128 barcode scanner software, or use barcode scanner device, or 3rd party apps installed on phone to read and scan the Code 128 barcodes. OnBarcode provides Java Barcode Reader library to scan, read Code 128 and other 2d, 1d barcodes in Java application.

Is Code 128 barcode better than Code 39?

Both Code 128 and Code 39 are popular linear barcode symbologies. Code 128 is more compact than Code 39, supporting more data to be encoded in a smaller space. BIRT Barcode Generator allows report application developers to encoding and printing both Code 128 and Code 39 in Eclipse BIRT report web and desktop applications.




































Terms of Use | Privacy Policy
Copyright © OnBarcode.com . All rights reserved.