Skip to main content
A newer version of this page is available. .
All docs


  • 2 minutes to read

Pharmacode is a binary code developed by the German LAETUS GMBH company. The code is widely used in the pharmaceutical industry as a packaging control system. It can be either one-track or two-track.

One-Track Pharmacode

Two-Track Pharmacode



Refer to the Pharmacode specification for more details.

Add the Bar Code to a Report

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

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


  3. Specify common barcode properties and properties specific to Pharmacode.

Specific Properties

Use the PharmacodeType property to specify whether the Pharmacode has one or two tracks.

Runtime Example

The following code creates a one-track Pharmacode and specifies its properties.


The complete sample project is available in the following repository:

using System;
using System.Collections.Generic;
using System.Drawing.Printing;
using System.Windows.Forms;
using DevExpress.XtraPrinting.BarCode;
using DevExpress.XtraReports.UI;
// ...
public XRBarCode CreatePharmacodeBarCode(string BarCodeText) {
    // Create a bar code control.
    XRBarCode barCode = new XRBarCode();

    // Set the type to Pharmacode
    barCode.Symbology = new PharmacodeGenerator() {
        // Specify the Pharmacode type
        PharmacodeType = PharmacodeType.OneTrack

    // Adjust the appearance.
    barCode.Text = BarCodeText;
    barCode.Height = 100;
    barCode.Width = 220;

    return barCode;

To add the XRBarCode to a report band, handle the report’s BeforePrint event.

using System.Drawing.Printing;
// ...

private void XtraReport1_BeforePrint(object sender, PrintEventArgs e) {