GS1 Data Matrix Barcodes in SQL Server Reporting Services SSRS
GS1 Data Matrix Barcodes with SQL Server Reporting Services SSRS
- This tutorial shows how you can add GS1 DataMatrix barcodes to SQL Server Reporting Services.
- See the video or follow the steps below.
![](https://media.barcodewiz.com/images/13e4d777-7f1d-400d-af50-7d80b8af62e5-GS1-DM-SSRS-THUMB.png)
Before You Begin
- Ensure BarCodeWizFonts.DataMatrix.dll as well as the font files are installed on the server.
- See BarCodeWiz Fonts in SSRS - Installation
Step 1. Configure Report Properties
- Open Properties Window - right-click in the report background area and click Report Properties...
![](https://media.barcodewiz.com/images/b34d7505-78ad-4d1e-8804-1f714b5c38db-ssrsdll2.png)
Add Reference:
- In the Report Properties window, select the References section.
- 1) Click Add to add the assembly
- 2) Type: BarCodeWizFonts.DataMatrix
- 3) Click Add to add a class instance
- 4) Type BarCodeWizFonts.DataMatrix.DataMatrixFonts for class name and MyDataMatrix for instance name
![](https://media.barcodewiz.com/images/b12d7679-ac50-484f-b74a-0adbbd061064-dm-ssrs2_1.png)
Step 2. Prepare your Data
Prepare your DataSets. Feel free to use our (from the example attached to our program) Our data has the following structure.:
![](https://media.barcodewiz.com/images/13f55cb0-4d0b-4886-b59c-050bb0c57c9d-GS1-DM-SSRS-005.png)
Step 3. Create a Table
- Insert a table into your report
![](https://media.barcodewiz.com/images/2526e64d-21ec-4cca-9161-c1681c8cb924-GS1-DM-SSRS-001.png)
Edit the Expression
![](https://media.barcodewiz.com/images/fe37596c-e767-4e3e-9784-1e6c4344bcbe-GS1-DM-SSRS-002.png)
Step 4. Edit the expression as shown
- Enter the following value in the editor
=Code.MyDataMatrix.Encode( strBarcode:= "(01)"+Fields!gtin.Value+"(17)"+Fields!exp_date.Value+"(10)"+Fields!batch.Value, isGs1:=true, symbolSize:=1, borderWidth:=1, quietZoneWidth:=5 )
- NOTE: To properly encode your barcode set isGs1 variable to 1.
![](https://media.barcodewiz.com/images/e8c475d2-d5de-4795-8510-711156af1281-GS1-DM-SSRS-003.png)
Step 5. Set Font Properties
- Set Font Name to: BCW_DM
NOTE: For smaller barcodes, you can set the point size as low as 2pt
![](https://media.barcodewiz.com/images/3d035cb5-0491-4b21-b392-cdfbb509f06d-GS1-DM-SSRS-006.png)
Let's preview the report.
It should look like this:
![](https://media.barcodewiz.com/images/ead6b81f-6ddc-4da3-a6aa-23b68a3cd9cd-GS1-DM-SSRS-004.png)