Example #1
0
        private void PrintBtn_Click(object sender, EventArgs e)
        {
            NCCReporter.Section    sec  = new NCCReporter.Section(null, 0, 0, 0);
            List <NCCReporter.Row> rows = new List <NCCReporter.Row>();

            rows = kmr.ToLines(null);
            sec.AddRange(rows);

            string       path = System.IO.Path.GetTempFileName();
            FileStream   f    = new FileStream(path, FileMode.OpenOrCreate);
            StreamWriter s    = new StreamWriter(f);

            s.AutoFlush = true;
            foreach (NCCReporter.Row r in rows)
            {
                s.WriteLine(r.ToLine(' '));
            }
            f.Close();
            PrintForm pf = new PrintForm(path, this.Text);

            pf.ShowDialog();
            File.Delete(path);
        }