Introduction of UPC-A Crystal Reports Barcode Generator

Top
UPC-A barcode generator for Crystal Report is one function of our mature .NET barcode component, which is completely built in C#.NET in .NET Framework environment to generate barcodes in Crystal Report with high quality.
OnBarcode.com provides not only UPC-A
.NET Barcode SDK for Crystal Reports, but also other linear and 2D barcode generator for Crystal Report with detailed online
how-to guide:
- .NET Crystal Reports Linear Barcodes: Code 39, Code 128, EAN-8, EAN-13, GS1 128, UPC-A, UPC-E, Interleaved 2 of 5, Identcode, ISBN, ISSN, ITF-14, Leitcode, MSI Plessey, OneCode, Planet, Postnet, RM4SCC, etc
- .NET Crystal Reports 2D Barcodes: including
QR Code, Data Matrix, PDF-417
How to Print UPC-A in .NET Using Crystal Reports Barcode Control

Top
This guide provides a structured, step-by-step methodology for generating UPC-A (a fixed-length linear barcode symbology for North American product identification) in Crystal Reports for .NET within ASP.NET and WinForms projects. It covers core implementation, advanced customization options, and check digit calculation to ensure compliance with GS1 standards and seamless integration with Crystal Reports components.
Preparation
We have two step by step tutorials to create new ASP.NET and Windows Forms .net framework projects to print barcodes in .rpt report file in .NET application.
After you have created a new ASP.NET or Windows Forms project with the first barcode printed in the .rpt report,
we will learn how to generate and customize UPC-A barcodes in Crystal Reports in the .NET application.
Print UPC-A barcodes in Crystal Report
Here we will start to print UPC-A in the Crystal Reports report designer and report viewer.
In Visual Studio IDE,
- For ASP.NET project, open file
Default.aspx.cs
- For Windows Forms project, open file
Form1.cs
Follow the steps to embed UPC-A barcodes into a Crystal Report:
- Change barcode type from Code 128 to UPC-A.
BarcodeType.UPCA;
linear.Type = BarcodeType.UPCA;
After successfully generating the UPC-A barcodes in report file in your C# ASP.NET/WinForms project,
we will further customize the UPC-A in the report.
UPC-A Barcode Add-on Configuration in Crystal Reports

Top
UPC-A supports 2-digit or 5-digit add-on symbols (positioned after the main symbol's right Quiet Zone) for supplementary data (e.g., price, batch numbers) in Crystal Reports product labels.
Print UPC-A with add-on symbol
To generate UPC-A with add-on symbols in Crystal Reports:
- Set Type to
BarcodeType.UPCA_2 (2-digit add-on) or BarcodeType.UPCA_5 (5-digit add-on).
- Assign the main UPC-A data to the
Data property (11 or 12 digits).
- Set supplementary data to the
SupData property (2 or 5 digits, matching the add-on type).
Linear barcode = new Linear();
barcode.Type = BarcodeType.UPCA_2;
barcode.Data = "12345678912";
barcode.SupData = "12";
Note: Mismatched add-on digit lengths (e.g., 3 digits for UPCA_5) will produce invalid barcodes.
Advanced Add-on Customization
The OnBarcode library offers additional properties to customize add-on symbol spacing and alignment (optimize for Crystal Reports Page Header/Footer layout):
SupHeight : Add-on symbol height, % of the UPC-A main symbol. The default is 0.8f (80% of the main symbol height).
SubSpace : Modify the gap between the main symbol and add-on (ensure compliance with GS1 quiet zone standards). The default is 15 pixel. The maximum space shall be 12X (property X is the bar module width).
Advanced UPC-A Customization for Crystal Reports (C#)

Top
Quiet Zone Indicator Configuration
The UPC-A quiet zone indicator (a small mark at the end of the barcode) can be hidden to optimize space in Crystal Reports layouts (e.g. narrow Page Header sections):
In Crystal Reports ASP.NET or Windows Forms project, set the property
ShowQuietZoneIndicator to false to hide the UPC-A quiet zone indicator mark.
barcode.ShowQuietZoneIndicator = false;
Lead/Trail Digit Spacing and Styling
Customize the position and appearance of the first/last UPC-A digits to improve readability in Crystal Reports:
UPCEANLeadDigitSpace : Space between the first digit and start bar (default: 0).
UPCEANTrailDigitSpace : Space between the stop bar and quiet zone indicator (default: 0).
UPCEANLeadDigitYShift / UPCEANTrailDigitYShift : Vertical offset of the first/last digits (adjust for alignment in Crystal Reports PictureBox).
UPCEANLeadTrailDigitSizeRatio : Font size ratio of first/last digits vs. other digits (default: 1.0f).
barcode.UPCEANLeadDigitSpace = 10;
barcode.UPCEANTrailDigitSpace = 10;
barcode.UPCEANLeadTrailDigitSizeRatio = 0.6f;
barcode.UPCEANLeadDigitYShift = -20;
barcode.UPCEANTrailDigitYShift = -20;
Note: Excessive vertical offset values may cause digits to be cut off in Crystal Reports.
Test layout in report preview before report distribution.
UPC-A Check Digit Calculation for Crystal Reports (C#)

Top
UPC-A requires a mandatory check digit (calculated via module 10 algorithm) to ensure data integrity. The OnBarcode library auto-calculates the check digit if 11 digits are provided; for 12-digit input, it validates the check digit.
Step-by-Step Calculation
For an 11-digit UPC-A input (e.g., "12345678901"):
- Assign odd/even positions from right to left (right-most digit = odd).
- Sum digits in odd positions and multiply by 3.
- Sum digits in even positions.
- Add the results from steps 2 and 3.
- The check digit is the value needed to make the total a multiple of 10 (0 if total is already a multiple of 10).
Example Calculation
Input: "12345678901"
- Odd positions (right to left): 1, 9, 7, 5, 3, 1 -> Sum = 26 -> 26 × 3 = 78
- Even positions: 0, 8, 6, 4, 2 -> Sum = 20
- Total: 78 + 20 = 98
- Check digit: 2 (98 + 2 = 100, a multiple of 10)
Note: Invalid check digits will result in unreadable barcodes. Validate check digits in the Development environment before Deployment to ensure compliance with retail scanning standards.
Here we have explained how to generate, print UPC-A barcodes in Crystal Reports and customize it using OnBarcode Barcode Generator for Crystal Reports C# library.
Print UPC-A in Report: Generate UPC-A in C# and bind it to Crystal Reports for .NET using ReportDocument, CrystalReportViewer, and .rpt file templates (compatible with ASP.NET Web Forms/WinForms PictureBox controls).
UPC-A Customization: Adjust quiet zone indicators, digit spacing, and font size to fit Crystal Reports layout (Header/Footer/Details sections) while maintaining GS1 compliance.
UPC-A Data Encoding: Ensure UPC-A input is 11/12 numeric digits, validate check digits (auto-calculated by the library), and embed validation logic in Crystal Reports Formula fields to avoid invalid barcodes in report distribution.
Common Asked Questions
What is a GTIN-12 UPC-A barcode?
GTIN-12 is a 12 digits Global Trade Item Number. It is usually encoded in UPC-A barcode. The 12 digits Global Trade Item Number includes 11 digits of data message,
and one digit of check sum digit.
Using .NET Crystal Reports Barcode Generation Library, you can input 12-digit GS1 numeric data or 13-digits data with checksum digit in report barcode item data source.
What is the difference between UPC-A and UPC-E?
Both of UPC-A and UPC-E are UPC barcode.
UPC-A is a 12-digit barcode, and UPC-E is a compressed UPC-A with 6 digits code. The UPC-E will be used in limited space for a barcode.
You can create both UPC-A and UPC-E images in Crystal reports in report designer and preview UPC barcode in report viewer using .NET Crystal Reports barcode library.
What is the difference between EAN-13 and UPC-A?
UPC-A Format barcodes have traditionally been used in the North America (USA and Canada),
whereas EAN-13 format barcodes have been used throughout the rest of the world.
.NET Crystal Reports Barcode Generator SDK supports both UPC and EAN with add-on symbol barcode generation in Crystal reports
in .NET C#/VB.NET class, ASP.NET Core, WinForms, WPF applications.
What is the minimum & maximum size for a UPC-A barcode?
- The Minimum X-dimension for the UPC-A barcode is 0.0104 inches.
- The Maximum X-dimension for the UPC-A barcode is 0.0260 inches
You can apply the UPC-A barcode X-dimension and Y-dimension in Crystal Reports report item proeprty settings in report designer using OnBarcode .NET Crystal Reports Barcode Generator library.