How to display and print UPC-A barcode in RDLC reports in ASP.NET or Windows Forms applications
Avapose.Barcode Generator for RDLC
  • Compatible with .NET Framework 2.0, 3.0, 3.5, 4.0
  • Reliable UPC-A barcode generator component for .NET applications
  • Create and print quality UPC-A barcodes in client report definition (rdlc) files
UPC-A Generation in Local Reports
  • Generate high-quality UPC-A and supplemental data UPC-A+2/UPC-A+5 in RDLC report files
  • UPC-A default value pre-configured for easy and quick generation on Client RDLC report
  • Completely run in VB.NET and C#.NET
  • Strong-named and signed assembly for .NET Framework 2.0, 3.0, 3.5, 4.0
  • Source code in VB.NET & C# are available to order
  • Can be exported to PDF, html, and Excel without any image distortion
  • Automatically compute checksum character for UPC-A barcode iamge
  • Royalty-free with purchase of developer license
Avapose UPC-A Barcode Control for RDLC is a reliable and mature barcode generation tool designed for you to insert high-quality barcodes into your Client RDLC report local files. The generated barcodes can be easily export to PDF, HTML, and Excel without any distortion. Besides, it is easy to make desired barcodes by changing barcode parameters via VB.NET and C#.NET.
Barcode Generation for RDLC Report Files - UPC-A Information
UPC-A is a unique 12-digit number barcode designed to identify the manufacturer and specific product so point-of- sale cash register systems can automatically look up the price in USA. A UPC-A barcode usually contains 4 parts: 1 digit for Number System, 5 digits for Manufacturer (Company) Code or prefix, 5 digits for Product Code and 1 digit for checksum which can be automatically calculated by Avapose Barcode Generator.
UPC-A Barcode Generation in RDLC Report valid characters:
  • Digital characters: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Barcode Generation for RDLC - UPC-A Generation


Before generate UPC-A in RDLC, you should install:
  • Windows XP, Windows Vista, Windows 7,etc
  • .NET 2.0, 3.0 or greater
  • Microsoft Visual Studio 2005 or greater
  • Microsoft SQL Server 2005 (any version) or greater with Adventure Works sample database installed
  • Avapose.Barcode for RDLC

UPC-A Generation in RDLC in .NET WinForms Applications

  1. Open Visual Studio and create a new Windows Forms project naming "RDLC Barcode Demo";
  2. Add a new "DataSet" to the project:
    • Create a new "DataSet" and name it "AdventureWork.xsd";
    • Drag and drop "TableAdapter" to your created DataSet in toolbox;
    • Create a new connection or use existing connection to SQL Server AdventureWorks Sample Database;
    • Keep "Use SQL statements" to access the database and input "SELECT ProductID, Name FROM Production.vProductAndDescription WHERE (CultureID = N'en')" as SQL statements;
    • Right click "vProductAndDescription" on the DataSet to create a new column in the "DataTable" and name it "Barcode";
    • In the "properties" window, change this barcode "DataType" to "System.Byte[]";
  3. Create a new report:
    • Create a new report and name "Report1.rdlc";
    • Drag and drop a "Table" onto the report;
    • Add three columns in DataSet "AdventureWorks.xsd" to the report table details section, and drag an "Image" to the last column "Barcode";
    • In the "properties" window, set image item property "MIMEType" to "image/jpeg", "Source" to "Database" and "Value" to "=Fields!Barcode.Value";
  4. Drag "ReportViewer" control:
    • Drag a "ReportViewer" to "Form1.cs";
    • Choose "Report1.rdlc" report, and click "Rebind Data Source";
    • In the "Report.rdlc" page, click "Report", and select "Data Source";
    • Add "AdventureWorks_vProductAndDescription" to report data source;
  5. Add "Avapose.linearbarcode.winforms.dll" to .NET project reference from the "Solution Explorer";
  6. Copy the following code accordingly into the method Form1_Load and run the project. You can get the UPC-A images displayed on the report.

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.Upca;
// 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.Upca
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 UPC-A Barcode Integration & Generation Information
The following UPC-A 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 Barcode Generator for RDLC a few weeks ago, and it works pretty well!
Carios Louis, Eureka Software Ltd,UK