UPC EAN Barcodes in SQL Server Reporting Services (SSRS)

How to create barcodes in SSRS

  • BarCodeWiz UPC EAN Fonts can be used to create barcodes in SSRS. Follow the steps below to add barcodes to your own report.

Step 1a. Copy BarCodeWizFonts.UPCEAN.dll

  • Copy the file BarCodeWizFonts.UPCEAN.dll into your ReportServer\bin folder.
    From: C:\Program Files\BarCodeWiz\BarCodeWiz UPC EAN Fonts\DotNet\net20
    To: C:\Program Files\Microsoft SQL Server Reporting Services\SSRS\ReportServer\bin
  • Note: The path depends on your version of Reporting Services

Step 1b. Copy to additional folders.

  • For editing within Visual Studio 2022, Copy the file BarCodeWizFonts.UPCEAN.dll into:
    C:\Program Files (x86)\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\SSRS\
    C:\Program Files (x86)\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\SSDTRS\
  • For editing within Visual Studio 2019, Copy the file BarCodeWizFonts.UPCEAN.dll into:
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\SSRS\
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\SSDTRS\
  • For editing within Visual Studio 2017, Copy the file BarCodeWizFonts.UPCEAN.dll into:
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\SSRS\
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\SSDTRS\
  • For editing within Visual Studio 2015, Copy the file BarCodeWizFonts.UPCEAN.dll into:
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PrivateAssemblies\
  • For older versions of Visual Studio:
    C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies\
    C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies\
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\
  • For editing with Report Builder:
    C:\Program Files (x86)\Microsoft SQL Server\Report Builder\
    C:\Program Files (x86)\Microsoft SQL Server\Report Builder 3.0\
    C:\Program Files\Microsoft SQL Server Reporting Services\SSRS\ReportServer\bin

Step 2. Open Properties Window.

  • Right click in the report background area and click Report Properties...

Step 3. Add Reference.

  • In the Report Properties window, select the References section.
  • 1) Click Add to add the assembly.
  • 2) Type: BarCodeWizFonts.UPCEAN.
  • 3) Click Add to add a class instance.
  • 4) Type BarCodeWizFonts.UPCEAN.UPCEANFonts for class name and MyUPCEAN for instance name.

Step 4. Create a new report.

  • Click on File > New > Blank Report

Step 5. Connect your Data Source.

  • In this example, we are using a simple 3 column items data set.

Step 6. Insert a Text Box

  • Insert a text box into the report by dragging one of the columns from your DataSet.
  • In this example, the text box is placed inside a Table.

  • Right-Click > Expression... .

  • Edit the expression as shown
  • We are using the function Code128B()

  • Let's preview the report. It should look like this.:

Set Font Properties

  • Set Font Name to: BCW_UPCEAN_2
  • Set Font Size to: 22

Step 7. Finalize and generate report

  • Under the Home tab, in the Views section click Run to generate the report.

  • The final result

 

 

 

 

UPC EAN Fonts Functions in SSRS


UPCABytes(barcode as String, height as Integer)

  • Encodes the barcode in UPC-A format.
  • The function parameters are:

    barcode: String value with the barcode data to encode. Must be 11 or 12 digits. Enter 11 digits to have the check digit added automatically. Also accepts 13, 14, 15, or 17 digits for +2 and +5 Add-on

    height: Integer value indicating which version of the font height should be selected. Valid values are from 1 to 6.

UPCEBytes(barcode as String, height as Integer, showText as Boolean)

  • Encodes the barcode in UPC-E format.
  • The function parameters are:

    barcode: String value with the barcode data to encode. Must be 7 or 8 digits. Enter 7 digits to have the check digit added automatically. Also accepts 9,10, 12, or 13 digits for +2 and +5 Add-on

    height: Integer value indicating which version of the font height should be selected. Valid values are from 1 to 6.

EAN13Bytes(barcode as String, height as Integer, showText as Boolean)

  • Encodes the barcode in EAN-13 format.
  • The function parameters are:

    barcode: String value with the barcode data to encode. Must be 12 or 13 digits. Enter 12 digits to have the check digit added automatically. Also accepts 14, 15, 17, or 18 digits for +2 and +5 Add-on

    height: Integer value indicating which version of the font height should be selected. Valid values are from 1 to 6.

EAN8Bytes(barcode as String, height as Integer, showText as Boolean)

  • Encodes the barcode in EAN-8 format.
  • The function parameters are:

    barcode: String value with the barcode data to encode. Must be 7 or 8 digits. Enter 7 digits to have the check digit added automatically.

    height: Integer value indicating which version of the font height should be selected. Valid values are from 1 to 6.