GS1-128 - EAN-128 (UCC)

  • 2 min to read

Short Description

GS1-128 (EAN-128) was developed to provide a worldwide format and standard for exchanging common data between companies.

While other bar codes simply encode data with no respect for what the data represents, GS1-128 encodes data and encodes what that data represents.

Barcode - EAN 128

Bar Code Properties

The type of a bar code control's Symbology property is EAN128Generator.

The following properties are specific to the GS1-128 (EAN-128) type.

Examples

The following code creates a GS1-128 - EAN-128 (UCC) bar code and specifies its main 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 CreateGS1128BarCode(string BarCodeText) {
    // Create a bar code control.
    XRBarCode barCode = new XRBarCode();

    // Set the bar code's type to EAN 128.
    barCode.Symbology = new EAN128Generator();

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

    // Adjust the properties specific to the bar code type.
    ((EAN128Generator)barCode.Symbology).CharacterSet = Code128Charset.CharsetB;

    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) {
    this.Detail.Controls.Add(CreateGS1128BarCode("012345678"));
}