A newer version of this page is available. Switch to the current version.

GS1 - DataBar

  • 3 minutes to read

Short Description

The GS1 DataBar bar code is based on a family of symbols often used in the GS1 DataBar Coupon (coupon codes commonly used in retail).

These bar codes can encode up to 14 digits, which makes them suitable for GTIN 8, 12, 13 and 14.

GS1 DataBar Expanded and GS1 DataBar Expanded Stacked can encode up to 74 numeric or 41 alphanumeric characters, and provide the capability to utilize all GS1 Application Identifiers (e.g., expiration date, batch and serial number). These bar codes are often used in manufacturer coupons.

Barcode - GS1 DataBar

Bar Code Properties

The type of a bar code control’s Symbology property is DataBarGenerator.

The following properties are specific to the GS1 DataBar type.


using System;
using System.Collections.Generic;
using System.Drawing.Printing;
using System.Windows.Forms;
using DevExpress.XtraPrinting.BarCode;
using DevExpress.XtraReports.UI;
// ...
public XRBarCode CreateDataBarGS1BarCode(string BarCodeText) {
    // Create a bar code control.
    XRBarCode barCode = new XRBarCode();

    // Set the bar code's type to GS1 DataBar.
    barCode.Symbology = new DataBarGenerator();

    // Adjust the bar code's main properties.
    barCode.Text = BarCodeText;
    barCode.Width = 250;
    barCode.Height = 160;

    // Adjust the properties specific to the bar code type.
    ((DataBarGenerator)barCode.Symbology).FNC1Substitute = "#";
    ((DataBarGenerator)barCode.Symbology).SegmentsInRow = 4;
    ((DataBarGenerator)barCode.Symbology).Type = DataBarType.ExpandedStacked;

    return barCode;

To add the XRBarCode to a report band, handle the report’s XRControl.BeforePrint event.

using System.Drawing.Printing;
// ...

private void XtraReport1_BeforePrint(object sender, PrintEventArgs e) {