This barcode generator is a robust reporting tool fully integrated into .NET development environments such as Windows Forms, WPF, and web applications. It allows fields in Crystal Reports to be converted into EAN-13 barcodes with straightforward configuration steps.
This guide provides a structured, step-by-step approach to generating EAN-13 (a linear barcode symbology for global product identification) in Crystal Reports for .NET within ASP.NET, Windows Forms, and WPF projects. It covers core implementation, add-on symbol configuration, human-readable text customization, and check digit validation to ensure compliance with GS1 standards and seamless integration with Crystal Reports components.
.NET Crystal Reports EAN-13 Linear Barcode Overview
EAN-13, based upon the UPC-A standard, was implemented by the International Article Numbering Association (EAN) in Europe. And it is a superset of UPC-A. An EAN-13 barcode is composed of four parts: 1) The number system, 2) The manufacturer code, 3) the product code, and 4) the check digit.
EAN-13 Barcode Standard Compatibility: All EAN-13 barcode images created by our .NET Crystal Reports Barcode Generator Library are complying wiht its latest barcode specifications, like GS1 Specification. And all of them can be read & scanned by almost barcode printers.
EAN-13 Barcode Add-on Symbol Configuration in Crystal Reports
EAN-13 supports 2 digit or 5 digit add on symbols, positioned after the main symbol's right quiet zone, for supplementary data such as price or batch numbers in Crystal Reports product labels.
Print EAN-13 with Add-on Symbol
To generate EAN-13 with add on symbols for Crystal Reports:
Set Type to BarcodeType.EAN13_2 (2 digit add on) or BarcodeType.EAN13_5 (5 digit add on).
Assign the main EAN-13 data to the Data property (12 or 13 digits).
Set the supplementary data to the SupData property (2 or 5 digits, matching the add on type).
Note: Mismatched add on digit lengths (e.g., 3 digits for EAN13_2) will produce invalid barcodes.
Advanced Add-on Customization
The BarcodeLib library offers additional properties to customize add on symbol spacing and alignment, optimizing for Crystal Reports page header or footer layout:
SupHeight: Add on symbol height as a percentage of the EAN-13 main symbol. The default is 0.8f (80% of the main symbol height).
SubSpace: Modifies the gap between the main symbol and the add on; ensure compliance with GS1 quiet zone standards. The default is 15 pixels, and the maximum space shall be 12X (where X is the bar module width).
EAN-13 Human Readable Interpretation (HRI) for Crystal Reports
The GS1 System recommends the OCR B font for EAN-13 human readable text (HRI) to ensure scannability and compliance. Crystal Reports for .NET supports HRI customization via the TextFont and TextMargin properties.
Customize EAN-13 HRI in the Report
Set AutoResizeBarcodeText to false to manually control the printed EAN-13 text font size.
Set TextFont to OCR-B to match GS1 standards for Crystal Reports printing, and specify the desired font size.
Configure TextMargin to control spacing between the barcode bars and the HRI; a minimum of 0.5X per GS1 is recommended, with 1X typical for readability.
Set the text color via the TextColor property.
Note: Using non OCR fonts may violate GS1 standards. Test HRI readability in Crystal Reports Print Preview before report distribution.
Advanced EAN-13 Customization for Crystal Reports
Quiet Zone Indicator
Control the display of the EAN-13 quiet zone indicator, a small mark at the end of the barcode, to optimize Crystal Reports layout:
Set ShowQuietZoneIndicator to false to hide the indicator.
Lead / Trail Digit Spacing
Adjust spacing for improved readability in Crystal Reports:
UPCEANLeadDigitSpace: Space between the first digit and the start bar (default: 0).
UPCEANTrailDigitSpace: Space between the stop bar and the quiet zone indicator (default: 0).
EAN-13 Check Digit Validation in Crystal Reports
EAN-13 requires a mandatory check digit, calculated using the modulo 10 algorithm, to ensure data integrity. The BarcodeLib library automatically calculates the check digit when 12 digits are provided; if 13 digits are provided, it validates the check digit.
Calculation Logic
For a 12 digit EAN-13 input, such as "123456789012":
Sum the digits in odd positions (1st, 3rd, 5th, …, 11th) and multiply the sum by 3.
Sum the digits in even positions (2nd, 4th, 6th, …, 12th).
Add the two sums together.
Calculate the check digit as the value needed to round the total to the next multiple of 10 (e.g., input "123456789012" yields check digit 8).
Summary
This guide has provided a comprehensive walkthrough for generating, printing, and customizing EAN-13 barcodes in Crystal Reports using the BarcodeLib .NET library.
Print EAN-13 in Reports: Generate EAN-13 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 (via WindowsFormsHost).
Customization: Use add on symbols for supplementary data, apply GS1 compliant OCR B fonts for human readable text, and adjust spacing and quiet zone settings to fit Crystal Reports layout requirements across headers, footers, and details sections.
Data Integrity: Ensure EAN-13 data consists of numeric digits (12 or 13 characters) and rely on the library’s automatic check digit calculation or validation to comply with GS1 standards and avoid invalid barcodes in report distribution.
Crystal Reports Barcode Generator DLL for .NET Supported Barcodes