Streaming Barcode Images in Microsoft Report Builder

ASPX QR Code 2D Barcode Generator ScriptIn this tutorial, the IDAutomation SSRS Generator Service is used to stream linear barcodes in Report Builder, which is a report authoring tool included with Microsoft SQL Server and SSRS (SQL Server Reporting Services).

This example uses the free demo version of the SSRS Generator Service, which contains a watermark at the bottom of the barcode symbol. The purchased version of the script does not contain the watermark.

Buy License Demo Now


Barcodes can be easily implemented in a report by placing the SSRS Generator URL into a Text Box value and setting the URL parameter to a desired field. When the report is run, barcode images are streamed into the report.

The unique SSRS Generator URL is obtained after purchase. To demo the solution, the following URLs may be used for evaluation purposes only:

Report Builder Example

Report Builder Barcode Tutorial

Applications used in this Tutorial:

NOTE: The tutorial assumes Report Builder is properly installed and that the Barcode Generator Script is implemented and functioning. Within this tutorial, the demo version of the SSRS Generator Service is used for evaluation purposes only.

  1. To run Report Builder, double-click the application icon.
    Report Builder Icon
  2. To create a new report, select New Report and then select Table or Matrix Wizard.
  3. Select Create a Dataset and choose Next.
    Create a new Dataset
  4. For Data Source Connections, select New.
  5. In the Data Source Properties, select a Name, choose a connection type, and select Build.
  6. In the Connection Properties, select the Server name, and the database. In the example, the database name is Barcode. Select OK.
    Create Database Name
  7. The Connection string should include the Server name and database. To verify the connection, select Test Connection. If the connection string is successful, a 'Connection Created Successfully' message will appear. Select OK.
  8. Once the Test connection is linked, select Next.
  9. The Design a query allows the user to select fields for the report.
    Select Fields for the Report
  10. To view or edit the query, select Edit as Text. If the report does not need a query edit, select Next.
  11. Choose the fields that will appear on the report. Select Next.
  12. Choose a layout for the report.
  13. Choose a style for the report.
  14. To view the report, select the Run button near the top left corner of the application.
    Run the report

    Report View:
    Report View
  15. To return to design mode, select Design.
    Return to Design Mode
  16. Choose Insert - Text Box. Jump to Microsoft SQL Server 2014 Instructions.
    Insert Text Box
  17. Drag the Text Box to the report and place it within the field area. In the example, the Text Box is placed underneath the Number field.
    Drag Text Box to Report
  18. Select View and enable Properties.
    Select View and enable Properties.
  19. In the Text Box properties, expand the BackgroundImage and complete the following steps:
    • Set the Source to External.
    • Set the Value to the SSRS Generator URL and append the desired field.
      The example uses the demo URL and sets the DataToEncode (parameter D) to the Number field:
      ="" & Fields!Number.Value
    • A MIMEType image setting is not required.
    • Set the BackgroundRepeat to Clip.

      Setting Text Properties for Barcode URL

  20. Save the report.
  21. Run the report. If the Text Box does not display the full barcode in report view, return to design mode and adjust field height and width.
  22. This example uses the demo version, which contains a watermark at the bottom of the barcode symbol and is for evaluation purposes only. The purchased version of the product does not contain the watermark.
    Barcode on Report

Microsoft SQL Server 2014 Installation Instructions

This version requires an additional column to be added to display the barcodes instead of adding only a text box as in the 2012 version.

  1. Right Click on the last column and add a column to the right.

    Add column to the right

  2. Then right-click in the field where the barcode is desired to appear, select Text Box Properties..., expand the BackgroundImage section, and choose the expression that matches the field information from the Value options.

    Select the corresponding field expression

  3. Now go back into that BackgroundImage Value field and change the default expression as follows:
    • From:
      =First(Fields!Sku.Value, "DataSet1")
    • To:
      ="" & Fields!Sku.Value
    • And set the BackgroundRepeat field to Clip.

      Set the BackgroundRepeat field to Clip

  4. Run the report and verify that the area is large enough to display the barcode completely.
    Barcode report in Microsoft SQL Server 2014

 If a scanner is needed, consider purchasing the IDAutomation USB Barcode Scanner.