How to create, print barcodes in SAP Crystal Reports for .NET applications?

How to Generate Linear and 2D Barcodes in Crystal Report

Generate, Create, Print, & Draw Linear, 2D Bar Codes in Crystal Reports for .NET

  • Add robust barcodes generation capabilities into Crystal Reports for .NET
  • Print dynamic QR Code, Data Matrix, and PDF-417 in report with built-in features
  • Supports Code 39, Code 128, EAN-128, EAN-8, EAN-13, UPC-A, UPC-E
  • Provide detailed guide and complete code for VB and C# programmers
  • Capable of encoding barcode with JPEG, PNG, BMP, or GIF image file
  • Completely coded in C#.NET by strong named assemblies
  • Support .NET Framework 4.x, 3.x, and 2.x
  • Compatible with latest barcode symbology ISO Standards
  • Mature & reliable .NET Barcode Generating Components since 2004
Barcode Generator for Crystal Reports for .NET is a .NET component developed to generate 20+ linear & matrix barcode in Crystal Report. The generator is a control library with barcode generation capabilities. The control could be installed and used easily in Crystal Reports for .NET with Xcopy.
Barcode Generator for .NET Crystal Reports is specially designed for the development of Crystal Report for .NET. The integrated barcode generation capabilities could be used to draws high quality graphics object in your reports. The generated barcode is highly customizable.

Print Barcode in Crystal Reports in ASP.NET Print Barcode in Crystal Reports in WinForms




How to create, print barcodes in Crystal Reports?

  1. Download Crystal Reports Barcode Generator plugin
  2. Install Crystal Reports Barcode Generator library dll file into Visual Studio .NET project
  3. Start to Create










How to install Crystal Reports Barcode library in C#.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.Crystal.Reports




Download & install dll

OnBarcode Crystal Reports for .NET 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 Crystal Reports barcode generator dll
  • Add OnBarcode.Barcode.CrystalReports.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 OnBarcode.Barcode.CrystalReports.dll to the .net project reference




Start to Create, Print Barcodes in Crystal Reports

Top
We have prepared two step by step online tutorials to create new ASP.NET/WinForms projects to print barcodes in .rpt reports in .NET application.





How to print barcodes with specified width & height in Crystal Reports using C#?

Top
Here we will explain how to print barcode with specified image width and height in Crystal Reports 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 Crystal Reports in C# Windows Forms application?

In the following content, we will print Code 128 barcodes with 5-inch width and 2-inch height in Crystal Reports in C# .NET projects.

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 INCH
  • Set the barcode image resolution to 600 ppi. High resolution image will improve the printed barcode quality.
  • Set the barcode image width to 5 inches, and height to 2 inches.
linear.UOM = UnitOfMeasure.INCH;
linear.Resolution = 600;
linear.BarcodeWidth = 5;
linear.BarcodeHeight = 2;


2. Update the barcode object in the report properties

Open file CrystalReport1.rpt in Visual Studio

Select the barcode object in the report, and change the following properties.
  • Set XScaling to 5
  • Set YScaling to 2


Right click barcode object, and choose Format Object. Go to tab Picture.

Make sure the size settings are correct.



3. View, measure the barcode in Crystal Reports

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



View the rendered barcodes in PDF exported from Crystal Reports.







Print, Customize Barcode Text Label in Crystal Reports

Top
For linear (1d) barcodes, you can customize barcode text label in Crystal Reports using OnBarcode barcode generator library in .NET projects.

  • Property TextFont allows you to specify the barcode text font family, style, and size.
  • Property TextColor allows you to customize the printed text color.
  • Property TextMargin allows you to specify the space bar modules and the text label.

barcode.TextFont = new Font("OCR-b", 9f, FontStyle.Regular);
barcode.TextColor = Color.Red;
barcode.TextMargin = 10;



Hide barcode text label in report

You can easily hide the linear barcode text label in the Crystal Reports.

  • Set property ShowText to false to hide the barcode text label in the report.

barcode.ShowText = false;







How to print high quality barcode images in report?

Top
Crystal Reports reports usually need to be printed. To generate high-quality barcode images, set the resolution of barcode images higher than that of the printer.
  • Set property Resolution to a high value to print high resolution (dpi) barcode images in report.
barcode.Resolution = 3000;


You can view the printed PDF file from Crystal Reports with barcode high resolution applied.





How to remove black borders around barcode in report?

Top
If the printed barcodes in Crystal Reports contain black borders, you can use the following C# code to remove it.



barcode..AutoResizePaddingTransparent = false;


Now you re-print the barcodes in report, and all borders are removed.





Barcode Types Supported By .NET Crystal Reports Barcode Control

Top

Barcode Control for Crystal Report - Bar Code Type Generation





































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