Current filter:
                                You should refresh the page.

                                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
                                • v2009 vol 1.4 - v2012 vol 2.8
                                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);
                                        }
                                
                                    }
                                }