Introduction of Code 39 RDLC Barcode Generator
Code 39 Barcode Generator for RDLC is a .NET barcode generation SDK that allows developers to insert Code 39 barcode generation capabilities into the RDLC report for .NET. The generated Code 39 can be customized with a complete set of properties. Barcode symbol rotation is supported, allowing 0, 90, 180, or 270 degrees orientation.
Except for Code 39, 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 39, 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 39 Using RDLC Barcode Generator
This guide walks you through generating Code 39 linear barcodes within RDLC Local Reports using C#, optimized for ASP.NET (ASP.NET Framework, MVC) and WinForms (.NET Framework) projects integrated with the ReportViewer Control.
OnBarcode provides step-by-step tutorials about print barcode in RDLC report in C# ASP.NET, Windows Forms application.
In the above tutorials, you are able to create and print Code 128 barcodes in RDLC reports. Here we will update the demo codes to print Code 39 barcodes in RDLC report files (.rdlc)
Open file
Open file
Form1.cs in the Visual Studio
- Change barcode type from
BarcodeType.CODE128toBarcodeType.CODE39.
barcode.Type = BarcodeType.CODE39;
Code 39 Barcode Data Encoding in RDLC Local Reports (C#)
Code 39 Standard Mode
Code 39 (standard mode) in RDLC reports supports 43 characters, including:
To create standard Code 39 barcodes in RDLC report:
- Numeric digits (0 - 9)
- Uppercase letters (A - Z)
- Special characters: -, $, %, space, ., /, +
- Start/Stop character (*) (automatically added by the library, no need to include in Data property)
To create standard Code 39 barcodes in RDLC report:
- Enter the valid Code 39 standard characters in property
Data - Select barcode type as
BarcodeType.CODE39
barcode.Data = "CODE 39"; barcode.Type = BarcodeType.CODE39;
Code 39 Full ASCII Mode
Code 39 Full ASCII mode (extended Code 39) supports the complete 128-character ASCII set (per ISO 646 IRV) for RDLC reports requiring lowercase letters or extended symbols.
To create extended Code 39 barcodes in RDLC report:
To create extended Code 39 barcodes in RDLC report:
- Select barcode type as
BarcodeType.CODE39EX
barcode.Data = "Code-39"; barcode.Type = BarcodeType.CODE39EX;
Note: Verify the Code 39 barcode in the RDLC report includes only valid characters (standard/full ASCII mode).
Code 39 Check Digit Configuration
Code 39 does not include a checksum character by default, but you can enable a MOD43 checksum for enhanced data security in RDLC reports.
- Enable
AddCheckSumto add a checksum character in Code 39 barcode
barcode.AddCheckSum = true;
Note: For check digit-enabled Code 39 barcodes: Scan the barcode to confirm the check digit is validated correctly (critical for data integrity in RDLC reports).
OnBarcode C# Barcode Reader library supports scanning Code 39 barcodes with checksum character included from image, tiff, PDF files in ASP.NET, Windows application.
OnBarcode C# Barcode Reader library supports scanning Code 39 barcodes with checksum character included from image, tiff, PDF files in ASP.NET, Windows application.
Code 39 Start/Stop Character Configuration
Code 39 uses * as Start/Stop characters (automatically added by the library). You can hide these characters in the RDLC barcode's HRI:
- Disable
ShowStartStopInTextto hide start / stop characters in Code 39 barcode text label
barcode.ShowStartStopInText = false;
Note: Avoid including * in the Data property. The RDLC Code 39 library auto-adds it, and manual inclusion will cause encoding errors in RDLC.
Code 39 Barcode Dimension Settings for RDLC Local Reports (C#)
In the C# Code 39 generator for RDLC, use these properties to customize barcode dimensions (aligned with RDLC Print Layout requirements):
- Determine the Code 39 printing size in your .rdlc file (matches BarcodeWidth, BarcodeHeight).
UOMto choose the preferred unit of measure inch or cm.BarcodeWidthandBarcodeHeightto specify the Code 39 barcode image rendering size.
barcode.UOM = UnitOfMeasure.INCH; barcode.BarcodeWidth = 3; barcode.BarcodeHeight = 1;
Note: Define the desired dimension unit of measure (e.g. inch) for the Code 39 barcode (match RDLC Image report item unit of measure).
Check the RDLC report to confirm the Code 39 barcode dimensions match the configured values (no clipping in the Image control).
Check the RDLC report to confirm the Code 39 barcode dimensions match the configured values (no clipping in the Image control).
More options for Code 39 dimension size setting
You can further customize the Code 39 barcode size using the following options in the RDLC report file.
- AutoResize: It must be false to enable property X and Y.
- X: Width of narrow element (minimum value defined by application specs)
- Y: Bar module height
- N: Wide/narrow ratio (valid range: 2.0–3.0 inclusive)
- I: Intercharacter gap (minimum = X; maximum depends on X size)
- LeftMargin/RightMargin: Quiet zone (minimum width = 10X for RDLC compliance)
Note:
For RDLC reports printed at high resolution, set
Calculate quiet zones (10X minimum) to ensure scannability in printed RDLC reports.
Resolution (300 DPI recommended) to align with Print Layout settings.
Calculate quiet zones (10X minimum) to ensure scannability in printed RDLC reports.
Customizing Code 39 Barcodes for RDLC in ASP.NET/WinForms (C#)
The .NET RDLC Barcode Generator library lets you customize Code 39 bar/space width for RDLC reports using two core properties:
N: Wide/narrow bar ratio (2.0 - 3.0 inclusive; default = 2.0)I: Intercharacter gap (multiple of X; default = 1.0f)
Code 39 Wide/narrow bar ratio
Set property
N for Code 39 Wide/narrow bar ratio.
barcode.N = 3;
Note: Identify the desired wide/narrow ratio for RDLC report readability.
Ensure customizations comply with Code 39 standards (avoid ratios outside 2.0 - 3.0).
Ensure customizations comply with Code 39 standards (avoid ratios outside 2.0 - 3.0).
Code 39 Inter-character gap
Set property
I for Code 39 inter-character gap, which is multiple of X (Code 39 narrowest bar width).
barcode.I = 5;
Note: Excessively large I values may cause the barcode to exceed the RDLC Image control bounds. Do test with sample data first.
Summary
- The core workflow for generating Code 39 in an RDLC Local Report is:
- Initialize Linear barcode object, with
CODE39orCODE39EXbarcode type specifieds - Configure Code 39 encoding data from database or
DataTable - Generate Code 39 barcode byte stream
- Bind to RDLC image report item
- Render via ReportViewer Control (ASP.NET/WinForms)
- Initialize Linear barcode object, with
- Key encoding configurations for RDLC: Standard (CODE39) vs. Full ASCII (CODE39EX) mode, check digit (AddCheckSum), and Start/Stop character visibility (ShowStartStopInText).
- Critical dimension settings for RDLC compliance: X (narrow element width), N (wide/narrow ratio, 2.0 - 3.0), and quiet zones (10X minimum for Left/RightMargin).
Common Asked Questions
What is the use of Code 39 barcode?
Code 39, also known as Code 3 of 9, is the first barcode symbology to encode both numbers and letters (Upper case letters only). It is most commonly used in
the inventory, government, military, automotive and electronics industries.
Using RDLC barcode generator library, you can create, print, and insert Code 39 barcodes in RDLC report designer, and preview them in RDLC report viewer using Visual Studio .NET. You will easiy enable Code 39 barcode generation functions in RDLC reports in ASP.NET Core, Windows Forms applications.
Using RDLC barcode generator library, you can create, print, and insert Code 39 barcodes in RDLC report designer, and preview them in RDLC report viewer using Visual Studio .NET. You will easiy enable Code 39 barcode generation functions in RDLC reports in ASP.NET Core, Windows Forms applications.
What is the difference between barcode 39 and barcode 93?
Bath Code 39 and Code 93 are linear (1d) barcode formats.
Code 93 is an updated version of Code 39. Code 93 is a higher-density barcode type compared to Code 39.
Using RDLC barcode generator software, you can create both Code 39 and Code 93 in RDLC reports.
What is the difference between Code 39 and Code 128 barcodes?
Bath Code 39 and Code 128 are linear (1d) barcode symbologies.
Code 128 requires a compulsory checksum digit. If the Code 128 barcode is damaged, it may still be scannable. Code 39 checksum is optional.
If the Code 39 barcode without checksum is damaged, it won't be scannable.
Using RDLC barcode generator software, you can create both Code 39 and Code 93 in RDLC reports in Visual Studio ASP.NET, MVC, Windows Forms projects.
Can Code 39 barcode encode lowercase letters in RDLC reports?
Code 39 barcode standard version does not support lowercase letters encoding, it supports uppercase letters only.
However the Code 39 extended version does. OnBarcode RDLC Barcode Generator software does support both Code 39 standard and extend versions.
You can quickly draw, print and insert Code 39 with uppcase and lowercase letters in RDLC reports.
What is the minimum size for Code 39 barcode?
The recommended minimum height for Code 39 manual scanning is 5.0mm or 15 % of Code 39 width (excluding quiet zones), whichever is greater.
Code 39 barcodes need meet the following barcode dimension size requirements.
Code 39 barcodes need meet the following barcode dimension size requirements.
- X (X): the mimumum bar width (X module) is defined by the application specification.
- Y: the minimum height is 5.0mm or 15% of symbol width (excluding quiet zones), whichever is greater.
What is the ratio of narrow to wide bars in Code 39 barcode?
The valid wide bar vs narrow bar ratio of Code 39 barcode is from 2 to 3 inclusive. By default, the RDLC barcode software will apply bar ratio as 3.
You can print and customize the Code 39 in RDLC report through property
N in RDLC report item property settings in Visual Studio .NET.