Data Matrix .NET Barcode SDK for RDLC Reports

Integration & Developer Guide to generate Data Matrix barcode images in RDLC local report with high quality

Create Data Matrix barcode images on RDLC using .NET Barcode Generator

  • Generate Data Matrix easily using .NET barcode class library
  • C# source code for RDLC is included in purchased version
  • Draw Data Matrix in image files as well as the memory for RDLC
  • Detailed C# & VB codes provided as well as free trial package
  • Reports with barcode images could be exported as PDF or html
  • Configure barcode width, height, X-dimension etc. in RDLC files according to specific requirement
  • Easy-to-use control & complex barcode know-how is not required
  • Generate & print PNG, BMP, GIF, JPEG, TIFF image formats in RDLC

How to create, print Data Matrix 2d barcodes in RDLC local reports in ASP.NET, WinForms?

  1. Download RDLC Reports Data Matrix Generator C# library
  2. Install C# DLL to create Data Matrix in RDLC reports in ASP.NET, WinForms Projects
  3. Step by Step Tutorial










Introduction of Data Matrix Barcode Generator for RDLC

Top
Data Matrix barcode control for RDLC is a powerful report tool lets you create robust reporting solution with barcode generation and printing capabilities. This barcode library can be used in VB.NET, C#, Managed C++ and Borland Delphi for .NET.
OnBarcode.com provides Data Matrix Barcode Generator for .NET RDLC Local Report which also supports 30+ other linear & 2d barcodes generation for RDLC Report. We provide detailed online tutorial:
How to create, print barcodes in RDLC reports?
  • Linear Barcodes on RDLC Report: Code 128, EAN-8, Data Matrix, GS1 128, UPC-A, UPC-E, Interleaved 2 of 5, MSI Plessey, RM4SCC etc.
  • 2D Barcodes on RDLC Report: including QR Code, Data Matrix, PDF-417.




How to Generate Data Matrix in RDLC Using Barcode Generation SDK

Top
This user guide provides you through generating Data Matrix 2D barcodes within RDLC (Report Definition Language Client-Side) local reports using C#, compatible with ASP.NET (including ASP.NET framework web form, MVC), WPF and WinForms (.NET Framework) projects. The solution integrates seamlessly with the ReportViewer Control for rendering barcodes in RDLC files. In the above tutorials, you will create and print Code 128 barcodes in RDLC reports. Here we will update the demo codes to print Data Matrix barcodes in RDLC reports.

Open file Form1.cs in the Visual Studio
  • Remove the existing Linear object construction code
  • Create a new DataMatrix objec to create, customize Data Matrix 2d barcodes in RDLC report file
// Linear linear = new Linear();
DataMatrix barcode = new DataMatrix();


Now you can run the ASP.NET or Windows Forms project in Visual Studio to view the printed Data Matrix barcodes in rdlc report file in report viewer.
  • For ASP.NET: Check the rendered RDLC report in the browser (verify PDF Rendering/Excel Rendering retains the Data Matrix).
  • For WinForms: Confirm the ReportViewer Control displays the Data Matrix correctly in the WinForms Form, and test printing via PrintDialog.
  • Note: Ensure the RDLC Image control's MIME Type is set to image/png to match the generated Data Matrix barcode image format.




Data Matrix Barcode Data Encoding in RDLC Local Reports (C#)

Top

Data Matrix Valid Encoding Character Sets

Data Matrix supports encoding for RDLC reports:

  • Full ASCII table (all 128 characters)
  • Extended ASCII (ISO 8859-1 values 128-255)
  • Other character sets (Arabic, Cyrillic, etc.) via byte data or Extended Channel Interpretation (ECI) protocol




Data Matrix Maximum Data Length (by Encoding Mode)

The maximum data length for Data Matrix in RDLC depends on the encoding mode:
  • Alphanumeric data: Up to 2,335 characters
  • Byte data (8-bit): 1,555 characters
  • Numeric data: 3,116 digits




Setting Data Matrix Encoding Mode in C# for RDLC

The RDLC barcode library auto-selects the optimal encoding mode for Data Matrix in RDLC report file, or you can set it explicitly:

Encoding Mode Reference (for RDLC Customization)
Encodation Scheme Supported Characters C# Setting Code
ASCII Double-digit numerics, ASCII 0-127 DataMatrixDataMode.ASCII
C40 Upper-case alphanumeric, specials DataMatrixDataMode.C40
Text Lower-case alphanumeric, specials DataMatrixDataMode.Text
X12 ANSI X12 EDI data DataMatrixDataMode.X12
EDIFACT ASCII 32-94 DataMatrixDataMode.Edifact
Base256 All byte values 0-255 DataMatrixDataMode.Base256


The default value for Data Matrix data mode is Auto. The RDLC barcode library will automatically choose the right data modes combination for you.

barcode.DataMode = DataMatrixDataMode.Auto;




Advanced Data Encoding for Data Matrix in RDLC Local Reports (C#)

Top

Encode ASCII Non-Printable Characters

Non-printable ASCII characters (e.g., carriage return) require special handling for RDLC:
  • Replace non-printable chars with ~ + 3-digit ASCII value (e.g. char carriage return = ~013).
  • Enable ProcessTilde and set DataMode to "Auto" for RDLC compatibility.
DataMatrix barcode = new DataMatrix();
// encode non printable char '[CR]', between 'Data' and 'Matrix'
barcode.Data = "Data~013Matrix";
barcode.ProcessTilde = true;
barcode.DataMode = DataMatrixDataMode.Auto;



Verify the printed Data Matrix in RDLC report
  • Scan the generated Data Matrix in the RDLC report (PDF/Excel export) to confirm the non-printable character is decoded correctly.




Encode Unicode Text

You can quickly print Data Matrix with Unicode text encoded in local report in .net project.

  • Enable EncodeUnicodeText in the RDLC local report barcode library for multi-language support (e.g., Chinese, French).

barcode.Data = "Unicode text here";
barcode.EncodeUnicodeText = true;


Use barcode scanner software or device to verify the Unicode Data Matrix renders correctly in the ReportViewer Control (WinForms) or browser (ASP.NET).




Other Supported Data Formats

  • Binary data: Encode files (e.g., PDFs) into Data Matrix for RDLC reports (use Base256 mode).
  • GS1 Data Elements: Enable FNC1 for GS1-compliant barcodes.
  • Structured Append: Split large data across multiple Data Matrix barcodes for RDLC (ideal for long reports).




Data Matrix Dimension Size Settings for RDLC Local Reports (C#)

Top
When you customize generated Data Matrix dimension size, you need follow the rules below.
  • Define the desired image width/height for the Data Matrix with unit of measure specified (pixels/cm/inch).
  • Ensure the RDLC Image control's size matches the barcode dimensions to avoid distortion.
barcode.UOM = UnitOfMeasure.INCH;
barcode.BarcodeWidth = 1;





Rectangular Data Matrix Configuration

RDLC supports rectangular Data Matrix (ECC200) with 6 standard symbol sizes:

8x18, 8x32, 12x26, 12x36, 16x36, 16x48 (rows x columns)

barcode.UOM = UnitOfMeasure.INCH;
barcode.FormatMode = DataMatrixFormatMode.Format_16X48;
barcode.BarcodeWidth = 3;
barcode.BarcodeHeight = 1;



Note: When setting the width and height of a rectangular Data Matrix image, the aspect ratio of the image must match the ratio of columns to rows defined in the Data Matrix Format Mode. Only in this way can the modules of the Data Matrix be square-shaped.

Check the RDLC report in report viewer or printed PDF to confirm the rectangular Data Matrix is not stretched.




Advanced Dimension Calculation

The width of a Data Matrix (including quiet zones) follows:

W = Row * X + 2Q

Where:
  • W: Total barcode width
  • Row: Modules per row (symbol size)
  • X: Module width
  • Q: Quiet zone width

Note: If encoded data exceeds the symbol size (Data Matrix format mode) capacity, the library auto-selects a larger size (verify in RDLC report)




Data Matrix Color and Image Settings for RDLC (C#)

Top

Color Customization

Data Matrix in RDLC supports custom foreground / background colors (standard Data Matrix is dark on light)

barcode.ForeColor = Color.Red;
barcode.BackColor = Color.White;



Note: Non-standard colors may not be supported by all barcode scanners. Use barcode scanners to text before deploying to RDLC reports.




Image Format Configuration

RDLC supports multiple raster image formats for Data Matrix in RDLC reports: BMP, GIF, JPG, PNG.

You can customize the output Data Matrix image format through property OutputFileFormat.

barcode.OutputFileFormat = FileFormat.PNG;




Advanced Data Matrix Options for RDLC Local Reports (C#)

Top

Format Mode Customization

RDLC barcode library supports all 24 square and 6 rectangular ECC200 symbol sizes. Use property FormatMode to specify symbol size to fit RDLC local report layout:

barcode.FormatMode = DataMatrixFormatMode.Format_48X48;




Structured Append Mode

Split large data across multiple Data Matrix barcodes for RDLC reports:
  • Enable StructuredAppend to enable Data Matrix Structured Append mode
  • Set property SymbolCount to specify the total number of Data Matrix barcodes to store the same data message
  • Set property SymbolIndex to specify the order of the current data matrix. The first symbol index should be starting with 0
  • Set property FileId with a random unique integer. All data matrix barcodes to store the same data message should have the same "FileId" value.

barcode.StructuredAppend = true;
// The whole data message will be stored in three Data Matrix barcodes
barcode.SymbolCount = 3; 
// This Data Matrix is the first one
barcode.SymbolIndex = 0; 
barcode.FileId = 999;




GS1 FNC1 Support

Enable GS1 compliance for Data Matrix in RDLC:

Set property FNC1 with value FNC1.FNC1_1ST_POS in local report

barcode.FNC1 = FNC1.FNC1_1ST_POS;




Summary

Top
  • The core workflow for generating Data Matrix in an RDLC Local Report:
    1. Generate, customize Data Matrix barcode byte stream
    2. Bind to the RDLC Image report item
    3. Render through the ReportViewer Control
  • Key configuration items:
    Encoding mode (DataMode), dimension settings (BarcodeWidth / FormatMode), color settings (ForeColor / BackColor). These must be consistent with the properties of the Image report item in the RDLC local report file (.rdlc).












Common Asked Questions

What is data matrix?

Data Matrix barcode is one of the 2d or matrix barcode symbologies that is made of black (bar) and white (space) modules that are usually arranged in a square pattern. Data Matrix barcodes are capable of storage of both text and binary data, and are smaller and more compact than QR codes. Using OnBarcode RDLC Barcode Generator SDK, you can easily create, encode, print and insert Data Matrix barcodes into RDLC report designer and report viewer.

How much data can a Data Matrix barcode hold?

A Data Matrix barcode can hold a maximum of data:
  • Alphanumeric data: up to 2,335 characters
  • Byte data (8-bit): 1,555 characters
  • Numeric data: 3,116 digits
If you try to encode text which is over the maximum Data Matrix capacity, the RDLC barcode SDK will create an empty image with error message in your RDLC report viewer or reports in .NET WinForms, ASP.NET application.

What is the minimum and maximum size of Data Matrix barcode?

In Data Matrix ISO standard, ECC200 Data Matrix minimum dimension size is 10 x 10 modules. And the maximum dimension size of Data Matrix is 144 x 144 modules. Each modules are in squares. OnBarcode RDLC Barcode library supports all formats defined in Data Matrix ISO standard.

What is the ISO standard for Data Matrix barcode?

Data Matrix ISO specification is ISO/IEC 16022, and the latest standard version is ISO/IEC 16022:2024. Data Matrix barcode is a 2D barcode symbology, which is also supporting ISO 15415 for 2D label-based barcodes. RDLC Barcode Generator SDK fully supports ISO compatible Data Matrix generations in RDLC reports in Visual Studio .NET IDE.

What are the different types of Data Matrix?

According to Data Matrix latest ISO standard (ISO/IEC 16022), there are two versions of Data Matrix
  • ECC 000-140
  • ECC 200 (Recommended by ISO/IEC 16022)
Data Matrix barcode also has two types of symbol size, in square or in rectangular.

OnBarcode RDLC Barcode Library for VS.NET supports Data Matrix ECC200 in square or in rectangle, which uses the Reed-Solomon error correction.

Can a phone scan a Data Matrix barcode?

Of course you can. Data Matrix codes can be easily scanned using barcode scanners or your smartphone (iPhone or Android phone) equipped with barcode scanning apps.

What is the difference between Data Matrix and QR Code?

Data Matrix and QR Code have lot of same features. They are both 2 dimensional (matrix) barcodes, and enable to encode plain text, Unicode text, binary data. Both of them are encoding GS1 business data messages. Both of Data Matrix and QR Code support Macro, which allows storing large data into multiple Data Matrixs or QR Codes. RDLC Barcode SDK fully supports both Data Matrix and QR Code 2d barcodes generation in RDLC reports in Visual Studio ASP.NET, WinForms projects.




































Terms of Use | Privacy Policy
Copyright © OnBarcode.com . All rights reserved.