Create, Print Code 128 Barcode in RDLC Reports

Code 128 Barcode Creation in RDLC Reports with C# and VB Programming
  • Fully compatible with Visual Studio 2005/2008/2010
  • Support Microsoft .NET Framework 2.0, 3.0, etc
  • Entirely support Microsoft SQL Server 2005 and greater
  • Create 20+ linear & 2D barcodes (including Code 128) in RDLC Reports
  • Provide flexible Code 128 size setting to get customized barcode image
  • Easy to adjust Code 128 barcode properties with C# or VB class
This structured guide walks you through Code 128 linear barcode generation in RDLC local reports with C# code. It is fully optimized for all .NET Framework project types. Covered platforms include ASP.NET Web Forms, MVC, WPF and WinForms applications. It integrates natively with the official .NET ReportViewer Control for stable report rendering.
Code 128 Barcode Library for RDLC Reports Overview
With this Code 128 Barcode Library for RDLC Reports, developers are able to generate high-quality Code 128 barcode image in RDLC Reports. A detailed tutorial with C# and VB sample code is provided online to realize easy barcode creation.
Code 128 Barcode Description
Code 128 provides excellent density for all-numeric data and good density for alphanumeric data. It is often selected over Code 39 in new applications because of its density and because it offers a larger scope of character selection.


Code 128 Barcode Data Encoding in RDLC Local Reports (C# .NET)

Code 128 is a highly versatile linear barcode with broad character support, ideal for diverse .NET reporting needs. It adheres to global barcode standards, making it suitable for commercial and industrial RDLC reports.


Code 128 Supported Character Sets

  • Full set of 128 standard ASCII characters (compliant with ISO/IEC 646)
  • Extended ASCII characters (range 128 - 255, compliant with ISO/IEC 8859-1) via FNC4
  • 4 non-data function characters labeled FNC1 to FNC4
  • 4 dedicated code set selection characters
  • 3 start characters and 1 stop character (automatically inserted by the .NET library)


Code 128 Data Code Set Configuration

Code 128 uses three specialized code sets (A, B, C), each optimized for specific data types. This is similar to using specialized input modes for different text types on a keyboard.
  • Code Set A: Supports uppercase alphanumeric characters, control codes and special symbols
  • Code Set B: Supports uppercase & lowercase alphanumeric characters and common symbols
  • Code Set C: Optimized for numeric data (highly efficient for long number strings in RDLC)
Using the default BarcodeType.CODE128 setting lets the library auto-select the optimal code set. You can also manually specify a code set using one of the dedicated enumeration values.
  • BarcodeType.CODE128A (manual Code Set A selection)
  • BarcodeType.CODE128B (manual Code Set B selection)
  • BarcodeType.CODE128C (manual Code Set C selection)


Code 128 Function Characters (FNC) for RDLC Reports

Function Characters enable advanced, industry-specific barcode functionality in RDLC reports. Each FNC character serves a unique purpose for specialized .NET reporting workflows.
  • FNC1: Enables GS1 system compliance (essential for retail and logistics RDLC reports)
  • FNC2: Supports message append (splits large datasets across multiple Code 128 barcodes)
  • FNC3: Used for barcode scanner reprogramming (rarely used in standard RDLC reports)
  • FNC4: Activates extended ASCII character encoding (128 - 255 range)

Note
You do not need to manually input FNC characters into the Data property. The .NET barcode library auto-encodes FNC characters based on your data and configuration. For example, GS1-formatted data will automatically trigger FNC1 encoding for compliance.


Code 128 Check Digit Configuration

Code 128 requires a mandatory MOD 103 check digit for data integrity. This check digit (codeword) is generated automatically by the KeepAutomation C#.NET library.
  • The check digit does not appear in the barcode's human-readable text (HRI)
  • The AddCheckSum property does not apply to Code 128 and will be ignored by the library
  • The check digit is always inserted right before the stop character

Note
We recommend avoiding manual input of start or stop characters in the Data property. Manual insertion causes duplicate control characters, leading to RDLC barcode encoding failures.


Code 128 Barcode Human Readable Interpretation (HRI) for RDLC (C#)

HRI refers to the human-readable text displayed alongside the Code 128 barcode. This text is required for most RDLC report use cases and must stay within quiet zone boundaries. The default HRI position is below the Code 128 barcode, optimized for standard RDLC layouts.

HRI Customization Properties
  • TextMargin: Adjusts the spacing between the barcode and its text label
  • TextFont: Sets the font family and size for the HRI text
  • TextColor: Defines the color of the HRI text

Note
We recommend previewing the RDLC report to confirm HRI displays clearly. Ensure the HRI does not overlap with quiet zones or other report controls like textboxes. Avoid using heavily negative TextMargin values, as this may cut off the HRI text. You can test with sample data first to verify proper layout rendering.


Code 128 Barcode Dimension Settings for RDLC Local Reports (C# .NET)

You can customize Code 128 barcode dimensions to fit RDLC and Crystal Reports report layouts. These settings apply to all .NET projects including ASP.NET, WPF and WinForms.


Basic Dimension Configuration

  • UOM: Select unit of measure (PIXEL, CM, INCH)
  • BarcodeWidth: Set total width of the Code 128 barcode image
  • BarcodeHeight: Set total height of the Code 128 barcode image


Advanced Dimension Customization

For precise RDLC print layout compliance, you can use these advanced size properties.
  • AutoResize: If true, library auto-selects optimal module dimensions; if false, uses manual X & Y values
  • X: Width of the narrowest barcode module (follow application minimum requirements)
  • Y: Height of individual barcode bars
  • Quiet Zones: LeftMargin, RightMargin, TopMargin, BottomMargin (minimum 10X for industry compliance)

Note
We recommend verifying barcode dimensions match configured values in RDLC preview. Check for no stretching or distortion within the RDLC Image report item. For high-resolution 300 DPI printing, adjust the Resolution property to match print settings. This prevents blurry barcode output in printed or exported RDLC reports.








Frequently Asked Questions

What is Code 128's text coding capability?

Code 128 is a high-density linear barcode that encodes text. It encodes numbers, text, control characters, and all 128 ASCII characters.

What is Code 128 used for in practice?

Code 128 is a common linear barcode, used across: supply chain and packaging, food and retail goods, and identification systems in healthcare and the public sector.

What is the check digit for Code 128?

Code 128 has a mandatory check digit (checksum). This value is derived from a Modulus 103 algorithm applied to all the preceding data characters.

What's Code 128 barcode's maximum character length?

The ISO Code 128 standard doesn't specify a maximum character limit. GS1-128, a related standard, has a 48-character maximum for its data content.

How do you scan and read Code 128?

Scan Code 128 via free barcode scanner software, a dedicated scanner device, or third-party mobile apps, handheld barcode scanners, or dedicated software on your computer.

Which is better: Code 128 or Code 39?

Compared to Code 39, Code 128 is more compact. It can encode more data in a smaller space than Code 39.
















Free Trial DownloadRDLC Code 128Code 128 PropertiesData Matrix for RDLCPDF417 for RDLCQR Code for RDLCmoreCodabar for RDLCCode 39 for RDLCEAN-8 for RDLCEAN-13 for RDLCEAN 128 for RDLCIntelligent Mail for RDLCInterleaved 2 of 5 for RDLCISBN for RDLCITF-14 for RDLCRM4SCC for RDLCUPC-A for RDLCUPC-E for RDLCmore
KeepAutomation provides complete barcode automation solutions. We recommend the customers use high quality document controls: ASP.NET Document Viewer, ASP.NET MVC Document Viewer, Document Viewer ASP.NET C#, ASP.NET PDF Viewer, ASP.NET Word Viewer, ASP.NET Excel Viewer, ASP.NET PDF Editor, MVC PDF Viewer, ASP.NET Annotate PDF, c# pdf sdk, C# View, edit PDF online , C# Convert PDF to Tiff, C# Convert PDF to text, txt, .net imaging sdk, C# PDF metadata edit from RasterEdge.com.