ECC200 - Data Matrix

Short Description

Data Matrix code (ISO/IEC 16022 international standard) is a two-dimensional matrix bar code consisting of black and white "cells" arranged in a rectangular pattern. The information to be encoded can be text or raw data.

Every Data Matrix is composed of two solid adjacent borders in an "L" shape (called the "finder pattern"), and two other borders consisting of alternating dark and light cells or modules (called the "timing pattern"). Within these borders are rows and columns of cells that encode information. The finder pattern is used to locate and orient the symbol, while the timing pattern provides a count of the number of rows and columns in the symbol.

barcode-ecc200

Bar Code Properties

The type of a bar code control's Symbology property is DataMatrixGenerator.

The following properties are specific to the ECC200 - Data Matrix type.

Examples

The following code creates a ECC200 - Data Matrix bar code and specifies its main properties.

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

    // Set the bar code's type to DataMatrix.
    barCode.Symbology = new DataMatrixGenerator();

    // Adjust the bar code's main properties.
    barCode.Text = BarCodeText;
    barCode.Width = 400;
    barCode.Height = 150;

    // If the AutoModule property is set to false, uncomment the next line.
    barCode.AutoModule = true;
    //barcode.Module = 3;

    // Adjust the properties specific to the bar code type.
    ((DataMatrixGenerator)barCode.Symbology).CompactionMode = DataMatrixCompactionMode.Text;
    ((DataMatrixGenerator)barCode.Symbology).MatrixSize = DataMatrixSize.MatrixAuto;

    return barCode;
}

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

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

private void XtraReport1_BeforePrint(object sender, PrintEventArgs e) {
    this.Detail.Controls.Add(CreateDataMatrixBarCode("012345678"));
}