How to create local reports (RDLC) with Code 2 of 5 barcodes in C#.NET or VB.NET projects
Avapose.Barcode SDK for RDLC report
  • Reliable linear barcode generator component for .NET applications
  • Create and print quality Code 2 of 5 barcodes in Local Reports RDLC
  • Easily export RDLC report to PDF files or Excel with Code 2 of 5 images
Barcode RDLC > Barcode in RDLC > Linear > Code 2 of 5
Code 2 of 5 Barcode Generation in Local Report (RDLC)
  • Create Code 2 of 5 barcode in local reports RDLC without the use of barcode fonts
  • Display and print Code 2 of 5 barcode from RDLC reports in Windows Forms or ASP.NET applications
  • Easily change Code 2 of 5 barcode size in client report definition (.rdlc) files with the barcode SDK
  • Compatible with exporting RDLC report to PDF, Microsoft Excel, or html with Code 2 of 5 image displayed
  • C# and VB.NET source code is available for making Code 2 of 5 in RDLC report
  • Strong-named and signed DLL with 100% Visual C# managed code
  • Easily enable or disable human-readable text on displayed Code 2 of 5 barcodes
  • Support SQL Server 2005 and 2008 with Adventure Works sample database installed
Avapose Linear Barcode SDK for RDLC report is a robust and powerful barcode component that helps you to add Code 2 of 5 barcode generating function into RDLC client report definition (.rdlc) files into Windows Forms or ASP.NET in Visual C#.NET or VB.NET projects. The Avapose Barcode SDK for RDLC report is compatible with most popular linear and two dimensional barcode standards.
Barcode Generation for RDLC Report Files - Code 2 of 5 Information
Code 2 of 5 is also known as: 2 of 5 barcode, Standard 2 of 5, Industrial 2 of 5, IATA 2 of 5, Data Logic 2 of 5, Matrix 2 of 5, COOP 2 of 5
Code 2 of 5 Generator Control for RDLC Report is capable of encoding:
  • Numeric characters: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Barcode Generation for RDLC - Code 2 of 5 Generation
Requirements:
Before generate Code 2 of 5 in RDLC, you should install:
  • Avapose.Barcode SDK for local reports RDLC
  • Microsoft .NET Framework 2.0 and above
  • Microsoft Visual Studio 2005 onwards or Visual Web Developer 2005 Express Edition and above
  • Microsoft SQL Server 2005 (any edition) or greater with Adventure Works sample database installed
Code 2 of 5 Generation in RDLC in .NET WinForms ApplicationsCreate RDLC Report Project in Visual Studio
  1. Download Avapose.Barcode for RDLC and unzip it;
  2. Start Visual Studio and create a new Windows Application named "RDLCBarcodeDemo".
  3. Create a new DataSet and named it as "AdventureWorks.xsd".
  4. Switch to "Pointer", and then drag and drop "TableAdapter" from toolbox to your created DataSet.
  5. Create a connection to the AdventureWorks SQL Server Database sample and click Next. Then Select "Use SQL statements" and click Next.
  6. Enter the following SQL Statement "SELECT ProductID, Name FROM Production.vProductAndDescription WHERE (CultureID = N'en')" and click Finish button.
Create Barcode Images in RDLC Report Project
  1. Add a new custom column in the DataTable and name it "Barcode". Move to the Properties panel and change data type of "Barcode" column to "System.Byte[]" by manually typing it. Then save the "AdventureWorks.xsd".
  2. Create a new report and name it "Report1.rdlc".
  3. Drag and drop an Image item to the "Barcode" column and setting the properties of image: Set "MIMEType" to "image/jpeg" , "Source" to "Database" and "Value" to "=Fields!Barcode.Value" . Then save the report.
  4. Open the Windows Forms and insert Report Viewer control on the form then choose your created report "Report1.rdlc"
  5. Copy the VB or C# .NET sample code below into the method Form1_Load, and then run the Windows application.

C# code

private void Form1_Load(object sender, EventArgs e)
{
// load data to the data table this.vProductAndDescriptionTableAdapter.Fill
(this.AdventureWorks.vProductAndDescription);
// create a linear barcode object
Linear barcode = new Linear();
// set barcode type
barcode.LinearBarcode = LinearBarcode.Code25;
// 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();
}

VB code

Private Sub Form1_Load(ByVal sender
As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code
loads data into the 'AdventureWorks.vProductAndDescription' table.
You can move, or remove it, as needed.
Me.vProductAndDescriptionTableAdapter.Fill
(Me.AdventureWorks.vProductAndDescription)
Dim barcode As New Linear()
barcode.LinearBarcode = LinearBarcode.Code25
Dim row As AdventureWorks.vProductAndDescriptionRow
For Each row In Me.AdventureWorks.vProductAndDescription.Rows
' set barcode encoding data value
barcode.Data = row.ProductID.ToString()
' set drawing barcode image format
barcode.Format = System.Drawing.Imaging.ImageFormat.Png
row.Barcode = barcode.drawBarcodeAsBytes()
Next
Me.ReportViewer1.RefreshReport()
End Sub
Related Code 2 of 5 Barcode Integration & Generation Information
The following Code 2 of 5 barcode integration and creation information links relate to this product that may be of interest to you:
Testimonial for Barcode Generation SDK for RDLC
We bought your product Barcode Generator for RDLC a few weeks ago, and it works pretty well!
Carlos Louis, Eureka Software Ltd, UK.