BizCode Barcode Generator for RDLC
The most mature barcode solution for ReportViewer Local Reports (RDLC)
Quick Overviews
  • Easy-to use barcode SDK
  • VS & RDLC 2005/2008 support
  • Various linear&2D barcodes
  • Dynamic file formats support
  • For all printers & scanners
Barcode in RDLC > C# Barcode
How to Generate Barcodes in RDLC using C#
BizCode Generator for RDLC is one function of .NET suite barcode solution which supports barcode generation and customization in reports on RDLC format. Barcode library SDK for RDLC is completely C# managed code with digital signed and strong-named dll in .NET Framework 2.0 or greater.
RDLC Barcode Generator Requirements
Windows OS
Can be used in Microsoft Windows 7, Windows Vista, Windows XP, Windows Server 2008, Windows Server 2005, etc
.NET Technology Support
Fully written in managed C# in .NET 2.0, 3.0, 3.5 and 4.0 in Visual Studio 2005/2008/2010
RDLC Barcode Generator Test Environment
Test Environment
Test this barcode DLL in these environments which have Microsoft Windows XP, Microsoft Visual Studio 2005 and Visual C#.NET installed
Test Product
BizCode Generator for RDLC
Generate Barcodes in RDLC in Windows Applications Using Visual C#
  1. Download BizCode Generator for RDLC Free Trial and unzip it;
  2. Open Visual Studio and create a new Windows Forms project naming "RDLC Barcode Demo";
  3. Create a new "DataSet" and name it "AdventureWork.xsd";
  4. Drag and drop "TableAdapter" to your created DataSet in toolbox;
  5. Create a new connection or use existing connection to SQL Server AdventureWorks Sample Database;
  6. Keep "Use SQL statements" to access the database and input "SELECT ProductID, Name FROM Production.vProductAndDescription WHERE (CultureID = N'en')" as SQL statements;
  7. Right click "vProductAndDescription" on the DataSet to create a new column in the "DataTable" and name it "Barcode";
  8. In the "properties" window, change this barcode "DataType" to "System.Byte[]";
  9. Create a new report and name "Report1.rdlc";
  10. Drag and drop a "Table" onto the report;
  11. In the "properties" window, set image item property "MIMEType" to "image/jpeg", "Source" to "Database" and "Value" to "=Fields!Barcode.Value";
  12. Drag a "ReportViewer" to "Form1.cs";
  13. Add "BusinessRefinery.Barcode.Win.dll" to .NET project reference from the "Solution Explorer";
  14. Using C# code accordingly into the method Form1_Load and run the project.
private void Form1_Load(object sender, EventArgs e)
{
// load data to the data table
this.vProductAndDescriptionTableAdapter.Fill
(this.AdventureWorks.vProductAndDescription);
// create a Matrix barcode object
Matrix barcode = new Matrix();
// set barcode type to Data Matrix
barcode.Type = BarcodeType.DataMatrix;
// 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();
}
this.reportViewer1.RefreshReport();
}
Generate Barcodes in RDLC in ASP.NET Using Visual C#
  1. Download BizCode Generator for RDLC Free Trial and unzip it;
  2. Open Visual Studio, and create ASP.NET web form project;
  3. Add "BusinessRefinery.Barcode.Web.dll" to the project reference;
  4. Activate the "Solution Explorer" window, and right-click the web application to add a class;
  5. Copy the C# sample code into the created class "APP_Code/Class1.cs";
  6. Activate "Solution Explorer", and right-click the project to add a report;
  7. Go to "Report Item" in Toolbox, and insert a table into report;
  8. Switch to "Website Data Source", add "Name" and "Price" items to the report;
  9. Drag and drop an Image item to the "Barcode" column and setting the properties of imge: Set "MIMEType" to "image/jpeg" , "Source" to "Database" and "Value" to "=Fields!Barcode.Value", and save the report;
  10. Activate "Solution Explorer", and right-click "Default.aspx" to click "View Designer" menu;
  11. Drag "View Designer" to the report, and then choose created report "Report1.rdlc",
  12. Debug the project.
using System;
using System.Collections.Generic;
using BusinessRefinery.Barcode;
public class Product
{
private string m_name;
private int m_price;
private byte[] m_bit;
public Product(string name, int price, string data)
{
m_name = name;
m_price = price;
WebDataMatrix barcode = new WebDataMatrix ();
m_bit = barcode.drawBarcodeAsBytes();
}
public byte[] Bit
{
get { return m_bit; }
}
public string Name
{
get
{
return m_name;
}
}
public int Price
{
get
{
return m_price;
}
}
}
public class Merchant
{
private List<Product> m_products;
public Merchant()
{
m_products = new List<Product>();
m_products.Add(new Product("EAN13", 25, "EAN13"));
m_products.Add(new Product("EAN13", 30, "EAN13"));
m_products.Add(new Product("qrcode", 15, "qrcode"));
}
public List<Product> GetProducts()
{
return m_products;
}
}
{
m_products = new List<Product>();
m_products.Add(new Product("code128", 25, "code128"));
m_products.Add(new Product("code39", 30, "code39"));
m_products.Add(new Product("qrcode", 15, "qrcode"));
}
public List<Product> GetProducts()
{
return m_products;
}
}