Code 128 Barcodes in SQL Server Reporting Services SSRS -As Images
How to create barcodes in SSRS
- BarCodeWiz Code 128 Fonts may be used to create barcodes in SSRS.
- Follow the steps below to add barcodes to your own report.
![](https://media.barcodewiz.com/images/6be1935a-ff74-4060-9290-6542b6aadabe-C128_ssrs_001.png)
Before You Begin
- Ensure BarCodeWizFonts.Code128.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/acf2855d-8ae0-451e-9084-d3501c06a44e-ssrsdll2.png)
Add Reference:
- In the Report Properties window, select the References section
- 1) Click Add to add the assembly
- 2) Type: BarCodeWizFonts.Code128
- 3) Click Add to add a class instance
- 4) Type BarCodeWizFonts.Code128.Code128Fonts for class name and MyCode128 for instance name
![](https://media.barcodewiz.com/images/3fcfd42c-39b6-40a5-8b18-9bcab5ad11f8-ssrsdll3_1.png)
Step 2. Insert image
- Insert an image into the report by dragging one of the columns from your DataSet.
- In this example, the image is placed inside a Table.
![](https://media.barcodewiz.com/images/0f915317-4440-4bec-a1e9-2b44e7092185-ssrs_img_001_01.png)
Step 3. Edit Image Properties.
- Right - click on the table cell with image field and select Image Properties...
![](https://media.barcodewiz.com/images/ed57b67b-f486-461f-ba2f-bc94bf7283d5-C128_ssrs_002.png)
- 1. Select Database as the image source.
- 2. Select image/png as the MIME type.
- 3. Click on the Fx button to open the Expression window.
![](https://media.barcodewiz.com/images/5be97841-cf26-4cff-9a35-c02359cad88d-C128_ssrs_004.png)
- Set the value for the expression:
=Code.MyCode128.ToImageBytes( Code.MyCode128.Code128B(Fields!item_sku.Value ), "BCW_Code128B_1", 24, 300.0, "png" ) - Replace item_sku with the name of the field from your dataset.
![](https://media.barcodewiz.com/images/d6b7ddea-0e88-4ca9-b627-b4d2e5fb6b5f-ssrs022_01.png)
Ready!
- Preview the generated report.
![](https://media.barcodewiz.com/images/8f33ac04-52fb-459d-ab85-713254376e2f-ssrs023_1.png)