Print Barcode as Image in RDLC Local Report Using VB.NET

Generate, add, encode and insert various barcode images into RDLC reports in VB.NET | source code available
Products
Barcode in RDLC
Tutorial
Demo now
License & Price
2D Barcode for RDLC
1D Barcode for RDLC
Barcode in RDLC
Print Barcode Image to RDLC Report Using Barcode Generator in VB.NET - Overview
RDLC Report on client side barcode generator control SDK is a robust and mature .NET component to add 40+ linear and 2D barcode features and compatibilities into RDLC local report without additional barcode control or font installed. The RDLC report inserted barcode images can be exported to PDF, Excel, Word and other file documents with barcode images maintained well using C# or VB.NET coding. Barcode settings and parameters are easy to be customized in VB.NET or C#.NET both in ASP.NET RDLC and Windows EDLC.
This page gives you a detail guide of how to print barcode images in RDLC report using VB.NET with sample barcodes in RDLC in ASP.NET and Windows Applications. For creating RDLC barcode image using C#.NET, please refer to how to generate barcode images using C# in RDLC client side report.
RDLC Report Barcode Generation Using VB.NET- Prerequisites and Compatibility
Prerequisites
  • Terrek Barcode Generator DLL for RDLC local report
  • Microsoft .NET Framework 2.0, 3.0, 4.0 or above
  • Microsoft Visual Studio 2005 / 2008 / 2010 (any version)
  • Visual Basic.NET (any version)
  • Visual Studio 2005 / 2008 / 2010 ReportViewer Local Reports (RDLC) (runtime support)
Compatibility
  • Visual C#.NET, Managed C++, Borland Delphi for .NET
  • Windows XP, Windows Vista, Windows 7, Windows Server 2003, Windows Server 2008, etc
  • .NET Framework 2.0, 3.0, 3.5 and above
Sample VB.NET coding of Generating Barcode Images in RDLC Report - RDLC in Windows Applications
Using linear barcode Code 128 as an example: (step-by-step developer guide in RDLC barcode)
  • Start Visual Studio 200/2008 and create a new Windows Forms project naming "RDLC Barcode Demo"
  • Choose the language type as Visual Basic.NET and select the report application as template
  • Create a new "DataSet" to the project and name it in database model
  • Create a new column and name it as "Barcode", then create a new report
  • Drag and drop a table onto report, and drag an image to the new column named "Barcode"
  • Change the image format, source, value and other settings in properties windows
  • Drag and drop a ReportViewer control onto the WinForms applications at design time
  • Add "Terrek.Barcode.DotNet.dll" to .NET project reference
  • Copy the following sample C# coding accordingly to insert barcode images in RDLC client side local report
Code 128 VB.NET Sample Code to Insert Barcode Image into RDLC Local Report in Window Applications
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'AdventureWorks.vProductAndDescription' table. You can move, or remove it, as needed.
Me.vProductAndDescriptionTableAdapter.Fill(Me.AdventureWorks.vProductAndDescription)
Dim barcode As Terrek.Barcode.DotNET.DotNETControl
barcode.Symbol = Terrek.Barcode.BarcodeSymbol.Code128
Dim row As AdventureWorks.vProductAndDescriptionRow
For Each row In Me.AdventureWorks.vProductAndDescription.Rows
' set barcode encoding data value
barcode.BarcodeData = row.ProductID.ToString()
' set drawing barcode image format
barcode.BarcodeFormat = System.Drawing.Imaging.ImageFormat.Png
row.Barcode = barcode.drawBarcodeAsBytes()
Next
Me.ReportViewer1.RefreshReport()
End Sub
Sample VB.NET coding of Creating Barcode Images in RDLC Report - RDLC in ASP.NET Project
Using Matrix/2D barcode PDF-417 as an example, (see detail user manual in RDLC barcode)
  • Open Visual Studio and create ASP.NET Web Form project using C#.NET as programming language
  • Add the Terrek.AspNet.dll to the project reference
  • Add a new class and copy the following C# code accordingly, then build a web site
  • Insert a table into the created new report
  • Add "Name" and "Price" items to the report in "Website Data Source"
  • Drag a image item to the column and change properties if necessary
  • Drag a "View Designer" to the report and debug it
PDF-417 VB.NET Sample Coding to Create Barcode Image in RDLC Report in ASP.NET
Imports Terrek.Barcode
Public Class Product
Private m_name As String
Private m_price As Integer
Private m_bit As Byte()
Public Sub New(name As String, price As Integer, data As String)
m_name = name
m_price = price
Dim barcode As Terrek.Barcode.DotNET.DotNETControl
barcode.Symbol = Terrek.Barcode.BarcodeSymbol.PDF417
barcode.BarcodeData = data
m_bit = barcode.drawBarcodeAsBytes()
End Sub
Public ReadOnly Property Bit() As Byte()
Get
Return m_bit
End Get
End Property
Public ReadOnly Property Name() As String
Get
Return m_name
End Get
End Property
Public ReadOnly Property Price() As Integer
Get
Return m_price
End Get
End Property
End Class