GS1-128 - EAN-128 (UCC)
- 2 minutes 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.
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.
-
Gets or sets the character set type for the bar code.
EAN128Generator.FNC1Substitute
Gets or sets 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.
EAN128Generator.HumanReadableText
Specifies whether or not parentheses should be included in the bar code’s text.
Examples
The following code creates a GS1-128 - EAN-128 (UCC) bar code and specifies its main properties.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-add-a-bar-code-to-a-report-e167.
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.