Current filter:
                                You should refresh the page.
                                Support Center

                                How to print a report in dot matrix printer

                                0

                                This example demonstrates how to print a report in a dot matrix printer. First, a report is exported to the CSV format and saved to a temporary file in the current application directory. Then the Process.Start() method initiates the printing process. Note that the "Print" verb is assigned to the ProcessStartInfo.Verb property of the ProcessStartInfo instance passed to the Process.Start() method.

                                You must  log in  or  register  to leave comments
                                Select file
                                • Form1.cs
                                • Program.cs
                                • XtraReport1.cs
                                Select language
                                • C#
                                • VB.NET
                                Select version
                                • v2013 vol 1.4 - v2013 vol 2.9
                                • v2009 vol 1.4 - v2012 vol 2.16
                                using System;
                                using System.Collections.Generic;
                                using System.ComponentModel;
                                using System.Data;
                                using System.Drawing;
                                using System.Text;
                                using System.Windows.Forms;
                                using System.Diagnostics;
                                
                                namespace RepPrintOnDotMatrix {
                                    public partial class Form1 : Form {
                                        public Form1() {
                                            InitializeComponent();
                                        }
                                
                                        private void Form1_Load(object sender, EventArgs e) {
                                            XtraReport1 report = new XtraReport1();
                                
                                            report.CreateDocument();
                                            printControl1.PrintingSystem = report.PrintingSystem;
                                        }
                                
                                        private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
                                            printControl1.PrintingSystem.ExportToCsv(Application.StartupPath + "\\temporary.csv", new DevExpress.XtraPrinting.CsvExportOptions(",", Encoding.Default));
                                
                                            ProcessStartInfo psi = new ProcessStartInfo();
                                
                                            psi.FileName = Application.StartupPath + "\\temporary.csv";
                                            psi.Verb = "Print";
                                
                                            Process.Start(psi);
                                        }
                                
                                    }
                                }

                                To start a chat you should create a support ticket


                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners