Introduction of Code 128 RDLC Barcode Generator
Code 128 Barcode Generator for RDLC is an advance barcode generator component which allows you to print Code 128 in client report RDLC for .NET projects. The integrated Code 128 control DLL easily draws Code 128 in report as high quality graphics objects. The generated Code 128 barcodes are adjustable. C#.NET and VB.NET could be used to make the adjustment.
Except for Code 128, there are more than 40 types of linear and 2D barcode images are supported by OnBarcoode.com Barcode Generator for .NET RDLC Local Report.
We provide detailed online tutorial:
How to create, print barcodes in RDLC reports?
How to create, print barcodes in RDLC reports?
- Linear Barcodes on RDLC Report: Code 128, Code 128, EAN-8, EAN-13, GS1 128, UPC-A, UPC-E, Interleaved 2 of 5, Postal Codes
- 2D Barcodes on RDLC Report: including QR Code, Data Matrix, PDF-417
How to Generate Code 128 Using RDLC Barcode Generator
This guide simplifies generating Code 128 linear barcodes within RDLC Local Reports using C#, tailored for ASP.NET (ASP.NET Framework, MVC) and WinForms (.NET Framework) projects integrated with the ReportViewer Control.
Preparation
We have two step by step tutorials to create new ASP.NET and Windows Forms .net framework projects to print barcodes in .rdlc report file in .NET application.
After you have created a new ASP.NET or Windows Forms project with the first Code 128 barcode printed in the .rdlc report viewer, we will learn how to further customize Code 128 barcodes in RDLC local reports in the .NET application.
Code 128 Barcode Data Encoding in RDLC Local Reports (C#)
Code 128 Supported Character Sets
Code 128 barcodes in RDLC reports support the following character sets (aligned with global barcode standards):
- All 128 full ASCII characters (per ISO/IEC 646)
- Extended ASCII characters (128–255, ISO/IEC 8859-1) via Function Character 4 (FNC4)
- 4 non-data function characters (FNC1–FNC4)
- 4 code set selection characters
- 3 Start characters and 1 Stop character (auto-added by the library)
Code 128 Data Code Sets Configuration
Code 128 uses three distinct code sets (A/B/C), each optimized for specific data types in RDLC reports:
- Code Set A: Alphanumeric, control characters, and special symbols
- Code Set B: Alphanumeric, lowercase letters, and common symbols
- Code Set C: Numeric data (efficient for long numbers in RDLC)
BarcodeType.CODE128, the RDLC barcode generation library auto-selects the optimal code set for RDLC,
or you can set it manually by choose one of the following type:
- BarcodeType.CODE128A
- BarcodeType.CODE128B
- BarcodeType.CODE128C
barcode.Data = "Code-128"; barcode.Type = BarcodeType.CODE128;
Code 128 Function Characters (FNC) for RDLC
Function Characters (FNC) enable advanced functionality in Code 128 barcodes for RDLC reports:
- FNC1: For GS1 system compliance (critical for logistics/retail RDLC reports)
- FNC2: For message append (split large data across multiple RDLC barcodes)
- FNC3: For barcode reader reprogramming (rare in standard RDLC use cases)
- FNC4: For extended ASCII encoding (128–255, ISO/IEC 8859-1)
Note: You do not need to manually input FNC characters. The RDLC barcode library auto-encodes them based on the data and RDLC use case (e.g. GS1 data triggers FNC1 automatically).
Code 128 Check Digit Configuration
Code 128 requires a mandatory MOD 103 check digit (auto-generated by the library for RDLC compliance):
- The check digit is not displayed in the Human Readable Interpretation (HRI)
- The
AddCheckSumproperty is not applicable to Code 128 (library ignores this setting) - The check digit is always added before the
Stop character (ensures data integrity in RDLC)
Note: Avoid manually adding Start/Stop characters to the Data property. The barcode library auto-adds them, and manual inclusion causes encoding errors in RDLC.
Code 128 Barcode Human Readable Interpretation (HRI) for RDLC (C#)
HRI (text below/above the barcode) is required for Code 128 in RDLC reports and must not violate quiet zone boundaries.
Render HRI Below the Code 128 Barcode (Default for RDLC)
TextMargin: Set the space between barcode and text labelTextFont: Code 128 text label font family and size.TextColor: Text color
barcode.TextMargin = 10; barcode.TextFont = new Font("ocr-b", 22); barcode.TextColor = Color.Blue;
Note:
Check the RDLC report to confirm HRI is visible and does not overlap with quiet zones or other report elements (e.g. Textbox, Line).
Excessively negative
Excessively negative
TextMargin values may cause HRI to be cut off by the RDLC barcode Image report item. Do test with sample data first.
Do not print Code 128 barcode text label in report
To save barcode printing space, you can print Code 128 barcodes without text label rendered in the RDLC report.
- Set property
ShowTextto false to hide the Code 128 barcode text label.
barcode.ShowText = false;
| Code 128 no text label in RDLC report in ASP.NET web page | Code 128 no text label in RDLC report in Windows Forms |
|
|
Code 128 Barcode Dimension Settings for RDLC Local Reports (C#)
RDLC Barcode library use the following properties to customize the Code 128 barcode dimension size in local report in C# ASP.NET, WPF, WinForms project.
Further customize Code 128 dimensions for RDLC Print Layout compliance using these properties:
UOM: Unit of measure (PIXEL, CM, INCH)BarcodeWidth: Code 128 barcode image widthBarcodeHeight: Code 128 barcode image height
barcode.UOM = UnitOfMeasure.INCH; barcode.BarcodeWidth = 1; barcode.BarcodeHeight = 0.5f;
Further customize Code 128 dimensions for RDLC Print Layout compliance using these properties:
AutoResize: If true, the barcode library will choose the maximum bar module width and height values. If false, the barcode library will use the developer specified X value for bar module width, and Y value for bar module height.X: Width of narrow element (minimum value defined by application specs)Y: Bar module height- LeftMargin/RightMargin/TopMargin/BottomMargin: Quiet zone (minimum width = 10X for RDLC compliance)
Note:
Check the RDLC report to confirm the Code 128 barcode dimensions match the configured values (no stretching in the Image report item).
For high-resolution RDLC printing (300 DPI), set
For high-resolution RDLC printing (300 DPI), set
Resolution to align with Print Layout settings (avoids blurry barcodes).
Summary
- The core workflow for generating Code 128 in an RDLC Local Report is
- Initialize
Linearbarcode object, and set barcode type asBarcodeType.CODE128 - Configure Code 128 encoding/code set
- Generate barcode byte stream
- Bind to RDLC image report item
- Render via ReportViewer Control (ASP.NET/WinForms)
- Initialize
- Key Code 128 configurations for RDLC: Auto/manual code set selection (A/B/C), mandatory MOD 103 check digit (auto-generated), and HRI positioning (below/above barcode with TextMargin).
- Critical RDLC compliance rules: Quiet zones (10X minimum), GS1 formatting for industry use cases, and alignment of barcode dimensions with the RDLC Image report item's size.
Common Asked Questions
What is the barcode Code 128 text code?
Code 128 barcode is a high-density 1d barcode symbology, which encodes digits, letters, control characters, and full ASCII 128 characters.
Using RDLC barcode generator library, you can create, print, insert Code 128 barcodes in RDLC report table cells, preview the Code 128 barcodes in RDLC
report viewer in .NET ASP.NET Core, Windows Forms projects.
What is Code 128 barcode maximum length?
There is no specific definition about Code 128 barcode maximum number of characters in Code 128 ISO 15417 standard.
However some Code 128 standards will provide the limits. GS1-128 has limits the maximum length of Code 128 data to 48 characters.
Using RDLC Barcode library, you will encode and generate ISO standard Code 128 and application approved Code 128 barcodes, such as GS1-128 in RDLC reports in .NET web and Windows applications.
However some Code 128 standards will provide the limits. GS1-128 has limits the maximum length of Code 128 data to 48 characters.
Using RDLC Barcode library, you will encode and generate ISO standard Code 128 and application approved Code 128 barcodes, such as GS1-128 in RDLC reports in .NET web and Windows applications.
What is the check digit for code 128?
Code 128 barcode contains a last digit of mandatory check digit (checksum) character, which is based on module 103 (mod 103).
Code 128 check digit will not be displayed in the Code 128 human readable text and will not be returned by the Code 128 barcode scanners.
Using RDLC barcode freeware, the generator software will automatically calculate the check character and insert into the Code 128 barcode
in Visual Studio .NET RDLC reports ASP.NET Core, Windows Forms projects.
What is Code 128 barcode commonly used for?
Code 128 barcode is a common linear barcode type used in:
- Food and non-food industries
- Shipping and packing industry
- Health, public sector and government bodies
Is Code 128 barcode better than Code 39?
Both Code 128 and Code 39 are popular 1d barcode symbologies.
Code 128 is more compact than Code 39, supporting more data to be encoded in a smaller space.
RDLC Barcode library allows C#/VB.NET developers to encoding and printing both Code 128 and Code 39
using Microsoft Visual Studio with the RDLC Report Designer extension.
How to scan, read Code 128 barcodes?
To scan, read and decode the Code 128 barcodes,
you can download and install OnBarcode free Code 128 barcode scanner software, or use barcode scanner device, or
smart phone (iOS or Android) camera with 3rd party barcode apps installed.