Intelligent Mail
- 2 minutes to read
Short Description
The Intelligent Mail (IM) code is a 65-bar code for use on mail in the United States. This bar code is intended to provide greater information and functionality than its predecessors POSTNET and PLANET.
The Intelligent Mail bar code has also been referred to as One Code Solution and 4-State Customer bar code abbreviated 4CB, 4-CB or USPS4CB.
Bar Code Properties
The type of a bar code control’s Symbology property is IntelligentMailGenerator.
The following properties are specific to the Intelligent Mail type.
XRBarCode.AutoModule/BarCodeControl.AutoModule
Gets or sets whether the Module property value should be calculated automatically based upon the barcode’s size.
Examples
The following code creates an Intelligent Mail 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 CreateIntelligentMailBarCode(string BarCodeText) {
// Create a bar code control.
XRBarCode barCode = new XRBarCode();
// Set the bar code's type to Intelligent Mail.
barCode.Symbology = new IntelligentMailGenerator();
// Adjust the bar code's main properties.
barCode.Text = BarCodeText;
barCode.ShowText = true;
barCode.WidthF = 300f;
barCode.HeightF = 50f;
// If the AutoModule property is set to false, uncomment the next line.
barCode.AutoModule = true;
//barcode.Module = 3;
return barCode;
}
To add the XRBarCode to a report band, handle the report’s XRControl.BeforePrint event.