How to generate, print QR Code in BIRT reports?

Generate barcode QR Code images in BIRT Reports

Generate QR-Code in BIRT Reports, QR Code Barcode Generation using BIRT Barcode Generator

  • Easy to generate QR Code barcodes in BIRT reports
  • Simple to redistribute BIRT QR Code barcode library (jar)
  • No registration key or activation code required
  • Generating high quality QR Code Bar Code images in GIF, PNG or JPG format
  • Completely developed in Eclipse BIRT Custom Extended Report Item framework.
  • Mature BIRT QRCode barcode generation plugin using Java Barcode Generator library
This page will guide you through dynamically generating and displaying QR Code images in BIRT (Business Intelligence and Reporting Tools) reports integrated into Eclipse Java projects. It follows standardized BIRT development processes, provides detailed QR Code customization examples, and includes key notes for avoiding runtime exceptions.


How to create, print QR Codes in Eclipse BIRT reports?

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












BIRT Barcode QR Code 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 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





How to Generate QR Code in BIRT Report?

Top
  1. Copy com.onbarcode.barcode.birt_2.2.1.jar to your Eclipse plugins directory "\eclipse\plugins\"
  2. Create a new empty report in BIRT Report barcoding project
  3. Drag report item "Barcode" from "Palette" to your created BIRT report
  4. Right click the report item you have added, and select "Properties" menu item to edit barcode parameters
  5. 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
  6. Change Barcode Type into QR Code in the general tab, click preview, and a QR Code barcode image is printed on your BIRT report
  7. 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

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

QRCode Valid Data Char Set:
  • 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

 
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.
  • 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
  • for GS1 AI Code:
    ~ai2: AI with 2 digits
    ~ai3: AI with 3 digits
    ~ai4: AI with 4 digits
    ~ai5: AI with 5 digits
    ~ai6: AI with 6 digits
    ~ai7: AI with 7 digits
  • ECI: ~7dddddd (valid value of dddddd from 000000 to 999999)
  • SJIS: from ~9ddddd (Shift JIS 0x8140 ~ 0x9FFC and 0xE040 ~ 0xEBBF)
Property: QRCode Data Mode Type: int
Default: AUTO
  • AUTO : It allows encoding all 256 possible 8-bit byte values. This includes all ASCII characters value from 0 to 127 inclusive and provides for international character set support
  • ALPHANUMERIC: It allows encoding alphanumeric data (digits 0 - 9; upper case letters A -Z; nine other characters: space, $ % * + - . / : ).
  • BYTE : It allows encoding byte data (default: ISO/IEC 8859-1).
  • NUMERIC : It allows encoding numeric data (digits 0 - 9).
  • KANJI : It allows encoding Kanji characters.
Property: QRCode Error Correction Level Type: int
Default: L
QRCode Error Correction Level.
  • L
  • M
  • Q
  • H
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:

  • 0 (rotate angle in 0 degree)
  • 90 (rotate angle in 90 degree)
  • 180 (rotate angle in 180 degree)
  • 270 (rotate angle in 270 degree)






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.
  • 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.
  • 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.


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:
  • 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.


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:
  1. In Report Item Property, set ProcessTilde to true.
  2. Set DataMode to Auto.
  3. Represent non-printable characters as three-digit ASCII values in the Data field.
Example configuration for a carriage return (CR) character:
  • 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:
  1. Set ProcessTilde to true.
  2. Set DataMode to Byte.
  3. 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:
  1. Set FNC1 to FNC1_1ST_POS.
  2. 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.

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:
  1. Set ProcessTilde to true.
  2. Set DataMode to Kanji.
  3. 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.


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:
  • Set ForeColor for module color
  • Set BackColor for background color
  • Enable high-resolution output for printing purposes
You may also configure transparent backgrounds for better report integration.



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%
Set the ECL property to adjust data recovery capability.


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.


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:
  • 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.


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:

  1. Set a 6-digit ECI value (e.g., 13 for Thai ISO/IEC 8859-11).
  2. Enable ProcessTilde.
  3. 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.

  1. 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).

  2. 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).

  3. 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.

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 Mode in BIRT Property Editor with value AUTO
  • 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.

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
Using BIRT Barcode, you will get the QR Code encoding data from database and print the QR Code images in BIRT reports.

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.




































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