How to Generate Data Matrix in RDLC ReportsHow to Generate and Insert Data Matrix Barcode Image in Local Report RDLC
- Entirely compatible with Visual Studio 2005/2008/2010
- Compatible with Microsoft .NET Framework 2.0, 3.0, 3.5 & 4.0
- Support Microsoft SQL Server 2005 and greater versions
- Create standard Data Matrix barcode image in RDLC Reports
- Easy to adjust Data Matrix properties via C# or VB programming
- Quickly export Data Matrix barcode image on PDF and html
- Support flexible Data Matrix size setting for specific width and height demand
RDLC Reports Data Matrix Barcode Control Introduction
RDLC Data Matrix Barcode Generator is capable of adding high quality Data Matrix barcode images in RDLC Reports. RDLC Reports (Report Definition Language Client-Side) are completely running on the client-side, contrast to the server reporting, RDL (Report Definition Language) Reports.
Data Matrix Barcode Overview
Data Matrix is a two-dimensional barcode which can store from 1 to about 2,000 characters. It is being used to encode product and serial number information on electrical rating plates; to mark of surgical instruments in Japan; to identify lenses, circuit boards, and other items during manufacturing. Download RDLC Reports Data Matrix Barcode Control
- KeepAutomation.Barcode.RDLC.dll
- End User License Agreement
- User Manual & Order Page
Developers should note that Data Matrix barcode image generated with this trial version will include a "KA Barcode" watermark. As a result, this trial version can not be used to business applications. Insert Data Matrix in WinForms Using RDLC Barcode Control
- Create a new DataSet with the name "AdventureWorks.xsd".
- Switch to the "Toolbox", select "Pointer", and drag "TableAdapter" to the new "DataSet".
- Create or select a connection to SQL Server AdvantureWorks Sample Database.
- Input "SELECT ProductID, Name FROM Production.vProductDescription WHERE (CultureID = N'en') as SQL Statements.
- Create a new column by right clicking "vProductAndDescription" on the dataset, then name the column.
- Change the data type to "System.Byte[]".
- Switch to "Solution Explorer" and add a new "Report" item.
- Create a new "Report" item and insert a table to the report.
- Add three columns in the dataset to the report table details section.
- Drag and drop "Image" item to the last column and name it "Barcode".
- Go to "Properties" window and change "Source", "MIMEType", "Value" to "Database", "image/jpeg", "=Fields!Barcode.Value" respectively.
- Then select "Form1.cs[Design]", drag "ReportViewer" to Form1, and bind the data collection.
- Add "KeepAutomation.Barcode.RDLC.dll" to project reference.
- Copy the following C# & VB sample codes into the method Form1_Load.
- Use "KeepAutomation.Barcode.RDLC" namespace and run your project.
C# Sample code
private void Form1_Load(object sender, EventArgs e) { // load data to the data table this.vProductAndDescriptionTableAdapter.Fill this.vProductAndDescriptionTableAdapter.Fill(this.AdventureWorks.vProductAndDescription); // create a linear barcode object BarCode datamatrix = new BarCode(); // set barcode type datamatrix.Symbology = KeepAutomation.Barcode.Symbology.DataMatrix; datamatrix.X = 3; datamatrix.Y = 3; // draw barcodes for each data row foreach (AdventureWorks.vProductAndDescriptionRow row in this.AdventureWorks.vProductAndDescription.Rows) {// set barcode encoding data value datamatrix.CodeToEncode = row.ProductID.ToString(); // set drawing barcode image format datamatrix.ImageFormat = System.Drawing.Imaging.ImageFormat.Png;
row.Barcode = datamatrix.generateBarcodeToByteArray(); } this.reportViewer1.RefreshReport(); } VB Sample code
Private Sub Form1_Load(sender As Object, e As EventArgs) ' load data to the data table this.vProductAndDescriptionTableAdapter.Fill Me.vProductAndDescriptionTableAdapter.Fill(Me.AdventureWorks.vProductAndDescription) ' create a linear barcode object Dim datamatrix As New BarCode() ' set barcode type datamatrix.Symbology = KeepAutomation.Barcode.Symbology.DataMatrix datamatrix.X = 3 datamatrix.Y = 3 ' draw barcodes for each data row For Each row As AdventureWorks.vProductAndDescriptionRow In Me.AdventureWorks.vProductAndDescription.Rows ' set barcode encoding data value datamatrix.CodeToEncode = row.ProductID.ToString() ' set drawing barcode image format datamatrix.ImageFormat = System.Drawing.Imaging.ImageFormat.Png
row.Barcode = datamatrix.generateBarcodeToByteArray() Next Me.reportViewer1.RefreshReport() End Sub Data Matrix Barcode Properties |