本主题阐述了如何把 UPC Supplemental 5 码制 (编码类型) 的条形码控件插入到报表中。 另外还简要说明了 UPC Supplemental 5 编码类型。 要学习更多关于 XtraReports 中条形码的内容,请参阅 条形码概述 主题。
简要说明
5 位补充条形码被用于书籍上,来指示建议零售价。
条形码的属性
对于 UPC Supplemental 5 条形码类型,没有特殊的属性。
示例
这个示例展示了如何创建一个 UPC Supplemental 5 条形码,并设置它的基本属性。
C# | 复制代码 |
---|---|
using DevExpress.XtraReports.UI; using DevExpress.XtraPrinting.BarCode; // ... private void button1_Click(object sender, System.EventArgs e) { XtraReport1 report = new XtraReport1(); // Create a barcode control. XRBarCode barcode = new XRBarCode(); // Set the barcode's type to UPC Supplemental 5. barcode.Symbology = new UPCSupplemental5Generator(); // Adjust the UPC Supplemental 5 barcode's main properties. barcode.Text = "01234"; barcode.Width = 150; barcode.Height = 55; report.Detail.Controls.Add(barcode); report.ShowPreview(); } |
Visual Basic | 复制代码 |
---|---|
Imports DevExpress.XtraReports.UI Imports DevExpress.XtraPrinting.BarCode ' ... Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) _ Handles Button1.Click Dim report As New XtraReport1() ' Create a barcode control. Dim Barcode As New XRBarCode() ' Set the barcode's type to UPC Supplemental 5. Barcode.Symbology = New UPCSupplemental5Generator() ' Adjust the UPC Supplemental 5 barcode's main properties. Barcode.Text = "01234" Barcode.Width = 150 Barcode.Height = 55 report.Detail.Controls.Add(Barcode) report.ShowPreview() End Sub |