Using Dot Matrix Printers for Printing Receipts

2025-02-20

Dot matrix printers are devices that are still utilized in various fields, such as printing receipts, labels, and other documents that require high reliability. In modern applications on the .NET platform, the FastReport library is often used for generating reports. This article will explore how to integrate a dot matrix printer into the process of creating and outputting reports using FastReport .NET.

 


 

Where are Dot Matrix Printers Used Today?

Although dot matrix printers are considered a "relic of the past" by most people, they are still frequently used in different sectors:

  • Today, one of the largest users of dot matrix printers is government institutions and the banking sector. They print financial reports, forms that require strict accountability, bank books, military IDs, and passports.
  • Since dot matrix printers use pins for printing that create pressure on the paper, they can produce multiple copies of documents simultaneously.
  • In enterprises where printing is needed in aggressive environmental conditions.
  • In some countries, traffic police use dot matrix printers to print tickets for disturbances or parking violations on the spot.

 


 

Preparing to Work with a Dot Matrix Printer

Before starting to work with a dot matrix printer in FastReport .NET, it is important to ensure that the printer is installed and properly configured in the operating system. Dot matrix printers typically support PCL (Printer Command Language) or ESC/P (Epson Standard Code for Printers) protocols, which are used to send commands to the printer.

 


 

Installing the Printer Driver

  1. We will install the driver for our dot matrix printer. This can be done through the Windows Control Panel or via the installer provided by the manufacturer.
  2. Check the printer settings, such as page orientation, paper size, and other parameters that may affect print quality.

Now let's explore the printing functionality in FastReport.NET. To start printing a report, we need to go to the report's Preview and click the "Print" button. Then, a print dialog will appear, where we can:

  • Select the printer (if we have multiple);
  • Specify which pages will be printed (including even or odd);
  • Indicate the number of copies if necessary;
  • Determine the print order (from the beginning or the end);
  • Manage duplex printing;
  • Edit the print scale;
  • Control print modes (page format, number of pages per sheet, etc.).

Standard Print Dialog

 

It is worth noting that we can go to "Settings." In this case, a print settings window will appear, but these settings are system-specific. In other words, FastReport .NET has no relation to them. These settings are also retrieved from the operating system itself. Default values can be set in Windows, and they will also apply to this dialog.

System Printer Settings

 

In general, we can already proceed to print if we are satisfied with the settings. Let's try to configure printing through code.

 


 

Setting Up Printing from Code

First, we need to create a project and install the latest version of the FastReport.NET NuGet package. We will also need a prepared report that we created in the designer. First, let's load the previously created report:

using FastReport;
// Create a report object  
Report report = new Report();
// Load the report from file  
report.Load("path_to_your_report.frx");

Before sending the report to print, we need to configure the print settings. In FastReport, you can specify the printer that will be used for printing, as well as configure some page settings such as orientation and scaling.

// Get the list of available printers
PrintSettings printSettings = report.PrintSettings;
// Set the printer name (for example, "Epson LQ-590")  
printSettings.Printer = "Epson LQ-590";
// Set the page orientation (Portrait/Landscape)  
printSettings.Landscape = false; // Portrait orientation  
// Set the zoom
printSettings.Zoom = 100; //100% zoom  

Now we can send the report to print. FastReport provides the Print() method to perform this task:

// Print the report  
report.Print();

 


 

Features of Dot Matrix Printers

Dot matrix printers have their features that should be taken into account when creating reports:

  1. Fonts: It is best to use monospaced fonts, such as Courier New or Consolas, which are most suitable for dot matrix printers.
  2. Page Size: Dot matrix printers often use standard page sizes, such as A4 or Letter. It is important to ensure that the page size in the report matches the capabilities of our printer.
  3. Number of Lines: If the report contains many lines, it may be necessary to split it into multiple pages. In FastReport, you can configure automatic page splitting based on the number of lines.

Let's create a receipt report that will meet our requirements. We launch the designer and create a new blank template. We go to page settings and set the height and width.

Page Setup

 

Next, we move to the "Margins" section and set the margins. We need margins of 1.27 cm–2.28 cm. 

Page Margin Settings

 

Now we move to the page of our report. We will make a simple receipt using the Courier New font.

Receipt Template Design

 

Our report is ready, and now it can be sent to the dot matrix printer.

Receipt Preview

 


 

Conclusion

Using a dot matrix printer in FastReport .NET opens up new opportunities for creating and outputting reports in applications on the .NET platform. By following the steps outlined above, you can successfully integrate a dot matrix printer into your work with FastReport and ensure quality and reliable report printing.

.NET FastReport Report Printing
February 10, 2025

How to Try FastReport .NET WEB Before Purchase

By testing the WEB pack before purchasing, you can make an informed choice about whether FastReport is suitable for you.NET for your tasks.
November 26, 2024

Installing FastReport on .NET 8.0 and Creating a Simple Report

The purpose of this article is to explain step by step how to install FastReport on .NET 8.0 and how to create a simple report. Taking the reporting process from the beginning, it will show how to connect, design and view reports.
August 12, 2024

How to build and install the Postgres plugin in FastReport .NET

This article describes how to connect to the database using the FastReport .NET plugin for the report designer from Visual Studio via the NuGet server.
Fast Reports
  • 800-985-8986 (English, US)
  • +31 97 01025-8466 (English, EU)
  • +49 30 56837-3928 (German, DE)
  • +55 19 98147-8148 (Portuguese, BR)
  • info@fast-report.com
  • 66 Canal Center Plaza, Ste 505, Alexandria, VA 22314

© 1998-2025 Fast Reports Inc.