Skip to main content
All docs
V24.2

DeutschePostLeitcodeGenerator Class

Generates a visual representation of the Deutsche Post Leitcode barcode.

Namespace: DevExpress.XtraPrinting.BarCode

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

Declaration

public class DeutschePostLeitcodeGenerator :
    DeutschePostGenerator

Remarks

The Deutsche Post Leitcode symbology, or German Postal 2 of 5 LeitCode, LeitCode, or CodeLeitcode, is used by Deutsche Post AG (Deutsche Frachtpost). This barcode identifies the destination.

Leitcode barcode

A value that the barcode encodes should consist of 13 or 14 digits:

  • 5 digits for a Postal Code (Postleitzahl, PLZ);
  • 3 digits for a Street ID/number;
  • 3 digits for a House number;
  • 2 digits for a Product code;
  • 1 digit for a checksum (optional).

When you specify 13 digits, the barcode generates a checksum digit automatically. If you add a checksum digit, the barcode ignores this digit and also generates it automatically to ensure the encoded value is valid.

Example

The following code example creates the Deutsche Post Leitcode barcode and specifies its properties.

View Example: How to add a bar code to a report

using DevExpress.XtraPrinting.BarCode;
using DevExpress.XtraReports.UI;
//...

public XRBarCode CreateDeutschePostLeitcodeBarCode(string barcodeText) {
    // Create a XRBarCode control.
    var barcode = new XRBarCode();

    // Set the barcode's symbology to the DeutschePostLeitcode.
    barcode.Symbology = new DeutschePostLeitcodeGenerator();

    // Adjust the barcode's appearance.
    barcode.Text = barcodeText;
    barcode.Height = 100;
    barcode.Width = 320;

    return barcode;
}

The code example below shows how to create a report with the Deutsche Post Leitcode barcode:

using DevExpress.XtraPrinting.BarCode;
using DevExpress.XtraReports.UI;
//...

var barcode = CreateDeutschePostLeitcodeBarCode("0123456789012");

var report = new XtraReport() {
    Bands = {
        new DetailBand() {
            Controls = { barcode }
        }
    }
};

Inheritance

Object
DevExpress.Printing.Utils.DocumentStoring.StorableObjectBase
BarCodeGeneratorBase
Interleaved2of5Generator
DevExpress.XtraPrinting.BarCode.DeutschePostGenerator
DeutschePostLeitcodeGenerator
See Also