Data Matrix Data Encoding in SSRS Reports
Data Matrix supports a variety of encoding character sets, maximum data lengths, and encoding modes to accommodate diverse data types in SSRS reports.
All settings are configured in the SSRS Report Item Property panel.
Valid Encoding Character Set
Data Matrix barcodes support the following character sets for SSRS report data encoding (all settings configured in the Report Item Property panel):
- Full ASCII (all 128 standard ASCII characters). Suitable for alphanumeric and basic text data from the SSRS Dataset (e.g., product names, order IDs).
- Extended ASCII (ISO 8859-1 values 128-255). Supports special characters (e.g., accented letters) for regional SSRS reports.
- Other character sets (e.g., Arabic, Cyrillic, Greek, Hebrew). Enabled via the Extended Channel Interpretation (ECI) protocol (first introduced here). This is critical for international SSRS projects (e.g., reports distributed via Email Subscription to global audiences).
Maximum Data Length
The maximum data length of a Data Matrix barcode depends on its encoding mode. This is important for SSRS reports that need to encode large amounts of data from the Report Server Database. For ECC200 (the most common Data Matrix standard), the maximum lengths are:
- Alphanumeric data: Up to 2,335 characters. Ideal for mixed text and numbers (e.g., product codes, reference numbers in Paginated Reports).
- Byte data (8-bit): Up to 1,555 characters. Used for binary data or non-English text in SSRS reports.
- Numeric data: Up to 3,116 digits. Suitable for SSRS reports with long numerical identifiers (e.g., serial numbers, invoice numbers).
Note: If your SSRS Dataset data exceeds these limits, use Data Matrix Structured Append mode to split the data into multiple Data Matrix symbols.
Encoding Data Modes
Data Matrix uses six encoding modes to optimize data storage efficiency. All modes are configured in the SSRS Report Item Property panel. The six modes are:
- DataMatrixDataMode.ASCII: Encodes double-digit numerics, standard ASCII (0-127), and extended ASCII (128-255) characters. Ideal for SSRS reports with basic text and numerical data (e.g., customer IDs from the Report Server Database).
- DataMatrixDataMode.C40: Optimizes uppercase alphanumeric characters, lowercase letters, and special characters. Reduces data size for uppercase-heavy SSRS data (e.g., product SKUs).
- DataMatrixDataMode.Text: Optimizes lowercase alphanumeric characters, uppercase letters, and special characters. Suitable for SSRS reports with descriptive text (e.g., customer names).
- DataMatrixDataMode.X12: Encodes ANSI X12 EDI data sets. Common in logistics SSRS reports (e.g., supply chain data exchange via Data-Driven Subscription).
- DataMatrixDataMode.Edifact: Encodes ASCII values 32-94. Used for EDIFACT standard data exchange in international SSRS projects.
- DataMatrixDataMode.Base256: Encodes all byte values (0-255). Required for non-printable ASCII characters, binary data, and Unicode text in SSRS reports.
Advanced Text Encoding in SSRS Data Matrix
SSRS reports often require encoding special data formats (non-printable ASCII, Unicode, GS1, binary data). Below are step-by-step guides for each scenario, with corresponding SSRS Report Item Property configurations (all settings are in the Report Item Property panel).
Encode Non-Printable ASCII Characters
Non-printable ASCII characters (e.g., Carriage Return [CR], Line Feed [LF]) are used to structure data in SSRS reports (e.g., separating multiple Dataset Fields in a single Data Matrix). To encode them:
- In SSRS Report Item Property: Enable "Process Tilde" and set "Data Mode" to "Base256" to ensure correct decoding.
Note: If ProcessTilde is disabled, the "~" character will be treated as plain text, causing invalid Data Matrix encoding in SSRS reports.
Encode Unicode Text
Unicode text (e.g., Thai, Arabic, Chinese) is common in international SSRS reports. To encode it into Data Matrix:
- In SSRS Report Item Property: Enable "Encode Unicode Text" to ensure the barcode library processes Unicode data correctly.
Note: Ensure the SSRS Dataset uses UTF-8 encoding for Unicode data to avoid garbling in the generated Data Matrix.
Encode Other Data Formats
Data Matrix supports additional data formats relevant to SSRS reports, including binary data, GS1 business messages, and Structured Append mode.
Below are key implementations:
- Binary Data: Use DataMatrixDataMode.Base256 in SSRS Report Item Property. Convert binary data to a byte array and encode it using the Data property.
- GS1 Data: "FNC1 Mode" to "First Position" in SSRS Report Item Property. Format data as "(AI)data" (e.g., (17)050101 for expiry date, (10)ABC123 for lot number)
Note: Ensure AI codes and data lengths comply with GS1 standards to ensure scannability by GS1 readers (critical for SSRS logistics reports).
Data Matrix Dimension and Size Configuration in SSRS Reports
All Data Matrix dimension settings are configured in the SSRS Report Item Property panel.
Square Data Matrix with Specified Width
- In SSRS Report Item Property: Set "Barcode Width" to your desired size (e.g., 900 pixels). The height will automatically match the width for square Data Matrix.
Note: Avoid setting the width too small (e.g., < 100 pixels). This may make the Data Matrix unreadable when printed from the SSRS Web Portal.
Rectangular Data Matrix
Data Matrix (ECC200) specifies 6 rectangular symbols, which are useful for SSRS reports with limited space (e.g., labels). The predefined rectangular sizes are:
- 8 rows x 18 columns
- 8 rows x 32 columns
- 12 rows x 26 columns
- 12 rows x 36 columns
- 16 rows x 36 columns
- 16 rows x 48 columns
- In SSRS Report Item Property: Select the corresponding "Format Mode" and set "Barcode Width" and "Barcode Height".
Note: Ensure the image width/height ratio matches the Data Matrix columns/rows ratio to avoid distortion in SSRS reports.
Advanced Dimension Settings
The width of a Data Matrix (including quiet zones) can be calculated using the formula: W = Row * X + 2Q, where:
Advanced dimension settings include:
- W: Barcode width
- Row: Modules per row (Symbol Size)
- X: Width of each module
- Q: Width of the quiet zone (empty space around the barcode)
Note: For square Data Matrix, width and height are equal.
Advanced dimension settings include:
- UOM (Unit of Measure): Choose PIXEL, CM, or INCH (configured in SSRS Report Item Property).
- X (Module Width): Minimum width defined by your application specification (set in SSRS Report Item Property).
- Quiet Zones: Set LeftMargin, RightMargin, TopMargin, and BottomMargin (minimum width = X) in SSRS Report Item Property.
- Resolution: Set the image resolution (e.g., 96 DPI) to ensure clarity when printed from the SSRS Web Portal.
Note: Insufficient quiet zones will cause scanning failures. A common error in SSRS reports when the Image item is placed too close to other elements.
Data Matrix Color and Image Settings in SSRS Reports
All color and image settings are configured in the SSRS Report Item Property panel.
Color Settings
By default, Data Matrix modules (bars) are dark and the background is light. You can customize colors to match your SSRS report's brand style:
- In SSRS Report Item Property: Set "Fore Color" (bar color) and "Back Color" (background color) using standard or custom RGB values.
Note: Ensure sufficient contrast (e.g., black bars on white background). Light bars on dark backgrounds are allowed but may reduce scannability. Avoid non-standard colors (e.g., red bars on white background) unless your scanners support them.
Image Format Settings
Data Matrix can be generated in raster (e.g., PNG, JPEG) or vector (e.g., SVG, EPS) formats, compatible with SSRS Rendering Extensions (PDF, Excel, HTML). All format settings are configured in the SSRS Report Item Property panel:
- Raster Formats: Set "Image Format" to PNG, JPEG, etc., in SSRS Report Item Property.
- Vector Formats: Configure "Image Format" to "SVG" or "EPS" in SSRS Report Item Property.
Note: Vector formats are ideal for high-resolution printing (e.g., SSRS reports exported to PDF for physical labels).
Advanced Data Matrix Options in SSRS Reports
Advanced settings enhance the functionality of Data Matrix in SSRS reports, including Format Mode, Structured Append, and FNC1. All settings are configured in the SSRS Report Item Property panel.
Format Mode Customization
Data Matrix (ECC200) specifies 24 square symbols and 6 rectangular symbols, each with different data capacities. To customize the Format Mode:
- In SSRS Report Item Property: Set "Format Mode" to the desired symbol size (e.g., Format_48X48 for a large square Data Matrix).
Note: Choose a FormatMode that accommodates your SSRS Dataset data length to avoid encoding failures.
Structured Append Mode
Structured Append mode splits large data into up to 16 Data Matrix symbols, ideal for SSRS reports with data exceeding the maximum length of a single Data Matrix (e.g., detailed audit logs from the Report Execution Log).
- In SSRS Report Item Property: Enable "Structured Append", set "Symbol Count", "Symbol Index", and "File ID"
Note: All symbols must be scanned in order to retrieve the full data. Ensure consistent FileId for all symbols in the SSRS report.
FNC1 in First Position
When FNC1 is in the first position, it signals that the Data Matrix conforms to GS1 standards. Critical for SSRS reports in logistics, retail, and healthcare.
- In SSRS Report Item Property: Set "FNC1 Mode" to "First Position".
Note: Pair this with GS1 data formatting (e.g., (AI)data) to ensure compatibility with GS1 scanners.
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 SQL Server Reporting Services Barcode Generator SDK, you can easily create, encode, print and insert Data Matrix barcodes into SSRS 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
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 SQL Server Reporting Services 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.
SQL Server Reporting Services Barcode Generator SDK fully supports ISO compatible Data Matrix generations in SSRS 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
OnBarcode SQL Server Reporting Services Barcode Library for VS.NET supports Data Matrix ECC200 in square or in rectangle, which uses the Reed-Solomon error correction.
- ECC 000-140
- ECC 200 (Recommended by ISO/IEC 16022)
OnBarcode SQL Server Reporting Services 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 in SSRS reports 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.
SQL Server Reporting Services Barcode SDK fully supports both Data Matrix and QR Code 2d barcodes generation in SSRS reports in Visual Studio ASP.NET, WinForms projects.
