How to create barcode in RDLC reports in C# ASP.NET application?


Step by step C# tutorial how to generate, print barcodes in RDLC reports in ASP.NET web form application

Add & insert high quality linear and 2D barcodes to RDLC report files

  • Easy to install & integrate Barcode Control DLL for RDLC
  • Quick to create 2d, 1d barcodes, including QR Code, Data Matrix, Code 128, EAN/UPC barcodes
  • Completely develop and build with .NET Standard 2.0 in C# language
  • Strong-named and signed assembly for .NET framework 4.x, 3.x, and 2.x
  • Easy to be integrated in ASP.NET web forms, MVC, Windows Forms, WPF applications
  • All barcodes generated are compatible with latest barcode symbology ISO Standards
  • Fully customize barcode image, size, rotation, resolution via VB.NET and C#
  • C# source code is available with purchase of the unlimited developer license with source code option
In this page we will learn how to create, customize, print 2d and linear barcodes in RDLC reports in ASP.NET web form and Windows Forms applications.

RDLC Report Barcode Generator in ASP.NET RDLC Report Barcode Generator in Windows Forms

How to create, print barcodes in RDLC local reports in C# ASP.NET and Windows application?

  1. Download RDLC Reports Barcode Generator library
  2. Install C# library to create barcodes in RDLC reports in .NET Projects
  3. Step by Step Tutorial








RDLC (Report Definition Language Client-side) is a client-side reporting technology introduced by Microsoft. It is a lightweight version of SSRS (SQL Server Reporting Services), primarily used to generate and display local reports in .NET applications (WinForms / WPF / ASP.NET) without requiring a SQL Server instance.

OnBarcode RDLC Reports Barcode Generator is a C# library which supports generating and inserting QR Code, Code 128 2d and 1d barcodes in RDLC file (.rdlc) and printing barcodes in RDLC report viewer in ASP.NET, WPF, Windows Forms applications.

This page explains how to use OnBarcode RDLC Reports Barcode Generator library to generate and print 1d, 2d barcodes on local reports RDLC files.

To build and run the ASP.NET project below, you need prepare the following tools:
  • Visual Studio 2022 (with Microsoft RDLC Report Designer)
  • .NET Framework 4.7.2 or higher (supporting .NET Standard 2.0)


How to install RDLC barcode library in .NET project?

Top

Install through NuGet

For .NET Framework 4.7.1 or later (Class library, Console, Windows Forms, WPF) apps on Windows
PM > Install-Package OnBarcode.RDLC




Download & install dll

OnBarcode RDLC Barcode Generator library trial version is free to download. You can manually download it here :
Download C# Barcode Generator SDK trial version

To install the downloaded RDLC barcode generator dll
  • Add OnBarcode.Barcode.RDLC.dll from following folder to .NET project reference.
    • For .NET Framework 4.x project, get dll from folder "{downloaded package}/dll/Net40/"
    • For .NET Framework 3.x, 2.x project, get dll from folder "{downloaded package}/dll/Net20/"
    • For .NET Standard 2.0 project, get dll from folder "{downloaded package}/dll/NetStandard2.0/"
  • You need manually add nuget package System.Drawing.Common from "NuGet Package Manager" to .NET Core project reference.




Upgrade the dll

To upgrade the dll to latest version or upgrade the trial version dll to licensed one, you need
  1. Remove the installed dll or nuget package from the project. (you need clean the project cached data also)
  2. Add the new dll to the .net project




How to print barcode in RDLC report in C# ASP.NET, Windows application?

Top
We have prepared two step-by-step tutorial guide on how to print barcode in RDLC reports in .NET ASP.NET and Windows projects.




How to print 1d, 2d barcodes in RDLC report?

Top

Print 1d barcodes

Using OnBarcode RDLC Report Barcode library, you can create a Linear object with linear (1d) barcode format specified in property Type in C# class.

Linear linear = new Linear();
linear.Type = BarcodeType.CODE128;



List of 1d barcode formats supported in RDLC reports:

public enum BarcodeType
{
    CODABAR,
    CODE11,
    CODE2OF5,
    INTERLEAVED25,
    CODE39,
    CODE39EX,
    CODE93,
    CODE128,
    CODE128A,
    CODE128B,
    CODE128C,
    EAN128,
    EAN8,
    EAN8_2,
    EAN8_5,
    EAN13,
    EAN13_2,
    EAN13_5,
    ISBN,
    ISBN_2,
    ISBN_5,
    ISSN,
    ISSN_2,
    ISSN_5,
    ITF14,
    IDENTCODE,
    LEITCODE,
    MSI,
    MSI10,
    MSI11,
    MSI1010,
    MSI1110,
    ONECODE,
    PLANET,
    POSTNET,
    RM4SCC,
    UPCA,
    UPCA_2,
    UPCA_5,
    UPCE,
    UPCE_2,
    UPCE_5,
    RSS14,
    RSS14STACKED,
    RSS14STACKEDOMNI,
    RSSLIMITED,
    RSSEXPANDED,
    RSSEXPANDEDSTACKED,
    COMPOSITE_CCA,
    COMPOSITE_CCB,
    COMPOSITE_CCC
}


Print 2d barcodes

You can create new QRCode, DataMatrix, or PDF417 object to print QR Code, Data Matrix, and PDF417 2d barcodes in RDLC reports using C#.

QRCode barcode = new QRCode();
DataMatrix barcode = new DataMatrix();
PDF417 barcode = new PDF417();





How to encode barcode data in RDLC reports?

Top
1D barcodes (Code 128, GS1-128, Code 39, EAN/UPC) supports encoding the following text formats
  • Numeric digits (0-9)
  • AlphaNumeric (0-9; Upper case letters, and some special characters)
  • Full 128 ASCII characters
  • Extended ASCII characters

2D barcodes (QR Code, Data Matrix, PDF417, Micro QR Code, Micro PDF417) supports
  • Numeric digits (0-9)
  • AlphaNumeric (0-9; Upper case letters, and some special characters)
  • Full 128 ASCII characters, and extended ASCII characters
  • Unicode text
  • Byte data to store data in special formats (Such as store an image file into QR Code barcodes)
RDLC Barcode Generator library supports all of the above text data formats in RDLC reports.




How to create barcode with image width & height customized in RDLC reports?

Top
Here we will learn how to print barcodes with specified image width and height in RDLC local report files in C# ASP.NET, WinForms applications.

Here we will use our prepared WinForms tutorial to demonstrate. You can view the detailed tutorial here: How to create, print barcode in RDLC reports in C# Windows Forms application?

In the following content, we will generate and print Code 128 barcodes with 5-CM width and 2-CM height in RDLC reports in C# WinForms project.

1. Customize barcode resolution and size settings

Open file Form1.cs in the Visual Studio

Add the following C# codes in the method Form1_Load
  • Change the barcode unit of measure to CM
  • Set the barcode image resolution to 300 ppi. High resolution image will improve the printed barcode quality.
  • Set the barcode image width to 5-CM, and height to 2-CM.
linear.UOM = UnitOfMeasure.CM;
linear.Resolution = 300;
linear.BarcodeWidth = 5;
linear.BarcodeHeight = 2;
Add the following C# code to create Code 128 barcodes with gray background. It is easy for us the measure the printed barcode size in the report.
linear.AutoResizePaddingTransparent = false;
linear.BackColor = Color.Gray;


2. Update the barcode object in the RDLC report designer

Open file Report1.rdlc in design mode in Visual Studio

Select the barcode object in the report, and change the following properties.
  • Set Width to 5cm
  • Set Height to 2cm


Right click barcode object, and choose Image Properties....


Go to tab Size, choose Fit to size, click button OK


3. View, measure the barcode in RDLC report

Run the Windows Forms project, and view the barcodes printed in the report in the Windows Form.



View the rendered barcodes in PDF exported from RDLC report.

The barcode in the PDF file width is 1.97 inch (5.00 cm), height is 0.79 inch (2.00 cm).







How to print barcode with colors and image settings customized in .NET RDLC reports?

Top

Barcode colors in RDLC report

Using OnBarcode RDLC barcode generator library dll, you can customize the rendered barcode bar and space module colors using property ForeColor and BackColor in RDLC reports in C# ASP.NET and Windows Forms applications.

barcode.ForeColor = Color.Red;
barcode.BackColor = Color.Blue;






Linear / 1d barcode text colors in RDLC report

Using property TextColor, you can customize the printed 1d barcode human readable text color in RDLC reports in C# .NET projects.

barcode.TextColor = Color.Red;






Barcode image resolution in RDLC report

You can set printed barcode image resolution through property Resolution during barcode generation in RDLC reports.

barcode.Resolution = 300;












Common Asked Questions

How do I open an existing RDLC report file in Visual Studio?

To open and edit an existing RDLC reports in Visual Studio project, you need install the Microsoft RDLC Report Designer extension to the Visual Studio.

To view, render RDLC report in .NET application, you need download and install RDLC Report Viewer control nuget package for your ASP.NET web or WinForms Windows application from NuGet.org.
  • Download & install Microsoft.ReportingServices.ReportViewerControl.WebForms NuGet Package for ASP.NET web form application
  • Download & install Microsoft.ReportingServices.ReportViewerControl.Winforms NuGet Package for Windows Forms application

How to open RDLC Report Designer in Visual Stuido .NET?

To add a barcode to a RDLC report or edit an existing report in Visual Studio, you can double-click the report file with ".rdlc" extension in the "Solution Explorer". If your RDLC report file opens by "XML (Text) Editor" by default, you may check and choose the right version of Microsoft RDLC Report Designer extension.

Once installed, you can add barcode to existing RDLC files, or create new RDLC report file and utilize the Report Designer's features.

Add a new report by pressing CTRL+SHIFT+A or by selecting "Add New Item" under the Project menu.

You can right click the report file in "Solution Explorer" and select "Open With..." menu. In the popup Window, choose Report Designer (Default), click button "OK" to open the report file using Report Designer.

For handling RDLC reports generated in earlier versions of Visual Studio .NET, make sure you have the appropriate Report Designer extensions installed for compatibility, and utilize Report Designer templates as required. You can get more detailed information from Microsoft Visual Studio document.

How to install RDLC Report in Visual Studio?

The RDLC Report is not included in Visual Studio 2022 and 2019, and requires a separate installation. OnBarcode.com barcode generation in RDLC reports tutorials are based on Visual Studio 2022. To install the Microsoft RDLC Report Designer Extension, you can download and install it from visualstudio.com.

After installation, restart Visual Studio and create a new Windows Forms App (.NET Framework) or ASP.NET web form (Framework) project. You also need install RDLC Report Viewer NuGet package to render and view generated RDLC reports in ASP.NET or WinForms application.
  • Microsoft.ReportingServices.ReportViewerControl.WebForms NuGet Package for ASP.NET web form application
  • Microsoft.ReportingServices.ReportViewerControl.Winforms NuGet Package for Windows Forms application

How to use RDLC report in Visual Studio?

Once you have installed the Microsoft RDLC Report Designer extension and Report Viewer nuget package in the .NET project. You can create new RDLC report file or edit the existing report file in the Visual Studio.

RDLC (Report Definition Language Client-side) is a robust reporting tool provided by the Microsoft Visual Studio. You can create professional enterprise reports for Windows Forms, WPF Windows applications and ASP.NET web forms applications using C#/VB.NET for data visualization in .NET projects.

Using OnBarcode RDLC Barcode Generator library, you can easily add, create, print 2d and 1d barcodes in RDLC report in Visual Studio projects.

How to create a DataSet In RDLC report?

Most of the barcode codes are stored in a DataSet in C# projects. To create a RDLC local report using a DataSet in ASP.NET or WinForms app, right click on project in Visual Studio Solution Explorer, choose "Add" > "New Item...". Select "DataSet" from "Data" group.

OnBarcode provides step-by-step instructions how to create a DataSet in RDLC report and print barcodes with encoding data from DataSet in RDLC report file.




































Terms of Use | Privacy Policy
Copyright © OnBarcode.com . All rights reserved.