The Code 39 Barcode Generator for RDLC is a .NET barcode generation SDK that enables developers to integrate Code 39 barcode generation capabilities into RDLC reports for ASP.NET and Windows Forms applications. The generated Code 39 barcodes support a comprehensive set of customizable properties, including symbol rotation at 0, 90, 180, or 270 degrees.
How to Generate Code 39 Using the RDLC Barcode Generator
This guide provides instructions for generating Code 39 linear barcodes within RDLC Local Reports using C#. The approach is optimized for ASP.NET (including ASP.NET Framework and MVC) and Windows Forms (.NET Framework) projects integrated with the ReportViewer Control.
BarcodeLib provides step by step tutorials for printing barcodes in RDLC reports using C# in ASP.NET and Windows Forms applications.
How to create barcodes in RDLC reports in ASP.NET
How to create barcodes in RDLC reports in Windows Forms
The existing demonstration code for Code 128 can be adapted to generate Code 39 barcodes as follows.
Open the file Form1.cs in Visual Studio.
Change the barcode type from BarcodeType.CODE128 to BarcodeType.CODE39.
Code 39 Barcode Data Encoding in RDLC Local Reports (C#)
The start and stop character (*) is automatically added by the library and should not be included in the Data property.
To create standard Code 39 barcodes in an RDLC report:
Enter valid Code 39 standard characters in the Data property.
Select the barcode type as 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 an RDLC report:
Select the barcode type as BarcodeType.CODE39EX.
Note: Verify that the Code 39 barcode in the RDLC report contains only valid characters for the selected mode (standard or Full ASCII).
Code 39 Check Digit Configuration
Code 39 does not include a checksum character by default. However, a MOD43 checksum can be enabled for enhanced data security in RDLC reports.
Enable AddCheckSum to append a checksum character to the Code 39 barcode.
Note: For check digit enabled Code 39 barcodes, scan the barcode to confirm that the check digit is validated correctly,
which is critical for data integrity in RDLC reports. The BarcodeLib C# Barcode Reader library supports scanning Code 39 barcodes with checksum characters from images, TIFF, and PDF files in ASP.NET and Windows applications.
Code 39 Start/Stop Character Configuration
Code 39 uses * as the start and stop characters, which are automatically added by the library. These characters can be hidden in the human readable interpretation (HRI) of the barcode.
Disable ShowStartStopInText to hide the start and stop characters in the Code 39 barcode text label.
Note: Do not include * in the Data property. The RDLC Code 39 library automatically adds it; manual inclusion will cause encoding errors in the RDLC report.
Code 39 Barcode Dimension Settings for RDLC Local Reports (C#)
In the C# Code 39 generator for RDLC, the following properties can be used to customize barcode dimensions to align with RDLC print layout requirements:
Determine the Code 39 printing size in the .rdlc file (matches BarcodeWidth and BarcodeHeight).
Use UOM to select the preferred unit of measure (inch or cm).
Set BarcodeWidth and BarcodeHeight to specify the Code 39 barcode image rendering size.
Note: Define the desired dimension unit of measure (e.g., inch) for the Code 39 barcode to match the unit of measure of the RDLC Image report item. Check the RDLC report to confirm that the Code 39 barcode dimensions match the configured values and that no clipping occurs within the Image control.
More Options for Code 39 Dimension Size Setting
Additional properties allow further customization of Code 39 barcode size:
AutoResize: Must be set to false to enable the X and Y properties.
X: Width of the narrow element (minimum value defined by application specifications).
Y: Bar module height.
N: Wide to 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 intended for high quality printing, set Resolution (300 DPI recommended) to align with print layout settings. Calculate quiet zones (minimum 10X) to ensure scannability in printed RDLC reports.
Customizing Code 39 Barcodes for RDLC in ASP.NET / WinForms (C#)
The .NET RDLC Barcode Generator library allows customization of Code 39 bar and space widths for RDLC reports using two core properties:
N: Wide to narrow bar ratio (2.0 - 3.0 inclusive; default = 2.0)
I: Intercharacter gap (multiple of X; default = 1.0f)
Code 39 Wide to Narrow Bar Ratio
Set the N property to define the wide to narrow ratio for Code 39.
Note: Identify the desired wide to narrow ratio for RDLC report readability. Ensure customizations comply with Code 39 standards; avoid ratios outside the 2.0 - 3.0 range.
Code 39 Intercharacter Gap
Set the I property to define the intercharacter gap as a multiple of X (the Code 39 narrowest bar width).
Note: Excessively large I values may cause the barcode to exceed the RDLC Image control bounds. Test with sample data prior to final implementation.
Summary
The core workflow for generating Code 39 barcodes in an RDLC Local Report is as follows:
Initialize a Linear barcode object with the barcode type specified as CODE39 or CODE39EX.
Configure Code 39 encoding data sourced from a database or a DataTable.
Generate the Code 39 barcode byte stream.
Bind the byte stream to an RDLC Image report item.
Render the report through the ReportViewer Control (ASP.NET / Windows Forms).
Key data encoding for RDLC report include:
Selection of standard (CODE39) versus Full ASCII (CODE39EX) mode.
Check digit configuration (AddCheckSum).
Start/stop character visibility (ShowStartStopInText).
Barcode dimension settings for RDLC compliance include:
Narrow element width (X).
Wide to narrow ratio (N, within 2.0 - 3.0).
Quiet zones (minimum 10X for LeftMargin and RightMargin).
These settings must align with the properties of the RDLC Image report item to ensure accurate rendering.