Code 93 Extended
- 2 minutes to read
Short Description
It is possible, using Code 93‘s “Full ASCII Mode” to encode all 128 ASCII characters. This is accomplished by using the ($), (/), (%), and (+) symbols as “shift” characters. These characters combined with the single character that follows indicate which Full ASCII character is to be used.
Bar Code Properties
The type of a bar code control’s Symbology property is Code93ExtendedGenerator.
The following property is specific to the Code 93 Extended type.
BarCodeGeneratorBase.CalcCheckSum
Gets or sets whether to calculate a checksum for the bar code.
Note
A checksum of a Code 93 Extended bar code can contain characters that are not supported by this bar code symbology. For this reason, the checksum is not included in the Code 93 Extended bar code’s displayed text.
Examples
The following code creates a Code 93 Extended 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 CreateCode93ExBarCode(string BarCodeText) {
// Create a bar code control.
XRBarCode barCode = new XRBarCode();
// Set the bar code's type to Code 93 Extended.
barCode.Symbology = new Code93ExtendedGenerator();
// 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.
((Code93ExtendedGenerator)barCode.Symbology).CalcCheckSum = false;
return barCode;
}
To add the XRBarCode to a report band, handle the report’s XRControl.BeforePrint event.