Back to Devexpress

Code128Generator.CharacterSet Property

corelibraries-devexpress-dot-xtraprinting-dot-barcode-dot-code128generator-dbd42707.md

latest3.8 KB
Original Source

Code128Generator.CharacterSet Property

Gets or sets the character set type for the bar code.

Namespace : DevExpress.XtraPrinting.BarCode

Assembly : DevExpress.Printing.v25.2.Core.dll

NuGet Package : DevExpress.Printing.Core

Declaration

csharp
[DefaultValue(Code128Charset.CharsetA)]
public virtual Code128Charset CharacterSet { get; set; }
vb
<DefaultValue(Code128Charset.CharsetA)>
Public Overridable Property CharacterSet As Code128Charset

Property Value

TypeDefaultDescription
Code128CharsetCharsetA

A Code128Charset enumeration value, specifying a character set to be used.

|

Available values:

NameDescription
CharsetA

Includes ASCII characters 00 to 95 (0-9, A-Z and control codes), special characters and FNC 1 (code that is used for special purposes).

| | CharsetB |

Includes ASCII characters 32 to 127 (0–9, A–Z, a–z), special characters, and FNC 1 (code that is used for special purposes).

| | CharsetC |

Includes ASCII digit strings (00-99) and FNC 1 (code that is used for special purposes).

| | CharsetAuto |

Uses A, B and C character sets and switches between them automatically according to bar code text.

|

Remarks

Use the CharacterSet property to specify the set of symbols which can be used when setting the XRControl.Text property of a Code 128 bar code. If the characters specified in the Text property are not allowed by the character set, the bar code will display the following error.

Note

To avoid this message appearing for any sequences of chars, set the CharacterSet property’s value to Code128Charset.CharsetAuto. In this case, the char sequence is coded using all three character sets, and it switches between them automatically when required.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CharacterSet property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

reporting-add-a-bar-code-to-a-report/CS/Form1.cs#L191

csharp
// Adjust the properties specific to the bar code type.
((Code128Generator)barCode.Symbology).CharacterSet = Code128Charset.CharsetB;

See Also

Code 128

Code128Generator Class

Code128Generator Members

DevExpress.XtraPrinting.BarCode Namespace