How to make Data Matrix in Crystal Reports for .NET using 2D Barcode .NET SDK for Crystal Reports
Avapose.Barcode for Crystal Reports
  • Reliable Data Matrix creator library & DLL for Crystal Report .NET
  • Easily print DataMatrix in CR Reports in ASP.NET and .NET WinForms
  • Generate high quality Data Matrix images in Crystal Reports
Barcode Crystal Report > Barcode in Crystal Report > 2D > .NET Data Matrix in Crystal Report
Crystal Reports Data Matrix Creator Component
  • Automate Data Matrix printing & creation in the Crystal Report
  • Create accurate Data Matrix barcode images based on ISO / IEC 16022
  • 7 data modes available include ASCII, Auto, Base256, C40 etc.
  • 30 formats range from (10X10) to (144X144) and (8X18) to (16X48) to form a square or rectangular Data Matrix
  • Easy to modify properties including margins, data modes, resolution, X-dimension, height etc.
  • 100% integrated into VB.NET, C#, Managed C++ and Borland Delphi for .NET
  • Provide C# & Visual Basic source code and perpetual license in purchased version
  • Crystal Report with barcode images could be exported in PDF, Word, Excel and rich text formats
.NET control for Crystal Report DLL & Control is a comprehensive component which helps you build powerful reporting solution using Visual Studio 2005, 2008, and 2010. With this .NET control, fields could be changed to Data Matrix images easily by simple clicks in Crystal Report. Data Matrix .NET control is fully written in C# .NET 2005.
.NET Barcode Generation for Crystal Report - Data Matrix Information
Data Matrix, based on ISO / IEC 16022, is a high-density 2D barcode. Data Matrix could encode large amount of text, numbers, files and actual data bytes in a small space either in the shape of square or rectangular. It is widely used on labeling small items due to its high density.
Data Matrix barcode generator control & dll for Crystal Report encodes:
  • Standard ASCII values 0-127
  • Extended ASCII values 128-225
.NET Barcode Library for Crystal Report - Data Matrix Generation

Requirements:

Before using Data Matrix barcode control for Crystal Report, make sure you install:
  • Operating Systems: Windows XP, Windows Vista and Windows 7
  • Microsoft Visual Studio: 2005, 2008 and 2010
  • .NET Framework: 2.0, 3.0, 3.5, and advanced version
  • Avapose.Barcode for .NET Winforms

Implement Data Matrix .NET Barcode Generator for Crystal Report into Visual Studio

  1. Download Avapose.Barcode for .NET Winforms and unzip;
  2. Open Crystal Reports project in Visual Studio, and then choose "Standard" in the window titled "Using the Report Wizard" and click "OK".
  3. Expand "Create New Connection" and "ADO.NET" in the popped up "Data" form. Select "next" button. This brings up the "Connection" form. Navigate to the "CustomerDataSet.xsd" in the downloaded package and click "Finish" button.
  4. On the next "Data" form, add table "Customer" as selected tables and click "Next". In following "Fields" tab, double click all three fields available and move them to right "Customer" fields, and Click "Finish".
  5. In CrystalReport1.rpt, drag and drop field "Barcode" to the report Section 3 (Details).
  6. Switch to .NET project solution explorer, and then add "OnBarcode.Barcode.WinForms.dll" to your project reference.

Create Data Matrix Barcodes Using .NET Barcode Control for Crystal Report

  1. Open your Form1.cs in Design view, and then double click the form to enter Form1.cs.
  2. Copy the VB.NET or C# programming codes below into the method Form1_Load and using the namespace "Avapose.linearbarcode".
  3. Run the report. Barcode images will be displayed on the Reporting Service.
  4. Crystal Report with barcode images could be exported as PDF, Word, Excel or rich text formats.

C# code

private void Form1_Load(object sender, EventArgs e)
{
OleDbConnection aConnection = new OleDbConnection(
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:/Demo/BarcodeDemoData.mdb");
aConnection.Open();
OleDbDataAdapter dataAdapter = new OleDbDataAdapter("select * from Customer"
, aConnection);
DataSet ds = new DataSet();
dataAdapter.Fill(ds);
//add a new column named "Barcode" to the DataSet, the new column data type is
byte[]

ds.Tables[0].Columns.Add(new DataColumn("Barcode", typeof(byte[])));
MatrixBarcode = new Matrix();
Barcode.MatrixBarcode = MatrixBarcode.DataMatrix;
foreach (DataRow dr in ds.Tables[0].Rows)
{
Barcode.BarcodeData = (int)dr["CustomerId"] + "";
byte[] imageData = Barcode.drawBarcodeAsBytes();
dr["Barcode"] = imageData;
}
CrystalReport1 rpt = new CrystalReport1();
rpt.SetDataSource(ds);
this.crystalReportViewer1.ReportSource = rpt;
aConnection.Close();

VB code

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) 
Handles MyBase.Load

Dim aConnection As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:/Demo/BarcodeDemoData.mdb"
)
aConnection.Open()
Dim dataAdapter As New OleDbDataAdapter("select * from Customer", aConnection)
Dim ds As New DataSet()
dataAdapter.Fill(ds)
'add a new column named "Barcode" to the DataSet, the new column data type is
byte[]

ds.Tables(0).Columns.Add(New DataColumn("Barcode", GetType(Byte())))
Dim Barcode As new Matrix()
Barcode.MatrixBarcode = MatrixBarcode.DataMatrix
For Each dr As DataRow In ds.Tables(0).Rows
Barcode.BarcodeData = CInt(dr("CustomerId")) & ""
Dim imageData As Byte() = Barcode.drawBarcodeAsBytes()
dr("Barcode") = imageData
Next
Dim rpt As New CrystalReport1()
rpt.SetDataSource(ds)
Me.CrystalReportViewer1.ReportSource = rpt
aConnection.Close()
End Sub

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