示例#1
0
 private void mnuTrophiesWonBySailNumber_Click(object sender, EventArgs e)
 {
     try {
         using (ReportCreator report = new ReportCreator()) {
             FileInfo fi = report.GenerateWinnerReport((string)mnuTrophiesWonBySailNumber.Tag);
             System.Diagnostics.Process.Start(fi.FullName);
         }
     } catch (IOException ex) {
         MessageBox.Show(this,
                         string.Format("A problem occurred generating the report:\n{0}", ex.Message),
                         Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
     } catch (System.ComponentModel.Win32Exception ex) {
         MessageBox.Show(this,
                         string.Format("The PDF couldn't be opened:\n{0}", ex.Message),
                         Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
示例#2
0
 private void CreateReport(int trophyID)
 {
     try {
         using (ReportCreator report = new ReportCreator()) {
             FileInfo fi = report.GenerateTrophyReport(trophyID);
             System.Diagnostics.Process.Start(fi.FullName);
         }
     } catch (IOException ex) {
         MessageBox.Show(this,
                         string.Format("A problem occurred generating the report:\n{0}", ex.Message),
                         Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
     } catch (System.ComponentModel.Win32Exception ex) {
         MessageBox.Show(this,
                         string.Format("The PDF couldn't be opened:\n{0}", ex.Message),
                         Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
示例#3
0
        private void mnuTrophiesWonBySailNumber_Click(object sender, EventArgs e)
        {
            try {
            using (ReportCreator report = new ReportCreator()) {
              FileInfo fi = report.GenerateWinnerReport((string)mnuTrophiesWonBySailNumber.Tag);
              System.Diagnostics.Process.Start(fi.FullName);
            }
              } catch (IOException ex) {
            MessageBox.Show(this,
              string.Format("A problem occurred generating the report:\n{0}", ex.Message),
              Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);

              } catch (System.ComponentModel.Win32Exception ex) {
            MessageBox.Show(this,
              string.Format("The PDF couldn't be opened:\n{0}", ex.Message),
              Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);

              }
        }
示例#4
0
        private void CreateReport(int trophyID)
        {
            try {
            using (ReportCreator report = new ReportCreator()) {
              FileInfo fi = report.GenerateTrophyReport(trophyID);
              System.Diagnostics.Process.Start(fi.FullName);
            }
              } catch (IOException ex) {
            MessageBox.Show(this,
              string.Format("A problem occurred generating the report:\n{0}", ex.Message),
              Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);

              } catch (System.ComponentModel.Win32Exception ex) {
            MessageBox.Show(this,
              string.Format("The PDF couldn't be opened:\n{0}", ex.Message),
              Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);

              }
        }