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
This barcode generator facilitates the insertion of GS1-128 symbols into Crystal Reports based on user input. The control supports integration with .NET applications such as ASP.NET, WinForms, and WPF, enabling runtime interaction with Crystal Reports.
This guide delivers a structured, step-by-step approach to generating GS1-128 (a structured variant of Code 128 for global supply chain identification) in Crystal Reports for .NET within ASP.NET, Windows Forms, and WPF projects. It covers core implementation, data encoding rules, barcode characteristics, and dimension configuration to ensure compliance with GS1 standards and seamless integration with Crystal Reports components.
.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
Create a new ASP.NET website.
Choose "ASP.NET Crystal Reports Web Site" as the template and named the project as "BarcodeforCrystalReportsWebSite".
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
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;
protectedvoid 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;
GS1-128 Barcode Basic Characteristics for Crystal Reports
Encodable Character Set
GS1-128 (supported in Crystal Reports for .NET) adheres to the following character set rules:
Uses a subset of ISO/IEC 646 International Reference Version for GS1 Application Identifier (AI) element strings.
Encodes ASCII values 128–255, supporting international character sets for global supply chain reports.
Includes four non-data function characters: FNC1, FNC2, FNC3, and FNC4; however, only FNC1 and FNC3 are used in GS1-128.
Features code set selection characters, three start characters, and one stop character.
Note: Function characters, code set selection characters, and start/stop characters must not be manually added to the Data property. The BarcodeLib library automatically inserts these characters into the GS1-128 symbol.
Check Digit Configuration
GS1-128 includes a mandatory check digit, consistent with Code 128, to ensure data integrity.
The check digit is automatically added by the library before the stop character; the AddCheckSum property is not applicable for GS1-128.
The check digit is not displayed in the human-readable interpretation (HRI), optimizing Crystal Reports label layout.
Note: Attempting to set AddCheckSum for GS1-128 has no effect.
GS1-128 Dimension Settings for Crystal Reports
A GS1-128 barcode can be generated with specified image width and height directly in the Crystal Reports report template.
UOM: Unit of measure (PIXEL, CM, or INCH), which should match the units used in the Crystal Reports report.
Set the target GS1-128 image width and height using the BarcodeWidth and BarcodeHeight properties.
Additional Size Options
Further dimension customization is available to fit Crystal Reports layouts, such as headers, footers, or details sections, using the following properties:
AutoResize: When true, the library automatically selects the maximum bar module width and height. When false, the library uses the developer specified X and Y values.
X: Narrow element width; the minimum value should be defined by GS1 standards and application specifications.
Y: Bar module height; ensure it fits within the bounds of the Crystal Reports picture control.
LeftMargin / RightMargin: Quiet zone margins; a minimum of 10X is required to comply with GS1 scanning standards.
Note: Inadequate quiet zones (less than 10X) can cause scanning failures. Test barcode scannability in the staging environment before production deployment.
For VB.NET developers, the equivalent syntax uses Dim barcode As New Linear() and sets the same properties. In WPF, the Crystal Reports Viewer is embedded via WindowsFormsHost, and the barcode generation logic remains unchanged.
Summary
This guide has provided a comprehensive walkthrough for generating, printing, and customizing GS1-128 barcodes in Crystal Reports using the BarcodeLib .NET library.
Print GS1-128 in Reports: Generate GS1-128 barcodes in C# or VB.NET and bind them to Crystal Reports for .NET using ReportDocument, CrystalReportViewer, and .rpt file templates. This approach is compatible with ASP.NET Web Forms, WinForms, and WPF.
GS1 Data Rules: Strictly follow GS1 Application Identifier formatting in the Data property. Do not manually add function, start, or stop characters, as these are automatically inserted by the library to prevent invalid barcodes.
Barcode Configuration: Set dimensions, including narrow element width and quiet zone, to comply with GS1 standards and fit Crystal Reports layout requirements across headers, footers, and details sections, thereby ensuring scannability for supply chain report distribution.