GS1 QR Code
- 3 minutes to read
GS1 QR Code is a variant of the QR Code symbology that conforms to GS1 General Specification.
Add a Bar Code to a Report
Drag the XRBarCode item from the DX.24.1: Report Controls tab and drop it onto the report.
Set the XRBarCode control’s Symbology property to QRCodeGS1 (an object of the QRCodeGS1Generator type).
Specify common barcode properties and properties specific to GS1 QR Code.
Specific Properties
- AutoModule
- Gets or sets whether the Module property value should be calculated automatically based on the barcode size.
- CompactionMode
- Gets or sets whether numeric, alphanumeric or byte mode should be used to encode the barcode’s data.
- ErrorCorrectionLevel
- Gets or sets the amount of redundancy built into the bar code’s coding, to compensate for calculation errors.
- Version
- Gets or sets the bar code’s size.
- IncludeQuietZone
- Gets or sets whether to add a blank space around the QR code.
- Logo
- Specifies the image that overlays the QR code.
- FNC1Substitute
- Specifies the symbol (or set of symbols) in the bar code’s text that will be replaced with the FNC1 functional character when the bar code’s bars are drawn.
- FrameOptions
- Gets or sets the frame for QR codes.
Runtime Example
The following code creates a GS1 QR Code barcode and specifies its properties:
using System;
using System.Collections.Generic;
using System.Drawing.Printing;
using System.Windows.Forms;
using DevExpress.XtraPrinting.BarCode;
using DevExpress.XtraReports.UI;
// ...
public XRBarCode CreateQRCodeGS1BarCode(string BarCodeText) {
// Create a barcode control.
XRBarCode barCode = new XRBarCode();
// Set the barcode's type to QRCode.
barCode.Symbology = new QRCodeGS1Generator();
// Adjust the barcode's main properties.
barCode.Text = BarCodeText;
barCode.Width = 400;
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.
((QRCodeGS1Generator)barCode.Symbology).CompactionMode = QRCodeCompactionMode.AlphaNumeric;
((QRCodeGS1Generator)barCode.Symbology).FNC1Substitute = "#";
((QRCodeGS1Generator)barCode.Symbology).ErrorCorrectionLevel = QRCodeErrorCorrectionLevel.H;
((QRCodeGS1Generator)barCode.Symbology).Version = QRCodeVersion.AutoVersion;
return barCode;
}
The code example below shows how to create a report with a GS1 QR Code barcode: