Code 39 Barcodes using SQL Server Reporting Services SSRS -As Text
How to create barcodes in SSRS using BarCodeWiz Code 39 Fonts
- This tutorial shows how you can add barcodes to SQL Server Reporting Services.
- Barcodes are encoded using text inserted into a table (See also: Create Code 39 Barcodes as Images).
![](https://media.barcodewiz.com/images/4a530c61-63ff-42cf-a990-a05c2294299c-C39-SSRS-text-001.png)
Before You Begin
- Ensure BarCodeWizFonts.Code39.dll as well as the font files are installed on the server.
- See BarCodeWiz Code 39 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/15fd5784-02a6-4b30-8e84-157909459ff7-ssrsdll2.png)
Add Reference:
- In the Report Properties window, select the References section
- 1) Click Add to add the assembly
- 2) Type: BarCodeWizFonts.Code39
- 3) Click Add to add a class instance
- 4) Type BarCodeWizFonts.Code39.Code39Fonts for class name and MyCode39 for instance name
![](https://media.barcodewiz.com/images/756f3287-c65d-4c4e-ba1d-89d393241fd1-C39-SSRS-inst002.png)
Step 2. Insert a data column
- Drag and drop a one of your columns from your DataSet into the report.
- In this example, the data field is placed inside a Table
![](https://media.barcodewiz.com/images/d6278870-b1fa-45c1-995d-07760fbb0a80-C39-SSRS-text-002.png)
Step 3. Edit Properties
- Right-Click > Expression...
![](https://media.barcodewiz.com/images/0b429629-b463-45aa-9f85-475ba136e50d-C39-SSRS-text-003.png)
- Edit the expression as shown
- We are using the function Code39()
![](https://media.barcodewiz.com/images/3aee5957-5752-4808-85c7-e1038c7d889c-C39-SSRS-text-004.png)
- Let's preview the report. It should look like this:
![](https://media.barcodewiz.com/images/03debb77-1e64-4f35-a67a-781ced7d32cb-C39-SSRS-text-005.png)
Step 4. Set Font Properties
- Set Font Name to: BCW_Code39h_2
- Set Font Size to: 22
![](https://media.barcodewiz.com/images/504067dc-e510-4c78-8e0f-39beb61055df-C39-SSRS-text-006.png)
![](https://media.barcodewiz.com/images/b9885b37-f4f0-4c97-aa0d-8efef64de923-C39-SSRS-text-007.png)
The Result
- The report is now ready.
![](https://media.barcodewiz.com/images/21ac58ff-fb59-429f-8731-4be1cf201198-C39-SSRS-text-008.png)
Additional Code 39 Functions available in MS SSRS
Code39(barcode as a String)
- Code39Check() encodes text into Code 39.
- Accepts the following characters: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%
- Example 1: =Code.MyCode39.Code39( "4567ABCD" )
Example 2: =Code.MyCode39.Code39( Fields!item_sku.Value ) - Encodes data from column in item_sku table.
Code39Check(barcode as a String)
- Code39Check() encodes text into Code 39. Adds a MOD 43 check digit to the end of the barcode.
- Accepts the following characters: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%
- Example 1: =Code.MyCode39.Code39Check( "4567ABCD" )
Example 2: =Code.MyCode39.Code39Check( Fields!item_sku.Value ) - Encodes data from column in item_sku table.