Esempio n. 1
0
 private void PrintBtn_Click(object sender, EventArgs e)
 {
     string path = System.IO.Path.GetTempFileName();
     FileStream f = new FileStream(path, FileMode.OpenOrCreate);
     StreamWriter s = new StreamWriter(f);
     s.AutoFlush = true;
     s.Write (String.Format ("{0,20}\t\t{1,20}\t\t{2,20}\t\t{3,20}\t\t{4,20}\r\n","Item id","Stratum id","Measurement Type","Measurement Date","Measurement Time"));
     foreach (ListViewItem lvi in listView1.Items)
     {
         s.Write(String.Format("{0,20}\t\t{1,20}\t\t{2,20}\t\t{3,20}\t\t{4,20}\r\n", lvi.SubItems[0].Text, lvi.SubItems[1].Text, lvi.SubItems[2].Text, lvi.SubItems[3].Text, lvi.SubItems[4].Text));
     }
     f.Close();
     PrintForm pf = new PrintForm(path, this.Text, "Print List");
     pf.ShowDialog();
     File.Delete(path);
 }
Esempio n. 2
0
        private void PrintBtn_Click(object sender, EventArgs e)
        {
            string       path = System.IO.Path.GetTempFileName();
            FileStream   f    = new FileStream(path, FileMode.OpenOrCreate);
            StreamWriter s    = new StreamWriter(f);

            s.AutoFlush = true;
            s.Write(String.Format("{0,20}\t\t{1,20}\t\t{2,20}\t\t{3,20}\t\t{4,20}\r\n", "Item id", "Stratum id", "Measurement Type", "Measurement Date", "Measurement Time"));
            foreach (ListViewItem lvi in listView1.Items)
            {
                s.Write(String.Format("{0,20}\t\t{1,20}\t\t{2,20}\t\t{3,20}\t\t{4,20}\r\n", lvi.SubItems[0].Text, lvi.SubItems[1].Text, lvi.SubItems[2].Text, lvi.SubItems[3].Text, lvi.SubItems[4].Text));
            }
            f.Close();
            PrintForm pf = new PrintForm(path, this.Text, "Print List");

            pf.ShowDialog();
            File.Delete(path);
        }
Esempio n. 3
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 = mult.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);
        }
Esempio n. 4
0
        private void PrintBtn_Click(object sender, EventArgs e)
        {
            NCCReporter.Section sec  = new NCCReporter.Section(null, 0, 0, 0);
            List <string>       rows = new List <string>();
            //Addrows

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

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

            pf.ShowDialog();
            File.Delete(path);
        }
Esempio n. 5
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 = known_alpha.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);
        }
Esempio n. 6
0
        private void PrintBtn_Click(object sender, EventArgs e)
        {
            NCCReporter.Section sec = new NCCReporter.Section(null, 0, 0, 0);
            List<string> rows = new List<string>();
            rows.Add ("Collar Cross Reference Factors for:");
            rows.Add("Material Type " + MaterialTypeComboBox.Text);
            rows.Add("Mode " + ModeComboBox.Text);
            rows.Add("Detector " + mp.det.Id.DetectorName);
            rows.Add("Current Date " + DateTime.Now.ToShortDateString() + ' ' + DateTime.Now.ToShortTimeString());
            rows.Add("");
            rows.Add("Reference Date " + ReferenceDateTimePicker.Value.ToShortDateString());
            rows.Add("Relative doubles rate (k2) " + RelativeDoublesRateTextBox.Text);

            string path = System.IO.Path.GetTempFileName();
            FileStream f = new FileStream(path, FileMode.OpenOrCreate);
            StreamWriter s = new StreamWriter(f);
            s.AutoFlush = true;
            foreach (string r in rows)
                s.WriteLine(r);
            f.Close();
            PrintForm pf = new PrintForm(path, this.Text);
            pf.ShowDialog();
            File.Delete(path);
        }