UPC Supplemental 5
- 2 minutes to read
Short Description
5-digit supplemental bar codes are used on books to indicate the suggested retail price.
Bar Code Properties
The type of a bar code control’s Symbology property is UPCSupplemental5Generator.
The are no properties specific to the UPC Supplemental 5 bar code type.
Examples
The following code creates a UPC Supplemental 5 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 CreateUPCSupplemental5BarCode(string BarCodeText) {
// Create a bar code control.
XRBarCode barCode = new XRBarCode();
// Set the bar code's type to UPC Supplemental 5.
barCode.Symbology = new UPCSupplemental5Generator();
// Adjust the bar code's main properties.
barCode.Text = BarCodeText;
barCode.Width = 150;
barCode.Height = 55;
return barCode;
}
To add the XRBarCode to a report band, handle the report’s XRControl.BeforePrint event.