Welcome to FoxLearn
In this video, I'll show you how to add barcode labels in local report using c-sharp Windows Forms Application
After you finish creating a new Windows Forms project, you need to open your form designer, and then drag the Button, Label, TextBox, NumericUpDown, and PictureBox controls from the Visual Studio toolbox into your form designer
You can design a simple UI that allows you to enter a barcode, then enter the number of barcodes you want to print
Next, We'll create a barcode, then add the barcode to the local report
After you finish designing the form
You need to install the BarcodeLib from nuget into your project
On the right side of the window, select your solution
Next, right-click and select Manage Nuget Packages, then search for BarcodeLib
This is a great barcode library
It's designed to give an easy class for developers to use when they need to generate barcode images from a string of data
You can easily generate barcode images from a string using the Barcode class, then display the barcode image into PictureBox control
If you want to display barcodes in your local report you need to create a DataSet, or entity class to hold your barcode data
After you have created a DataSet, you need to create a simple table with text and image columns
Next, You need to rebuild your project, then drag the DataSet you created into the form designer
You should clear your data before adding it
Next, We will store the barcode data into the DataTable, and then use this DataTable as a DataSource for the report
To add your barcode data to the DataTable, you need to convert from barcode image to byte array using MemoryStream class
You need to install the Report Viewer from the Manage Nuget Packages
The Report Viewer controls can be used to integrate Reporting Services RDL reports into WebForms and WinForms apps
After you have installed Report Viewer, you need to rebuild your project
Next, you need to create a new form, then drag the report viewer from the visual studio toolbox into the form you just created
Next, We will create a new report, and then design it to display barcode images
After you've finished creating your new report
You need to open the report designer, and then add the Data Source to your report
To display the barcode image to the local report include text and image, you should drag a rectangle from reporting toolbox into your report designer
, then place the controls on the rectangle
For each control you add to the rectangle, you need to bind it to the datasource
Next, You need to drag a Table from the Reporting toolbox into your report designer, and then drag the rectangle into your Table
Next, Open your report form designer, and then set the report you want to display to the Report Viewer control
Finally, You need to create a ReportDataSource, then set data to your report data source, and display your report to the ReportViewer
You can easily configure your barcode display in 2 tables based on an even and odd number of rows
Thank you for watching this video and don't forget to subscribe to my channel