Our Customers
Contact Us Email: support@barcodelib.com
Home > Crystal Reports Barcode DLL > .NET Crystal Barcode Generation > Data Matrix 2D Barcode Generator Component for .NET Crystal Reports
Download Barcode for Crystal Reports Trial

Data Matrix .NET Crystal Reports Barcode Control

Professional Data Matrix Barcode Creaion Control DLL for .NET Crystal Reports Project
  • Compile Data Matrix barcode creating capabilities into a strong named .NET Crystal Reports Barcode Library SDK
  • Work perfectly with Visual Studio & .NET Framework 2.0, 3.0, 3.5, 4.0 versions
  • Generate & add 2d Data Matrix on Crystal Reports for ASP.NET web services & .NET Windows
  • Capable of customizing generated Data Matrix using Visual C# code or Visual Basic code
  • Also support QR Code and Data Matrix 2d (matrix) barcode generation on Crystal Reports
  • Provide detail online guide for Crystal Reports barcode generation for ASP.NET web & Windows applications
  • Enjoy free 6-month Premium Support & free 12-month Software Update with a purchased Crystal Reports Barcode Generator Control License
Crystal Reports Barcode Generator Control SDK Supported Barcodes
2D Barcode Images Supported by Crystal Reports Barcode Generator Control: Data Matrix, QR-Code, and PDF-417;
Linear Barcode Images Supported by Crystal Reports Barcode Generator Control: Codabar, Code 11, Code 2 of 5, Code 39, Code 93, Code 128, EAN-8, EAN-13, EAN-128, Interleaved 2 of 5, ITF-14, UPC-A, UPC-E, etc.
BarcodeLib.com .NET Crystal Reports Barcode Generator SDK can fully integrate into .NET Framework IDEs. You can easily generate and add Data Matrix barcode images on your Crystal Reports through property settings or using C# / VB class library. This barcode component supports dynamic data connection to virtually data source to build user-defined Crystal Report.
Create & Add Data Matrix Barcode on ASP.NET Crystal Reports Application
  1. Create a new ASP.NET website.
    • Choose "ASP.NET Crystal Reports Web Site" as the template and named the project as "BarcodeforCrystalReportsWebSite".
  2. Add a new item "Crystal Report" to your project.
    • Add a new item "Crystal Report" to the project and name it as "CustomerReport.rpt". view image
    • Select "Mail Label" in the pop-up window and click "OK". view image
    • In "Mailing Labels Report Creation Wizard", click "Create New Connection", and expand "ADO.NET". view image
    • In "ADO.NET" form, choose "CustomerDataSet.xsd" file in your downloaded package, and click "Finish". view image
    • In "Mailing Labels Report Creation Wizard", add table "Customer" under "ADO.NET" to selected table. And click "Next". view image
    • Add all three fields "ID", "CustomerId", "CustomerName" to "Fields to Display:", then click "Next". view image
    • Select default label "Return Address (Avery 5267)", and click "Finish".
    • Now you can view the report template and find that field "Barcode" not in the report template. view image
    • Now, please re-arrange the report template. view image
    • Drag field "Barcode" to the report template, right click "Barcode" object and choose "Format Object" menu. view image
    • In "Format Editor" form, check "Can Grow" property. view image
  3. Drag a "Crystal Report Viewer" to the "Default.aspx".
    • Add a reference to BarcodeLib.Barcode.CrystalReports.dll.
    • Copy the following C# 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 DataMatrixCrystal for Data Matrix
DataMatrixCrystal barcode = new DataMatrixCrystal();

// Barcode settings
barcode.ModuleSize = 4;
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 your project.
Create & Add Data Matrix Barcode on .NET Windows Crystal Reports Application
  1. Create a new Windows Application Project.
    • Choose "Crystal Reports Application" as the template and name it as "BarcodeforCrystalReports".
  2. Add a "Crystal Report" item to the project. Click to see how to add Crystal Report to project
  3. Drag a "Crystal Report Viewer" to the window form.
    • Resize "Form1" and drag "CrystalReportViewer" to the form, with the default setting unchanged. view image
    • Add a reference to BarcodeLib.Barcode.CrystalReports.dll.
    • Copy the following C# 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 DataMatrixCrystal for Data Matrix
DataMatrixCrystal barcode = new DataMatrixCrystal();

// Barcode settings
barcode.ModuleSize = 4;
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 your project.
Use C# or VB Class Library to Create Data Matrix Barcode on Crystal Reports
To know how to generate 2d & linear barcode images for Craystal Reports with C#.NET or VB.NET code, please see as below:
More Tutorials for Crystal Reports 2D & Linear Barcode Generating
Linear (1D) Barcodes:
Matrix(2D) Barcodes: