How to generate and print Code 128 for RDLC reports in ASP.NET or Windows Forms applications
Avapose.Barcode Generator for Local Reports
  • Compatible with .NET Framework 2.0, 3.0, 3.5, 4.0
  • Create and print quality Code 128 barcodes in client report definition (rdlc) files
  • Reliable Code 128 barcode generator component for .NET applications
Code 128 Generation in RDLC Report
  • Automate Code 128 barcode generation on Report Definition Language Client-Side report
  • Maintain Code 128 barcode images on exported PDF and html
  • Barcode height, width, X-dimension, margins properties could be modified by written C# or .NET codes
  • Create & save barcodes in image files & the memory for Client RDLC reports
  • Support Code 128, Code 128 Code Set A, Code 128 Code Set B and Code 128 Code Set C generation
  • Entirely developed in Visual C# 2005
  • Create accurate ISO compliant barcode based on ISO / IEC 15417
  • Compliant with .NET Framework 2.0, 3.0, 3.5 and advanced versions
Avapose.Barcode for RDLC control is a fully-integrated visual barcode designer for barcode automation purpose in Report Definition Language Client-Side report. This barcode control support Microsoft Report Definition Language scenarios such as Visual Studio 2005, 2008 and 2010 ReportViewer Local Reports (RDLC). Free trial package and VB & C# .NET sample codes are provided.
.NET Barcode Control for RDLC - Code 128 Information
Code 128 is a linear, self-checking, continues, linear symbology barcode. It is a very effective and reliable barcode which is appended with a mandatory checksum digit. Code 128 is capable of encoding high-density data including Full 128 ASCII. Code 128 has three unique data character code sets: A, B, and C, each comprising a subset of the ISO/IEC 646 IRV character set together with various auxiliary characters.
Code 128 Barcode Generator Control for Client RDLC Report is able to encode:
  • Standard ASCII values: 0-128;
  • Extended ASCII Values in accordance with ISO 8859-1: 128-255
.NET Barcode SDK for Client-side Reporting - Code 128 Generation


This part specifies the requirements before using .NET Control for RDLC:
  • Windows XP, Windows Vista and Windows 7
  • Microsoft Visual Studio 2005, 2008 or 2010
  • Microsoft SQL Server 2005, 2008 or 2010
  • .NET Framework 2.0, 3.0, 3.5, and advanced version
  • Avapose.Barcode for RDLC

Create RDLC Report Project in Visual Studio

  1. Start Visual Studio and create Windows Application project with name "RDLCBarcodeDemo".
  2. Create a new DataSet and entitle it as "AdventureWorks.xsd".
  3. Swith to "Pointer" and display the toolbox, and then drag and drop "TableAdapter" to your created DataSet.
  4. Create a connection to the AdventureWorks SQL Server Database sample and click Next. Then Choose "Use SQL statements" and click Next.
  5. Enter the following SQL Statement "SELECT ProductID, Name FROM Production.vProductAndDescription WHERE (CultureID = N'en')" and click Finish button.

Create Barcode Images in RDLC Report Project

  1. Add a new custom column in the DataTable name it "Barcode". Move to the Properties panel and change data type of "Barcode" column to "System.Byte[]" by manually typing it. Then save the "AdventureWorks.xsd".
  2. Create a new report and name it "Report1.rdlc".
  3. Drag and drop a Table from the "Report Items" to report and add 3 columns in DataSet "AdventureWorks.xsd" to the report table.
  4. Drag and drop an Image item to the "Barcode" column and setting the properties of image: Set "MIMEType" to "image/jpeg" , "Source" to "Database" and "Value" to "=Fields!Barcode.Value" . Then save the report.
  5. Open the Windows Forms and insert Report Viewer control on the form then choose your created report "Report1.rdlc"
  6. Copy the VB or C# .NET sample code below into the method Form1_Load, and then run the Windows application.

C# code

private void Form1_Load(object sender, EventArgs e)
// load data to the data table this.vProductAndDescriptionTableAdapter.Fill
// create a linear barcode object
Linear barcode = new Linear();
// set barcode type
barcode.LinearBarcode = LinearBarcode.Code128;
// draw barcodes for each data row
foreach (AdventureWorks.vProductAndDescriptionRow
row in this.AdventureWorks.vProductAndDescription.Rows)
{// set barcode encoding data value
barcode.Data = row.ProductID.ToString();
// set drawing barcode image format
barcode.Format = System.Drawing.Imaging.ImageFormat.Jpeg;
row.Barcode = barcode.drawBarcodeAsBytes();

VB code

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.
Dim barcode As New Linear()
barcode.LinearBarcode = LinearBarcode.Code128
Dim row As AdventureWorks.vProductAndDescriptionRow
For Each row In Me.AdventureWorks.vProductAndDescription.Rows
' set barcode encoding data value
barcode.Data = row.ProductID.ToString()
' set drawing barcode image format
barcode.Format = System.Drawing.Imaging.ImageFormat.Png
row.Barcode = barcode.drawBarcodeAsBytes()
End Sub

Related Code128 Barcode Integration & Generation Information
The following Code128 barcode integration and creation information links relate to this product that may be of interest to you:
Testimonial for Avapose.Barcode for RDLC
We bought your product Barcode Fonts a few weeks ago, and it works pretty well!
Carios Louis, Eureka Software Ltd, UK