Our Customers
Contact Us Email: support@barcodelib.com
Home > .NET Crystal Reports Barcode > Crystal Reports Barcode Generation Guide > Crystal Reports QR-Code Generator DLL
Download Barcode for Crystal Reports Trial

Crystal Reports QR Code Generator Library

How to Generate 2D QR-Code Barcodes in Crystal Reports for .NET
  • Easy to create barcodes in Crystal Reports without using barcode fonts or third party tools
  • Developed in Visual C# with full integration for .NET 2.0 and later version
  • Simple to print QR Code barcodes using Crystal Report in Windows applications and ASP.NET web applications
  • Programmatically create, generate QR Code 2D barcodes with C# and VB.NET
  • Programmatically create QR-Codes in ASP.NET with C#, VB.NET Class Library
  • Make multiple QR Codes images in Crystal Report within a few steps
  • Flexible barcode settings available as specified in standard
  • Complete barcode settings to adjust various QR Code barcode parameters
.NET Crystal Reports QR Code Barcode Introduction
QR-Code is also known as Quick Response Code, Denso Barcode, QRCode, JIS X 0510, ISO/IEC 18004.
Compatibility: Barcode for Crystal Reports control / dll is compatible with ISO/IEC 18004 (Second Edition 2006-09-01) bar code symbology specification.
For more QR Code information, please refer to .NET QR-Code Introduction.
How to Generate QR Code barcode in Crystal Reports with ASP.NET Website
  1. Create a new ASP.NET website.
    • Create a new web site project using "ASP.NET Crystal Reports Web Site" as template, named "BarcodeforCrystalReportsWebSite".
  2. Add a Crystal Report item to the project.
    • Add a new item (Crystal Report), named "CustomerReport.rpt" to the project. view image
    • Select Expert as "Mail Label". Click "OK" button. view image
    • In "Mailing Labels Report Creation Wizard", click "Create New Connection", and expand "ADO.NET". view image
    • In "ADO.NET" form, select "CustomerDataSet.xsd" file in your downloaded package, and click "Finish" button. view image
    • In "Mailing Labels Report Creation Wizard", add table "Customer" under "ADO.NET", to selected table. And click "Next" button. view image
    • Add all three fields "ID", "CustomerId", "CustomerName", to "Fields to Display:". Click "Next". view image
    • Select default label "Return Address (Avery 5267)", and click "Finish" button.
    • Now you can view the report template, and find that field "Barcode" not in the report template. view image
    • Re-arrange the report template. view image
    • Drag field "Barcode" to the report template. Right click "Barcode" object and select "Format Object" menu. view image
    • In "Format Editor" form, check "Can Grow" property. view image
  3. Add Crystal Report Viewer to the Default.aspx.
    • Add a reference to BarcodeLib.Barcode.CrystalReports.dll.
    • Add the following code to the Default.aspx.cs file.
     using System.Data.OleDb;
using System.Drawing.Imaging;
using BarcodeLib.Barcode.CrystalReports;
using BarcodeLib.Barcode;


protected void Page_Load(object sender, EventArgs e)
{
// Create the database connection. Please change to correct data file (BarcodeDemoData.mdb) path.
OleDbConnection aConnection = new OleDbConnection(
"Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=C:/BarcodeLib_NETBarcode_Trial/ReportingData/BarcodeDemoData.mdb"
);
aConnection.Open();

OleDbDataAdapter dataAdapter = new OleDbDataAdapter("SELECT * FROM Customer", aConnection);
DataSet ds = new DataSet();
dataAdapter.Fill(ds);

// Add the Barcode column to the DataSet
ds.Tables[0].Columns.Add(new DataColumn("Barcode", typeof(byte[])));

// Use QRCodeCrystal for QR Code
QRCodeCrystal barcode = new QRCodeCrystal();

// Barcode settings
barcode.ModuleSize = 3;
barcode.ImageFormat = System.Drawing.Imaging.ImageFormat.Png;

foreach (DataRow dr in ds.Tables[0].Rows)
{
barcode.Data = (int)dr["CustomerId"] + "";
byte[] imageData = barcode.drawBarcodeAsBytes();
dr["Barcode"] = imageData;
}

CrystalReportSource1.ReportDocument.Load(Server.MapPath("CustomerReport.rpt"));
CrystalReportSource1.ReportDocument.SetDataSource(ds.Tables[0]);
CrystalReportSource1.DataBind();

}
4. Run the project.
How to Create QR Code Bar Code in Crystal Reports with .NET Windows Forms
  1. Create a new Windows Application Project.
    • Create a new project using "Crystal Reports Application" as template, named "BarcodeforCrystalReports".
  2. Add a Crystal Report item to the project. View How to Add Crystal Report to Project
  3. Add Crystal Report Viewer to the window form.
    • Resize "Form1", and add "CrystalReportViewer" to the form, with the default setting unchanged. view image
    • Add a reference to BarcodeLib.Barcode.CrystalReports.dll.
    • Add the following code to the Form1.cs file.
     using System.Data.OleDb;
using System.Drawing.Imaging;
using BarcodeLib.Barcode.CrystalReports;
using BarcodeLib.Barcode;


private void Form1_Load(object sender, EventArgs e)
{
// Create the database connection. Please change to correct data file (BarcodeDemoData.mdb) path.
OleDbConnection aConnection = new OleDbConnection(
"Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=C:/BarcodeLib_NETBarcode_Trial/ReportingData/BarcodeDemoData.mdb"
);aConnection.Open();

OleDbDataAdapter dataAdapter = new OleDbDataAdapter("SELECT * FROM Customer", aConnection);
DataSet ds = new DataSet();
dataAdapter.Fill(ds);

// Add the Barcode column to the DataSet
ds.Tables[0].Columns.Add(new DataColumn("Barcode", typeof(byte[])));

// Use QRCodeCrystal for QR Code
QRCodeCrystal barcode = new QRCodeCrystal();

// Barcode settings
barcode.ModuleSize = 3;
barcode.ImageFormat = System.Drawing.Imaging.ImageFormat.Png;

foreach (DataRow dr in ds.Tables[0].Rows)
{
barcode.Data = (int)dr["CustomerId"] + "";
byte[] imageData = barcode.drawBarcodeAsBytes();
dr["Barcode"] = imageData;
}

CustomerReport rpt = new CustomerReport();
rpt.SetDataSource(ds);

this.crystalReportViewer1.ReportSource = rpt;

//close the connection Its important.
aConnection.Close();

}
4. Run the project.
How to Print QR Code Barcodes in Crystal Reports Using C#, VB.NET
BarcodeLib.com also provides detailed guide for users to create barcodes in Crystal Report using C# / VB.NET (Visual Basic). Please go to the links below for detailed tutorials with C# or VB.NET sample code.
Crystal Reports Barcode Generator Control Supported Symbologies
Linear (1D) Barcodes:
Matrix(2D) Barcodes: