BizCode Barcode Generator for Crystal Report
The most advanced barcode control for Crystal Report
Quick Overviews
  • Crystal Report .NET SDK
  • Linear & 2D barcode support
  • .NET 2.0/3.0/4.0 support
  • Support C#, VB.NET, etc
  • Multiple file formats support
Barcode Crystal Report > Generate Barcode Crystal Report
How to Generate Barcodes in Crystal Report
Barcode Generator for Crystal Report is designed for linear barcodes (Code 39, Code 128, EAN/UPC) and 2D barcodes (QR Code, PDF 417 and Data Matrix) automation purpose in Crystal Report.
This Barcode Component is fully integrated one and will be stays on Crystal Report once installed. High quality barcode images could be maintained when you exporting reports to PDF, word, excel and rich text formats.
Property customization includes adjustment of barcode height, margins, character color, font style and margin parameters. High and low resolution images could be created and saved in PNG, BMP, GIF, JPEG, TIFF image formats.
Requirement of Barcode Generator for Crystal Report
Windows Operating Systems
- Microsoft Windows 7
- Windows Server 2008
- Windows Vista
- Windows Server 2003
- Windows XP
Development Environments
-.NET Framework 2.0, 3.0, 3.5, 4.0
- C#, VB.NET, Managed C++, Borland Delphi for.NET
- Visual Studio 2005/2008/2010
-Microsoft SQL Server 2005, 2008 or 2010
How to Create a New Crystal Report in Visual Studio
  1. Download Barcode Generator for Crystal Report Free Trial and unzip;
  2. Start Visual Studio and create a new Crystal Reports.
  3. Select the default of "Standard Report" in Crystal Report Gallery dialog box.
  4. In the Data tab, expand "Create New Connection" and choose "ADO.NET". Double click the button to see the "Connection" form. Navigate to the "CustomerDataSet.xsd" in the downloaded package and click "Finish".
  5. Add "Table" in NewDataSet to the Selected Table, click "Next".
  6. Add all columns to the right fields and after click "Next", then "Finish".
  7. In CrystalReport1.rpt, drag and drop field "Barcode" to the report Section 3 (Details).
How to Create Barcode Images in Crystal Report Using .NET Control
  1. Open Solution Explorer, navigate to "BusinessRefinery.Barcode.CrystalReport.dll" and add to project reference.
  2. Double click the Form1 to the default "Form1.cs", and copy the sample code of C# or VB.NET to your project.
  3. Using the namespace "System.Data.OleDb" and "BusinessRefinery.Barcode".
  4. Debug the webpage, the barcodes are embedded in the report.

C# & VB Sample Codes to Create Barcode Images in Crystal Report
Copy the following code accordingly and run the project.
using System.Data.OleDb;
using BusinessRefinery.Barcode;

protected void Page_Load(object sender, EventArgs e)
{
OleDbConnection aConnection = new OleDbConnection(
          "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:/Demo/BarcodeD
          emoData.mdb");
          aConnection.Open();OleDbDataAdapter dataAdapter = new OleDbData
          Adapter("select * from Customer", aConnection);
          DataSet ds = new DataSet();
          dataAdapter.Fill(ds);
          //add a new column named "Barcode" to the DataSet, and the new 
          column data type is byte[]
          ds.Tables[0].Columns.Add(new DataColumn("Barcode", typeof(byte
          [])));
          
          Linear barcode = new Linear();
          barcode.Symbology = BusinessRefinery.Barcode.Symbology.CODE128;

          foreach (DataRow dr in ds.Tables[0].Rows)
          {
              barcode.Code = (int)dr["CustomerId"] + "";
              
              byte[] imageData = barcode.drawBarcodeAsBytes();
              dr["Barcode"] = imageData;
          }
          CrystalReport1 rpt = new CrystalReport1();
          rpt.SetDataSource(ds);
          this.crystalReportViewer1.ReportSource = rpt;
          aConnection.Close();

}
Imports BusinessRefinery.Barcode.CrystalReport
Imports BusinessRefinery.Barcode
Imports System.Data

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.
        EventArgs) Handles MyBase.Load
        Dim aConnection As New OleDb.OleDbConnection("Provider=Microsoft.
        Jet.OLEDB.4.0;Data Source=C:/Demo/BarcodeDemoData.mdb")
        aConnection.Open()
        Dim dataAdapter As New OleDb.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 Linear()
        barcode.Symbology = Symbology.CODE128

        For Each dr As DataRow In ds.Tables(0).Rows
            barcode.Code = 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
End Class