Our Customers
Contact Us Email: support@barcodelib.com
Home > .NET Crystal Reports Barcode > Crystal Reports Barcode Generating > How to Generate GS1-128/EAN-128 Barcode on .NET Crystal Reports
Download Barcode for Crystal Reports Trial

Crystal Reports GS1-128 Barcode Generator SDK

Create & Generate EAN-128/GS1-128 Barcodes on Crystal Reports in .NET Programs
  • Easy-to-use, professional .NET Crystal Reports GS1 128/ EAN 128 Bar Coding Libary DLL
  • Provide free Crystal Reports GS1-128/EAN-128 Generation DLL trial version for evaluation purpose
  • Able to encode & generate Crystal Reports GS1-128/EAN-128 barcode for ASP.NET Website, Web Services & .NET Windows Forms programs
  • Simple to create & print 1d GS1-128/EAN-128 barcode images with Visual C# or Visual Basic
  • Easy to use Visual C# & VB.NET class code to generate Crystal Reports EAN-13 barcodes
  • Capable of generating other linear barcodes on Crystal Reports, like Code 39, EAN-13, QR Code
.NET Crystal Reports GS1-128/EAN-128 Barcode
GS1-128 is similar with Code 128 barcode in encodable data, symbol structure, & barcode standard. GS1-128 uses a series of Application Identifiers (AI) to encode additional data information, like best before dates, batch numbers, quantities, weights and many other attributes needed by user.
GS1-128 Barcode Standard Compatibility: GS1-128 barcode generated by BarcodeLib.com Crystal Reports Barcode Generator DLL are based on its latest barcode specifications, like GS1 Specification. Besides, GS1-128 barcode, this mature .NET Crystal Reports Barcode Generation Library also supports other commonly used 1d barcodes, such as Codabar, Code 39, Code 128, EAN-8, EAN-13, ITF-14, Interleaved 2 of 5, Planet, Postnet, UPC-A, UPC-E, etc.
Crystal Reports GS1-128 Barcode Generation for ASP.NET Web 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[])));

// Create an instance of Linear Barcode
LinearCrystal barcode = new LinearCrystal();
// Barcode settings
barcode.Type = BarcodeType.EAN128;
barcode.BarHeight = 50; //50 pixel
barcode.ImageFormat = System.Drawing.Imaging.ImageFormat.Png;

foreach (DataRow dr in ds.Tables[0].Rows)
{
barcode.Data = (int)dr["CustomerId"] + "";
barcode.Data = "(11)030131(10)958777";
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.
Crystal Reports GS1-128 Barcode Generation for .NET Windows 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[])));

// Create an instance of Linear Barcode
LinearCrystal barcode = new LinearCrystal();
// Barcode settings
barcode.Type = BarcodeType.EAN128;
barcode.BarHeight = 50; //50 pixel
barcode.ImageFormat = System.Drawing.Imaging.ImageFormat.Png;

foreach (DataRow dr in ds.Tables[0].Rows)
{
barcode.Data = (int)dr["CustomerId"] + "";
barcode.Data = "(11)030131(10)958777";
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.
Using C# or VB Class to Generate Crystal Reports GS1-128 Linear Barcode
.NET Crystal Reports Barcode Generator SDK Supported Barcodes
Linear (1D) Barcodes:
Matrix(2D) Barcodes:
1D (Linear) Barcodes Types Supported by .NET Crystal Reports Barcode Generator SDK: Codabar, Code 11, Code 2 of 5, Code 39, Code 93, Code 128, EAN-8, EAN-13, EAN 128/GS1 128, Interleaved 2 of 5, ITF14, MSI Plessey, Intelligent Mail (Onecode), PLANET, POSTNET, RM4SCC, UPC-A, UPC-E.
2D (Matrix) Barcodes Types Supported by .NET Crystal Reports Barcode Generator SDK: Data Matrix, PDF417, QR Code.