Back to Devexpress

Deutsche Post Identcode

xtrareports-403080-feature-guide-to-devexpress-reports-use-report-controls-use-bar-codes-deutsche-post-identcode.md

latest3.6 KB
Original Source

Deutsche Post Identcode

  • Feb 18, 2026
  • 2 minutes to read

The Deutsche Post Identcode symbology, also referred to as Deutsche Post AG IdentCode, German Postal 2 of 5 IdentCode, Deutsche Frachtpost IdentCode, or Deutsche Post AG (DHL), is used by German Post (Deutsche Post AG).

The barcode contains a tracking number that identifies a customer (sender) and a mail item. A value that the barcode encodes should consist of 11 or 12 digits:

  • 2 digits for a distribution center ID;
  • 3 digits for a customer ID;
  • 6 digits for a mailing number;
  • 1 digit for a checksum (optional).

When you specify 11 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.

Add the Bar Code to a Report

  1. Drag the XRBarCode item from the DX.25.2: Report Controls tab and drop it onto the report.

  2. Set the XRBarCode control’s Symbology property to DeutschePostIdentcode (an object of the DeutschePostIdentcodeGenerator type).

  3. Specify common barcode properties.

Runtime Example

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

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

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

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

    // Set the barcode's symbology to the DeutschePostIdentcode.
    barCode.Symbology = new DeutschePostIdentcodeGenerator();

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

    return barCode;
}
vb
Imports DevExpress.XtraPrinting.BarCode
Imports DevExpress.XtraReports.UI
'...

Public Function CreateDeutschePostIdentcodeBarCode(ByVal barcodeText As String) As XRBarCode
    ' Create a XRBarCode control.
    Dim barCode = New XRBarCode()

    ' Set the barcode's symbology to the DeutschePostIdentcode.
    barCode.Symbology = New DeutschePostIdentcodeGenerator()

    ' Adjust the barcode's appearance.
    barCode.Text = barcodeText
    barCode.Height = 100
    barCode.Width = 300

    Return barCode
End Function

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

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

var barCode = CreateDeutschePostIdentcodeBarCode("01234567890");

var report = new XtraReport() {
    Bands = {
        new DetailBand() {
            Controls = { barCode }
        }
    }
};
vb
Imports DevExpress.XtraPrinting.BarCode
Imports DevExpress.XtraReports.UI
'...

Private barCode = CreateDeutschePostIdentcodeBarCode("01234567890")

Dim report As New XtraReport()
Dim band = New DetailBand()
band.Controls.Add(barCode)