EAN 8
- 2 minutes to read
Short Description
EAN-8 is the EAN equivalent of UPC-E in the sense that it provides a “short” bar code for small packages.
Bar Code Properties
The type of a bar code control’s Symbology property is EAN8Generator.
The are no properties specific to the EAN 8 bar code type.
Examples
The following code creates a EAN 8 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 CreateEAN8BarCode(string BarCodeText) {
// Create a bar code control.
XRBarCode barCode = new XRBarCode();
// Set the bar code's type to EAN 8.
barCode.Symbology = new EAN8Generator();
// Adjust the barcode's main properties.
barCode.Text = BarCodeText;
barCode.Width = 400;
barCode.Height = 100;
return barCode;
}
To add the XRBarCode to a report band, handle the report’s XRControl.BeforePrint event.