Home  >  .NET Barcode for Reporting Services  >  SSRS Barcode Creation Tutorial
Reporting Services Barcode Generator Tutorial
This Reporting Services Barcode Generator Tutorial page aims to tell users how to create barcodes in SSRS, and 1D/2D barcodes generation in SQL Server Reporting Services.
Reporting Services (SSRS) barcode SDK offers the most affordable barcode generator solution for Microsoft Reporting Services for .NET professionals. The barcode creation in Reporting Services tutorial demonstrates how to generate barcodes in SQL Server Reporting Services by using the .NET Windows Forms barcode generator DLL. It supports linear and 2D barcode creation in any edition of Reporting Servicers.
The Barcode Generator for SQL Reporting Services (SSRS) is a professional and advanced barcode generator for .NET framework projects. The reliable SQL Reporting Services (SSRS) Barcode CRI (Custom Report Item), or .NET DLL Class Library, helps you to generate both linear and 2D barcodes in Microsoft Reporting Services reports. It can be utilized as an integrated .NET component without the use of barcode fonts. All .NET barcode DLLs provided by KeepDynamic are created in C#.NET with 100% managed code, digitally signed and time-stamped.
Supported Barcode Types By Reporting Services Barcode Generator SDK
Reporting Services barcode control generates multiple linear and matrix barcodes in Microsoft SQL Server Reporting Services (SSRS) reports, including:
Requirement for Creating Barcodes in Reporting Services using .NET Windows Forms Control
To create barcodes in Reporting Services with the .NET Windows Forms control, you need to:
  1. Install any edition of Microsoft Visual Studio 2005 onwards or BIDS (Business Intelligent Development Studio) 2005 and greater
  2. Install any edition of Reporting Services 2005 and 2008
  3. Download the package of .NET Barcode for Reporting Services trial version
How to Create Barcode Images for Reporting Services in Visual Studio 2005

Deploy Barcode Control for Reporting Services

Download and unzip the barcode control package to a folder. The barcode DLL should be put under the below two folders for deployment

For users of Visual Studio 2005

  1. Copy "KeepDynamic.Barcode.Reporting2005.dll" & "KeepDynamic.Barcode.Reporting2005CRI.dll" to directory "\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\"

  2. Copy "KeepDynamic.Barcode.Reporting2005CRI.dll" to directory "\Program Files\Microsoft SQL Server\MSSQL.4\Reporting Services\ReportServer\bin\"

Note: Directory [MSSQL.3] is machine specific which might be MSSQL.1, MSSQL.2, or MSSQL.3.

For users of Visual Studio 2008

  1. Copy "KeepDynamic.Barcode.Reporting2008.dll" & "KeepDynamic.Barcode.Reporting2008CRI.dll" to directory "\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\"

  2. Copy "KeepDynamic.Barcode.Reporting2008CRI.dll" to directory "\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\bin\"

Configure Environments for .NET Reporting Services Barcoding Control

1. Copy the following sample code to file: "\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\rsreportdesigner.config" .

<Configuration>
<Extensions>

    ...

<!-- This is the last report item in the config file -->

<ReportItems>
   <ReportItem Name="BarCodeRt"
       Type="KeepDynamic.Barcode.Reporting2005CRI.BarCodeRtCRI, KeepDynamic.Barcode.Reporting2005CRI" />
   <ReportItem Name="DataMatrixRt"
       Type="KeepDynamic.Barcode.Reporting2005CRI.DataMatrixRtCRI, KeepDynamic.Barcode.Reporting2005CRI" />
   <ReportItem Name="PDF417Rt"
       Type="KeepDynamic.Barcode.Reporting2005CRI.PDF417RtCRI, KeepDynamic.Barcode.Reporting2005CRI" />
   <ReportItem Name="QRCodeRt"
       Type="KeepDynamic.Barcode.Reporting2005CRI.QRCodeRtCRI, KeepDynamic.Barcode.Reporting2005CRI" />
</ReportItems>
<ReportItemDesigner>
   <ReportItem Name="BarCodeRt"
       Type="KeepDynamic.Barcode.Reporting2005.BarCodeRt, KeepDynamic.Barcode.Reporting2005" />
   <ReportItem Name="DataMatrixRt"
       Type="KeepDynamic.Barcode.Reporting2005.DataMatrixRt, KeepDynamic.Barcode.Reporting2005" />
   <ReportItem Name="PDF417Rt"
       Type="KeepDynamic.Barcode.Reporting2005.PDF417Rt, KeepDynamic.Barcode.Reporting2005" />
   <ReportItem Name="QRCodeRt"
       Type="KeepDynamic.Barcode.Reporting2005.QRCodeRt, KeepDynamic.Barcode.Reporting2005" />
</ReportItemDesigner> 
<Extensions>
<Configuration>
2. Copy the following sample code to file: "\Program Files\Microsoft SQL Server\MSSQL.4\Reporting Services\ReportServer\rsreportserver.config".

<Configuration>
<Extensions>

...

<!-- This is the last report item in the config file -->

<ReportItems>
   <ReportItem Name="BarCodeRt"
       Type="KeepDynamic.Barcode.Reporting2005CRI.BarCodeRtCRI, KeepDynamic.Barcode.Reporting2005CRI" />
   <ReportItem Name="DataMatrixRt"
       Type="KeepDynamic.Barcode.Reporting2005CRI.DataMatrixRtCRI, KeepDynamic.Barcode.Reporting2005CRI" />
   <ReportItem Name="PDF417Rt"
       Type="KeepDynamic.Barcode.Reporting2005CRI.PDF417RtCRI, KeepDynamic.Barcode.Reporting2005CRI" />
   <ReportItem Name="QRCodeRt"
       Type="KeepDynamic.Barcode.Reporting2005CRI.QRCodeRtCRI, KeepDynamic.Barcode.Reporting2005CRI" />
</ReportItems> 
</Extensions>
</Configuration>
3. Copy the following sample code to file: "\Program Files\Microsoft SQL Server\MSSQL.4\Reporting Services\ReportServer\rssrvpolicy.config".

<configuration>
  <mscorlib>
   <security>
      <policy>
        <PolicyLevel version="1">
          ...

<!-- This is the first CodeGroup item in the config file -->
        <CodeGroup
            class="FirstMatchCodeGroup"
            version="1"
            PermissionSetName="Nothing">
           <IMembershipCondition 
              class="AllMembershipCondition"
              version="1" />
       <CodeGroup
           class="UnionCodeGroup"
           version="1"
           PermissionSetName="FullTrust"
           Description="This code group grants KeepDynamic.Barcode.Reporting2005CRI.dll Full Trust permission. ">
           <IMembershipCondition
           class="UrlMembershipCondition"
           version="1"
           Url="C:\Program Files\Microsoft SQL Server\MSSQL.4\Reporting Services\ReportServer\
              bin\KeepDynamic.Barcode.Reporting2005CRI.dll" />
       </CodeGroup> 

...

          </CodeGroup>
        </PolicyLevel>
      </policy>
    </security>
  </mscorlib>
</configuration>

Note: For users of Visual Studio 2008 version, you only need replace the Reporting2005CRI(appearing in the above three sample codes) with Reporting2008CRI, replace Reporting2005 with Reporting2008

Create a New Report for Barcode Generation in Reporting Services

  1. Open your Visual Studio 2005, choose Business Intelligent Projects from project types list and use Report Server Project Wizard as template

  2. Name above project as KD Sample Project and click Next

  3. Add a new data source to this report. Here we choose AventureWorks database sample as the New data source on Report Wizard

  4. Create a query string with Query Builder. Enter the SQL Statement "SELECT CustomerID, TerritoryID, AccountNumber FROM Sales.Customer" to the Query string box. Click Next on Design Query Wizard

  5. Select the Tabular as report type and hit Next (We use the default values here for Design the Table, Table Style and Deployment Location) and hit Next

  6. Name the report as Reporting Service Barcoding and click Finish. The report will be visible right now!

Add Barcode Image to the Report in Reporting Services

The following steps illustrate how to generate barcodes on the report in Reporting Services
  1. Insert a new column following the last column in the table and name it Barcode

  2. Add a reference to KeepDynamic.Barcode.Reporting2005.dll which is placed in the location: C: \Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\

  3. After integrating the barcode assembly, there are four barcode controls may apprear in your VS 2005 IDE toolbox. They are BarCodeControl, DataMatrixControl, PDF417Control, and QRCodeControl

  4. We are going to create Code39 here. Drag the BarCodeControl and drop to the new column for generating barcode

  5. Switch to the barcode property window. Then change barcode symbology to Code 39 and change its Codetext value to =Fields!AccountNumber.Value

  6. Hit Preview tab, and make sure that the barcode image has been returned on th report

Features of Reporting Services Barcode Generating Control
It is easy to draw linear and matrix barcodes in Microsoft SQL Reporting Services (SSRS) reports with a Custom Report Item (CRI). With this Reporting Services Barcode, the checksum or check digits may be automatically computed and the value to encode may be automatically validated.
The utilization of the Reporting Services Barcode requires Microsoft Reporting Services with SQL Server 2005 or 2008. Windows 2000 and later versions with .NET Framework 2.0 or greater are supported.
The linear and 2D barcodes generated in Reporting Services by the .NET barcode Component (CRI & .NET DLL Class Library) has a flexible barcode size which may adjust the X-dimension, wide-to-narrow ratio, barcode height, margins and the white space between the bars in the barcode. Data Binding API is provided within the .NET barcode component to bind to fields in SQL Server. Barcode Orientation may be adjusted to 0, 90, 180 or 270 degrees based on requirements, without any readable trouble. It supports the generation of high quality barcode image formats in JPG, GIF, BMP, and PNG. DPI Configuration Options are provided to set high image resolution based on requirements.
Other .NET Linear & 2D Barcode Generators
Reporting Service Barcode supports 70+ linear (1d) and matrix (2d) barcode standards. But if you want to generate barcodes in .NET applications, then you can follow the following links: