Data Matrix Data Encoding: Character Sets & Lengths
Data Matrix supports various character sets, data lengths, and encoding modes. All these settings are configured in the Report Item Property view of the Image Report Item, ensuring alignment with BIRT best practices.
Valid Character Sets
Data Matrix encodes multiple character sets, which you can configure in the Report Item Property view:
- Full ASCII (0 - 127): Use DataMatrixDataMode.ASCII. This is the default encoding mode and works for most standard text data (e.g., URLs, plain text IDs) in BIRT reports.
- Extended ASCII (128 - 255): Also supported via ASCII mode. Supports special characters such as accented letters, currency symbols, and punctuation marks, which are common in international BIRT reports.
- International Characters (Arabic, Cyrillic, etc.): These can be supported by enabling the Extended Channel Interpretation (ECI) protocol in the Report Item Property view. The ECI protocol allows Data Matrix to encode non-ASCII character sets by specifying a character set identifier, which is critical for Locale/Internationalization in BIRT reports.
Maximum Data Length
The maximum data length of a Data Matrix depends on its encoding mode and error correction level. You can check these limits in the Report Item Property view's "Data Matrix" section, and use a Filter to ensure your data does not exceed the limit:
Capacity varies by encoding mode (Version 200):
Capacity varies by encoding mode (Version 200):
- Numeric data: Up to 3,116 digits.
- Alphanumeric data: Up to 2,335 characters.
- Byte data (8-bit): Up to 1,555 characters.
Note: Exceeding the maximum length for your selected mode will cause encoding errors. Use a Filter to validate data length before generation.
Data Matrix Encoding Data Modes
Data Matrix uses six primary encoding modes, which the generator can auto-select or you can manually set in the Report Item Property view. The "DataMode" property in the Report Item Property view controls this setting:
Available modes in Report Item Property:
Available modes in Report Item Property:
- DataMatrixDataMode.Auto: Automatic selection (recommended)
- ASCII: For digits and standard ASCII
- C40: For uppercase alphanumeric
- Text: For lowercase alphanumeric
- X12: For ANSI X12 EDI data
- Edifact: For ASCII 32 - 94
- Base256: For full byte values 0 - 255
Note:
Manually selecting an incompatible encoding mode (e.g., ASCII Mode for Unicode text) will cause encoding errors. Always use Auto Mode if you're unsure about the data type, or verify the Data Set field's data type before selecting a mode.
Data Matrix Complex Text Encoding in BIRT reports
We'll walk you through encoding more complex data types in Data Matrix barcodes within BIRT reports, including ASCII non-printable characters, Unicode text, binary data, and GS1 data elements. All steps use the Report Item Property view and BIRT Scripting features.
Encode ASCII Non-Printable Characters
Some ASCII characters (e.g., Carriage Return [CR], Line Feed [LF], Tab) are non-printable and cannot be directly input in your Java code or BIRT Data Set.
Follow these steps to encode them:
Follow these steps to encode them:
- Set ProcessTilde = true
- Set DataMode = Base256
- Encode characters as ~ddd (e.g., ~013 for CR). Example data value: Data~013Matrixs
Note:
Forgetting to set "ProcessTilde" to "true" will cause the tilde (~) to be treated as plain text, resulting in an invalid Data Matrix that cannot be scanned correctly.
Encode Unicode Text
Data Matrix can easily encode Unicode text (e.g., Chinese, Japanese, Arabic) in BIRT reports. Follow these steps to configure this in the Report Item Property view:
- Set EncodeUnicodeText = true in Report Item Property
- Bind Unicode data from your Data Set using Data Binding
- The BIRT Event Handler converts text to UTF-8 bytes automatically
Additional Supported Data Formats
Data Matrix supports additional data formats that are useful in enterprise BIRT reports. Configure these in the Report Item Property view and use BIRT Scripting for advanced logic:
- Binary data
- GS1-compliant data messages
- Structured Append for large data
Data Matrix Dimension & Size Settings
Customize the size and dimensions of your Data Matrix barcodes in BIRT reports using the Report Item Property view. You can create square or rectangular Data Matrix barcodes, adjust module size, and set quiet zones to ensure scannability. All aligned with BIRT's layout features.
Fixed-Size Square Data Matrix
- Set BarcodeWidth to your desired pixel size.
- The height will automatically match the width (square format).
Rectangular Data Matrix (ECC200)
Data Matrix (ECC200) specifies 6 rectangular symbols, which you can generate in BIRT reports via the Report Item Property view:
- 8×18, 8×32, 12×26, 12×36, 16×36, 16×48
- Set FormatMode to your preferred dimension (e.g., Format_16X48)
- Set BarcodeWidth and BarcodeHeight with correct aspect ratio
- Adjust margins in Report Item Property
Advanced Dimension Properties
For precise control over Data Matrix dimensions, use the advanced size settings in the Report Item Property view.
You can fully customize barcode size:
- UOM (Unit of Measure: PIXEL, CM, INCH)
- X (module width)
- LeftMargin, RightMargin, TopMargin, BottomMargin (quiet zones)
- Resolution (for high-resolution printing)
Note: Quiet zone margins must be at least 1X. Scanners may fail to read barcodes with insufficient margins.
Data Matrix Color & Image Output Settings
Customize the color scheme and image output format of your Data Matrix barcodes in BIRT reports using the Report Item Property view. These settings ensure your Data Matrix barcodes are visible and compatible with different BIRT Output Formats (e.g., PDF, HTML, Excel, Word).
Data Matrix Colors
By default, Data Matrix uses a dark module color (black) and light background color (white). You can customize these colors in the Report Item Property view to align with your BIRT report's branding:
Dark modules with light background
Light modules with dark background
- ForeColor: Module (bar) color
- BackColor: Background color. Support transparent background color.
- Support for dark-on-light and light-on-dark styles
Dark modules with light background
Light modules with dark background
Note: Transparent Background: Enable the "TransparentBackColor" property in the Report Item Property view to make the Data Matrix's background transparent. This is useful if the BIRT report has a custom background color or image (added via the Master Page).
Image Output Formats
Configure the image format and quality of your Data Matrix barcodes in the Report Item Property view to support different BIRT Output Formats.
BIRT supports multiple raster and vector formats:
The BIRT Report Engine will render the barcode into the Report Document (.rptdocument) during runtime.
BIRT supports multiple raster and vector formats:
- PNG, JPEG, BMP
- SVG
The BIRT Report Engine will render the barcode into the Report Document (.rptdocument) during runtime.
Note: SVG Vector format is not supported by all BIRT Output Formats. Test the report export to ensure the Data Matrix renders correctly in your target format (e.g., PDF, Word) before deployment.
Advanced Data Matrix Options
Take advantage of advanced Data Matrix features in BIRT reports, including Format Mode selection, Structured Append mode, and FNC1 for GS1 compliance. All these options are configured in the Report Item Property view, ensuring integration with BIRT's advanced reporting capabilities.
Format Mode (Symbol Size)
Data Matrix ISO standard specifies 24 square symbols and 6 rectangular symbols available in ECC 200. Each symbol size includes different rows and columns with different data storage capacity. Configure the Format Mode in the Report Item Property view:
Set FormatMode such as:
If data exceeds capacity, the engine auto-upgrades to a larger symbol.
Set FormatMode such as:
- Format_20X20
- Format_48X48
- Format_16X48 (rectangle)
If data exceeds capacity, the engine auto-upgrades to a larger symbol.
Structured Append Mode
Structured Append mode allows you to split large data into multiple Data Matrix barcodes, which can be scanned in sequence to reconstruct the full data. This is useful for encoding large documents or datasets in BIRT reports (e.g., detailed product descriptions, batch information). Configure this mode in the Report Item Property view:
Enable in Report Item Property:
Enable in Report Item Property:
- StructuredAppend = true
- SymbolCount: total symbols
- SymbolIndex: sequence number (starts at 0)
- FileId: unique ID for all linked barcodes
FNC1 First Position (GS1 Compliance)
When FNC1 (Function Code 1) is in the first position of a Data Matrix, it signals that the encoded data conforms to the GS1 Application Identifier (AI) standard. This is commonly used in supply chain, retail, and healthcare BIRT reports. Configure this in the Report Item Property view:
- Set FNC1 = FNC1_1ST_POS in Report Item Property
Summary
You now have a complete, step-by-step guide to generating Data Matrix barcodes in BIRT reports for Eclipse Java projects. All Data Matrix properties are configured in the Report Item Property view of the Image Report Item, ensuring consistency and ease of management across your BIRT reports.
Using OnBarcode Data Matrix Barcode BIRT Generator, you can customize Data Matrix encoding, size, color, and advanced features (Structured Append, FNC1) to meet your BIRT report's specific requirements, whether for supply chain, retail, or enterprise reporting.
Using OnBarcode Data Matrix Barcode BIRT Generator, you can customize Data Matrix encoding, size, color, and advanced features (Structured Append, FNC1) to meet your BIRT report's specific requirements, whether for supply chain, retail, or enterprise reporting.
Common Asked Questions
What is a data matrix code?
A data matrix code is a 2-dimensional code that is made of black and white cells that are usually arranged in a square pattern.
Using BIRT barcode generator plugin, you can easily encode, create, customize and print Data Matrix barcodes in BIRT Report Designer property editor.
What is the ISO standard for Data Matrix?
Data Matrix ISO specification is ISO/IEC 16022, and the latest standard version is ISO/IEC 16022:2024.
BIRT Barcode Generator plugin fully support ISO compatible Data Matrix generations in Eclipse BIRT reports.
What are the different types of Data Matrix?
According to Data Matrix latest ISO specification, there are two versions of Data Matrix
- ECC 000-140
- ECC 200.
How much data can a Data Matrix store?
It depends on the Data Matrix encoding data formats.
- Alphanumeric data: up to 2,335 characters
- Byte data (8-bit): 1,555 characters
- Numeric data: 3,116 digits
What is the minimum and maximum size of Data Matrix barcode?
The minimum size of Data Matrix is 10 x 10 modules. And the maximum size of Data Matrix is 144 x 144 modules.
OnBarcode BIRT Barcode generator plugin supports all formats defined in Data Matrix ISO standard. You can customize the Data Matrix format through
BIRT Report Designer property editor.
Can a phone scan a Data Matrix?
Yes. You can scan a Data Matrix using your iPhone with your 3rd party app installed.
Is a Data Matrix the same as a QR Code?
No. They are not the same barcode symbologies. Data Matrix and QR Code have lot of same features. They are both 2d barcodes, and enable to encode ASCII text, Unicode text, binary data.
Both of them are encoding GS1 business data messages.
BIRT Barcode Generator plugin fully supports both Data Matrix and QR Code generations in BIRT reports in Java web and desktop applications.
