Back to Devexpress

Micro QR Code

xtrareports-405176-feature-guide-to-devexpress-reports-use-report-controls-use-bar-codes-micro-qr-code.md

latest6.1 KB
Original Source

Micro QR Code

  • Feb 18, 2026
  • 4 minutes to read

A Micro QR Code is a two-dimensional code. It is a more compact version of a standard QR code: a Micro QR Code can encode up to 35 numeric characters or 21 alphanumeric characters, enough to store a product ID or a short URL. In comparison, a standard QR code can contain up to 7,089 characters.

Micro QR Codes are often used in industries such as electronics, medical devices, and retail, where space-efficient labeling is essential.

Refer to the following article for more information: Micro QR Code.

Version Comparison

VersionSize (Modules)Numeric CapacityAlphanumeric CapacityBinary Capacity (Bytes)Error Correction LevelsUse Case
M111×115 charactersN/AN/ADetection only (D)Ideal for minimal numeric data in space-constrained environments.
M213×1310 characters6 characters4 bytesLevel L (7%)Small data capacity with basic error correction in tight spaces.
M315×1523 characters14 characters9 bytesLevel L (7%), Level M (15%)Moderate data capacity with more flexible error correction and space requirements.
M417×1735 characters21 characters15 bytesLevel L (7%), Level M (15%), Level Q (25%)Higher data capacity with flexible error correction while maintaining a compact size.

Add a Barcode to a Report

To add a barcode to a report, follow these steps:

  1. Drag the XRBarCode item from the DX.25.2: Report Controls tab and drop it onto the report.

  2. Set the XRBarCode control’s Symbology property to Micro QR Code (an object of the MicroQRCodeGenerator type).

  3. Specify common barcode properties and properties specific to the Micro QR Code.

Specific Properties

CompactionModeGets or sets whether the barcode contains a number, an alphanumeric string, or a byte array.ErrorCorrectionLevelSpecifies the amount of redundancy built into the Micro QR code to compensate for calculation errors.IncludeQuietZoneGets or sets whether to add a blank space around the Micro QR code to help separate the Micro QR code from neighboring elements.VersionGets or sets the barcode’s version.

Runtime Example

The following code snippet generates a Micro QR Code barcode and specifies its properties:

View Example: How to add a barcode to a report

csharp
using System.Collections.Generic;
using System.Drawing.Printing;
using DevExpress.XtraPrinting.BarCode;
using DevExpress.XtraReports.UI;

public XRBarCode CreateMicroQRCodeBarCode(string BarCodeText) {
    // Create a barcode control.
    XRBarCode barCode = new XRBarCode();

    // Set the barcode's type to QRCode.
    barCode.Symbology = new MicroQRCodeGenerator();

    // Adjust the barcode's main properties.
    barCode.Text = BarCodeText;
    barCode.Width = 150;
    barCode.Height = 150;

    // If the AutoModule property is set to false, uncomment the next line.
    barCode.AutoModule = true;
    // barcode.Module = 3;

    // Adjust the properties specific to the barcode type.
    ((MicroQRCodeGenerator)barCode.Symbology).CompactionMode = MicroQRCodeCompactionMode.AlphaNumeric;
    ((MicroQRCodeGenerator)barCode.Symbology).ErrorCorrectionLevel = MicroQRCodeErrorCorrectionLevel.L;
    ((MicroQRCodeGenerator)barCode.Symbology).Version = MicroQRCodeVersion.AutoVersion;

    return barCode;
}
vb
Imports System.Collections.Generic
Imports System.Drawing.Printing
Imports DevExpress.XtraPrinting.BarCode
Imports DevExpress.XtraReports.UI

Public Function CreateMicroQRCodeBarCode(ByVal BarCodeText As String) As XRBarCode
    ' Create a barcode control.
    Dim barCode As New XRBarCode()

    ' Set the barcode's type to QRCode.
    barCode.Symbology = New MicroQRCodeGenerator()

    ' Adjust the barcode's main properties.
    barCode.Text = BarCodeText
    barCode.Width = 150
    barCode.Height = 150

    ' If the AutoModule property is set to false, uncomment the next line.
    barCode.AutoModule = True
    ' barcode.Module = 3;

    ' Adjust the properties specific to the barcode type.
    CType(barCode.Symbology, MicroQRCodeGenerator).CompactionMode = MicroQRCodeCompactionMode.AlphaNumeric
    CType(barCode.Symbology, MicroQRCodeGenerator).ErrorCorrectionLevel = MicroQRCodeErrorCorrectionLevel.L
    CType(barCode.Symbology, MicroQRCodeGenerator).Version = MicroQRCodeVersion.AutoVersion

    Return barCode
End Function

The code example below shows how to create a report with a Micro QR Code barcode:

csharp
using DevExpress.XtraPrinting.BarCode;
using DevExpress.XtraReports.UI;
//...

var barCode = MicroQRCodeGenerator("0123-ABCD");

var report = new XtraReport() {
    Bands = {
        new DetailBand() {
            Controls = { barCode }
        }
    }
};
vb
Imports DevExpress.XtraPrinting.BarCode
Imports DevExpress.XtraReports.UI
'...

Private barCode = MicroQRCodeGenerator("0123-ABCD")

Dim report As New XtraReport()
Dim band = New DetailBand()
band.Controls.Add(barCode)