Skip to main content
A newer version of this page is available. .

Interleaved 2 of 5

  • 2 minutes to read

Short Description

Interleaved 2 of 5 is a higher-density numerical bar code based upon the Standard 2 of 5 symbology. It is used primarily in the distribution and warehouse industry.

Barcode - Interleaved 2 of 5

Bar Code Properties

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

The following properties are specific to the Interleaved 2 of 5 type.

Examples

The following code creates an Interleaved 2 of 5 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 CreateInterleaved2of5BarCode(string BarCodeText) {
    // Create a bar code controle.
    XRBarCode barCode = new XRBarCode();

    // Set the bar code's type to Interleaved 2 of 5.
    barCode.Symbology = new Interleaved2of5Generator();

    // 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.
    ((Interleaved2of5Generator)barCode.Symbology).CalcCheckSum = false;
    ((Interleaved2of5Generator)barCode.Symbology).WideNarrowRatio = 3;

    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(CreateInterleaved2of5BarCode("012345678"));
}