BIRT Barcode QR Code Generator Introduction
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 QR-Code Introduction
QR Code is a matrix code (or two-dimensional bar code) created by Japanese corporation Denso-Wave in 1994. The "QR" is derived from "Quick Response", as the creator intended the code to allow its contents to be decoded at high speed.
BIRT QR-Code Generator - Valid Data Scope
- numeric data (digits 0 - 9);
- alphanumeric data (digits 0 - 9; upper case letters A -Z; nine other characters: space, $ % * + - . / : );
- byte data (default: ISO/IEC 8859-1);
- Kanji characters
QR Code Generators
OnBarcode provides several QR Code Generator components and software, including .NET QR Code Generator, Java QR Code Generator, C# QR Code Generator, VB.NET QR Code Generator, iPhone QR Code Generator, iPad QR Code Generator, Android QR Code Generator, QR Code Generator.
How to Generate QR Code in BIRT Report?
- Copy com.onbarcode.barcode.birt_2.2.1.jar to your Eclipse plugins directory "\eclipse\plugins\"
- Create a new empty report in BIRT Report barcoding project
- Drag report item "Barcode" from "Palette" to your created BIRT report
- Right click the report item you have added, and select "Properties" menu item to edit barcode parameters
- Now all barcode properties are in the "General" tab. When inputting values for "Data" and "UPC/EAN Supplement Data", it should be arounded by """", unless you are inputting expression
- Change Barcode Type into QR Code in the general tab, click preview, and a QR Code barcode image is printed on your BIRT report
- To encode barcode data from BIRT report data set, you need to input expression to "Data" property like "row["CUSTOMERNUMBER"]"
BIRT Barcode QR Code Generator - Property Settings
| Category | Properties | Value | Comments | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Basic | Property: Data | Type: expression
Default: ""
|
Barcode value to encode
QRCode Valid Data Char Set:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| QRCode Special |
Property: Process Tilde | Type: boolean
Default: true |
Set the Process Tilde property to true, if you want use the tilde character "~" to specify special characters in the input data. Default is true.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Property: QRCode Data Mode | Type: int
Default: AUTO |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Property: QRCode Error Correction Level | Type: int
Default: L |
QRCode Error Correction Level.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Property: QRCode FNC1 Mode |
Type: int
Default: NONE |
To encode GS1 compatible QR-Code barcode, you need set FNC1 Mode value to "ENABLE". | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Property: QRCode Version | Type: int
Default: 1. |
Valid values are from 1 to 40. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Property: 2D Barcode Structured Append |
Type: boolean
Default: false |
Set Structured Append property to true, then Structured Append is enabled. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Property: 2D Barcode Symbol Count |
Type: int
Default: 0 |
Set Symbol Count property to the number of total symbols which make the sequence. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Property: 2D Barcode Symbol Index |
Type: int
Default: 0 |
Set Symbol Index property to the position of current symbol in the secuence (Start with 0). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Property: 2D Barcode File Id |
Type: int
Default: 0 |
Set File Id property to be identified to the same file. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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: 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:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
QR Code Data Encoding in BIRT Reports
After completing these steps, the BIRT Report Engine will render a valid QR Code in your report.
Next, we will explore advanced QR Code data encoding settings in the Report Item Property view.
Next, we will explore advanced QR Code data encoding settings in the Report Item Property view.
- QR Code data encoding
- QR Code data mode
- Maximum Data Length
QR Code Encodable Character Set
QR Code supports the following data types in BIRT reports:
- Numeric data (0 - 9)
- ASCII text
- Unicode multilingual text
- Byte data (ISO/IEC 8859‑1 default)
- Kanji characters
QR Code Data Mode
QR Code Data Mode controls how your data is encoded. Choosing the right mode makes QR Codes smaller and more scannable.
The system automatically optimizes encoding efficiency based on input content.
All DataMode settings are configured in the Report Item Property panel of your Image item. You can muanlly choose one of them.
The system automatically optimizes encoding efficiency based on input content.
All DataMode settings are configured in the Report Item Property panel of your Image item. You can muanlly choose one of them.
- Auto Mode: Library automatically selects optimal encoding.
- Numeric Mode: For digit‑only data.
- AlphaNumeric Mode: For uppercase letters, numbers, and symbols.
- Byte Mode: For binary and extended character sets.
- Kanji Mode: For JIS X 0208 Kanji characters.
Note:
Set DataMode to Auto in Report Item Property for optimal encoding behavior.
Mismatched DataMode and data type (e.g., using "Numeric" for text) will cause encoding errors or unreadable QR Codes. Always double-check your Data Set field type before setting DataMode.
Mismatched DataMode and data type (e.g., using "Numeric" for text) will cause encoding errors or unreadable QR Codes. Always double-check your Data Set field type before setting DataMode.
Maximum Data Length in QR Code (Version 40-L)
QR Codes have a maximum data capacity, depending on the encoding mode and QR Code Version (Version 40-L is the largest).
This is critical for BIRT reports with large data (e.g., long product descriptions or multiple data points). Here are the limits for Version 40-L:
If your Data Set has longer data, use Structured Append mode (covered later) to split the data across multiple QR Codes.
- Numeric data: 7,089 characters
- Alphanumeric data: 4,296 characters
- Byte data: 2,953 characters
- Kanji data: 1,817 characters
If your Data Set has longer data, use Structured Append mode (covered later) to split the data across multiple QR Codes.
Complex QR Code Text Encoding in BIRT Reports
Let's cover how to encode special text formats (ASCII non-printable characters, Unicode text) in BIRT reports.
Common for enterprise use cases like barcoding documents or international reports.
All properties below are configured in the Report Item Property panel.
All properties below are configured in the Report Item Property panel.
Encoding ASCII Non-Printable Characters
ASCII non-printable characters (e.g. Carriage Return [CR], Tab) don't have visible labels, but you can encode them in BIRT QR Codes using the Report Item Property panel. Here's how:
- In Report Item Property, set ProcessTilde to true.
- Set DataMode to Auto.
- Represent non-printable characters as three-digit ASCII values in the Data field.
- Data: ~013
- ProcessTilde: true
- DataMode: Auto
Note: Incorrect ASCII code formatting will lead to invalid QR Code image output in BIRT report.
Encoding Unicode Text
QR Codes don't support Unicode text (e.g., Thai, Arabic, Greek) natively, but BIRT lets you work around this using binary data encoding methods: converting text to UTF-8 byte arrays.
Here's the step-by-step for BIRT reports:
- Set ProcessTilde to true.
- Set DataMode to Byte.
- Encode non-English text into UTF-8 bytes and format as ~ddd strings.
Generating GS1 QR Codes
GS1 QR Codes are used in supply chain and retail reports to encode standardized data (e.g., product expiration dates, batch numbers). They require specific settings in the Report Item Property panel:
- Set FNC1 to FNC1_1ST_POS.
- Enter GS1-formatted data with AI codes enclosed in parentheses. Example data value: (17)050101(10)ABC123
Note: GS1 data must follow strict formatting. AI codes must be in parentheses, and data lengths must match AI requirements
(e.g., AI 17 = 6 digits for date). Incorrect formatting will make the QR Code unreadable by GS1 barcode scanners.
Binary Data Encoding
Most 2D barcodes (including QR Codes) support binary data encoding. Useful for BIRT reports that need to encode files or raw data. Here's how to do it:
Configure DataMode to Byte in Report Item Property to accept raw byte streams.
Configure DataMode to Byte in Report Item Property to accept raw byte streams.
Note: For large binary data, use Structured Append mode (covered later) to split the data across multiple QR Codes in your BIRT report.
Encoding Japanese Kanji Text
Kanji characters (JIS X 0208) can be compacted into 13 bits for smaller QR Codes. Here's how to encode them in BIRT:
- Set ProcessTilde to true.
- Set DataMode to Kanji.
- Enter Kanji values formatted as ~9ddddd based on JIS X 0208.
QR Code Dimension and Appearance Customization
QR Code Dimension (Width/Height)
QR Codes are square, so setting the width will automatically set the height. Here's how:
In Report Item Property, set BarcodeWidth to control QR Code pixel dimensions.
This creates a square QR Code with consistent width and height.
In Report Item Property, set BarcodeWidth to control QR Code pixel dimensions.
This creates a square QR Code with consistent width and height.
Quiet Zones
Quiet zones are empty spaces around the QR Code (required for scanners to read it). You can set them in the Report Item Property panel using four properties:
- LeftMargin
- RightMargin
- TopMargin
- BottomMargin
Note: Skipping quiet zones or setting them too small will make QR Codes unreadable. Ensure quiet zones don't overlap with other Report Items (e.g., Label or Data items) in your layout.
Color and Appearance Settings
BIRT lets you customize QR Code colors (bar and background) and image quality directly in the Report Item Property panel. Great for matching your report's branding or Style.
Customize QR Code colors in Report Item Property:
Customize QR Code colors in Report Item Property:
- Set ForeColor for module color
- Set BackColor for background color
- Enable high-resolution output for printing purposes
Advanced QR Code Parameters
For enterprise-level BIRT reports, you may need advanced QR Code settings like error correction, version control, or structured append. All these are configured in the Report Item Property panel.
Error Correction Level (ECL)
QR Codes use Reed-Solomon error correction to recover data if the QR Code is damaged. There are four levels (set via "ECL" in the Property panel):
- L: 7% (default)
- M: 15%
- Q: 25%
- H: 30%
QR Code Version
QR Codes have 40 versions (Version 1 to Version 40), with Version 40 being the largest.
The version determines the QR Code's size and data capacity. You can set the version in the Report Item Property panel:
Select a version in Report Item Property to control symbol size.
Select a version in Report Item Property to control symbol size.
Structured Append Mode
For large data that exceeds the maximum QR Code capacity, use Structured Append mode to split the data across up to 16 QR Codes. Here's how to configure it in BIRT:
Configure these properties:
Configure these properties:
- StructuredAppend: true
- SymbolCount: total number of symbols
- SymbolIndex: sequence position of the current symbol
FNC1 in First Position
This mode identifies GS1-compliant barcode data.
Set FNC1 to FNC1_1ST_POS in Report Item Property.
This tells scanners that the QR Code contains GS1-formatted data, ensuring compatibility with supply chain systems.
Set FNC1 to FNC1_1ST_POS in Report Item Property.
This tells scanners that the QR Code contains GS1-formatted data, ensuring compatibility with supply chain systems.
Extended Channel Interpretation (ECI) Mode
ECI lets you use non-default character sets (e.g., ISO/IEC 8859-11 for Thai) in QR Codes. This is useful for BIRT reports with international text. Here's how to configure it:
- Set a 6-digit ECI value (e.g., 13 for Thai ISO/IEC 8859-11).
- Enable ProcessTilde.
- Use Byte mode to encode characters as ~ddd values.
Note: Invalid ECI values may cause garbled text or scanning failures.
Validate Printed QR Code in Report
Now that you've configured your QR Codes, it's time to validate them to ensure they work correctly in your BIRT report.
This phase confirms that QR Codes render properly, encode the right data, and work across different Output Format types.
- Run the BIRT report: In Eclipse, right-click your Report Design (.rptdesign) file > Run As > BIRT Report. This launches the BIRT Web Viewer (web component for viewing, interacting, and exporting reports).
- Visually inspect the QR Codes: Ensure they appear in the ImageReport Item without distortion. Check that quiet zones are visible and QR Codes don't overlap with other elements (e.g., Table rows or Label items).
- Test BIRT Runtime deployment: If you're deploying the report to a server (e.g., Tomcat), deploy the report and verify QR Codes render correctly in the server-side BIRT Web Viewer.
Common Asked Questions
What does QR stand for in code?
QR stands for "quick response", and QR Code is a 2-dimensional matrix barcode on steroids. The QR code stores data information both horizontally and vertically.
OnBarcode BIRT Barcode Generator plugin supports QR Code generation in Eclipse BIRT reports, and customizes QR Code appearance in Report Designer Property Editor, and
preview the reports with QR Code images in report viewer.
What is the smallest size a QR Code can be printed?
If your QR Code will be scanned by QR Code scanner devices, the the minimum size for a QR Code is 1 x a cm. However if the QR Code will be scanned by smartphones (iOS or Android),
most the barcode scanner app requires that the minimum size for a QR Code is 2 x 2 cm.
Using BIRT QR Code Generator plugin, you can create and customize the printed QR Code dimension size through QR Code image size in the Report Designer in Eclipse BIRT IDE.
Using BIRT QR Code Generator plugin, you can create and customize the printed QR Code dimension size through QR Code image size in the Report Designer in Eclipse BIRT IDE.
How to create a QR Code for a picture?
To create a QR code from a photo or an image in Java BIRT project
- Convert the photo image raw data into byte array
- Insert a Barcode with QR Code format in the BIRT report designer
- Set the QR Code data mode in property
QRCode Data Modein BIRT Property Editor with valueAUTO - Check property
Process Tilde - Print and output QR Code to an image file in BIRT report viewer
Does the color of a QR Code matter?
Choose whatever colors you want but always make sure the back and fore colors have strong contrast.
We suggest at least 70% darker to ensure reliable scanning, and always scan and verify your QR code to make sure it works using the colors you've chosen.
Using BIRT Barcode plugin, you will draw, insert and print QR Code in BIRT reports with black bar modules and white space modules.
Using BIRT Barcode plugin, you will draw, insert and print QR Code in BIRT reports with black bar modules and white space modules.
How much data can be stored in a QR code?
A standard QR Code can store up to three kilobytes (KB) of data. A QR Code symbol with version 40-L can hold the following data information:
- numeric data: 7,089 characters
- alphanumeric data: 4,296 characters
- byte data: 2,953 characters
- Kanji data: 1,817 characters
What is the difference between a barcode and a QR Code?
Barcode is usually known as 1d or linear barcode symbology, which can store limited number of characters.
QR Code or Quick Response code, is a type of two-dimensional code that can hold more than 4,200 alphanumeric characters.
Using OnBarcode BIRT Barcode Generator plug-in, you can create QR Code (standard, GS1, Micro, Macro versions) and other 20+ 2d, 1d barcodes such as Code 128, Data Matrix, EAN/UPC barcodes in Eclipse BIRT reports, customize the QR Code and barcodes in Report Designer, and print, preview the QR Code encoding data from database in report viewer.
Using OnBarcode BIRT Barcode Generator plug-in, you can create QR Code (standard, GS1, Micro, Macro versions) and other 20+ 2d, 1d barcodes such as Code 128, Data Matrix, EAN/UPC barcodes in Eclipse BIRT reports, customize the QR Code and barcodes in Report Designer, and print, preview the QR Code encoding data from database in report viewer.