• 3 minutes to read

UPC-E is a shorter version of UPC-A. It omits the number system digit, leading zeros in the manufacturer code, and trailing zeros in the product code. UPC-E is used on products with small packaging where a full UPC-A barcode does not fit.

The UPC-E0 is a type of UPC-E code with the number system set to 0. In the human-readable barcode string, the first digit is the number system (always 0 for this code type), and the last digit is the check digit of the original UPC-A code.

Barcode - UPC-E

In the above example, the original UPC-A code is 04210000526. This code (without the number system) is transformed into 425261, the checksum digit (4) is calculated automatically. The number system, the code, and the checksum digit are encoded in a format scanners can read.


You should assign a code to the barcode's Text property without a leading zero, since this digit is generated automatically. If it is not possible to convert a 10-digit code to a six-digit code, the barcode displays the "Invalid text format" error, and the digits to the right of the 10-th digit in the code are ignored.

Refer to the following article for additional information: UPC-E.

Add the Bar Code to a Report

  1. Drag the XRBarCode item from the DX.20.2: Report Controls tab and drop it onto the report.

  2. Set the XRBarCode control’s Symbology property to UPCE0 (an object of the UPCE0Generator type).

  3. Specify common barcode properties.

Runtime Example

The following code creates the UPC-E0 barcode and specifies its properties.


The complete sample project is available in the following repository: 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 CreateUPCE0BarCode(string BarCodeText) {
    // Create a bar code control.
    XRBarCode barCode = new XRBarCode();

    // Set the bar code's type to UPC-E0.
    barCode.Symbology = new UPCE0Generator();

    // Adjust the bar code'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 BeforePrint event.

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

private void XtraReport1_BeforePrint(object sender, PrintEventArgs e) {