Exemplo n.º 1
0
 private void 检测ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         OpenFileDialog dialog = new OpenFileDialog();
         dialog.Filter = "excel|*.xls";
         if (dialog.ShowDialog() == DialogResult.OK)
         {
             List <TestPoint> dataList = ExcelTool.ExcelToDataList(dialog.FileName, null, true);
             _dataSource = dataList;
             if (dataList.Count > 0)
             {
                 //加载数据
                 ClearDrawData();
                 //RefreshData(dataList);
                 RefreshLineErrorData(dataList);
                 MessageBox.Show("加载数据成功");
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 2
0
 private void ExportData(List <TestPoint> list)
 {
     this.Invoke(new Action(() =>
     {
         //导出数据
         ExcelTool.TableToExcel(TestPoint.ConvertToDataTable(list), list, GetFileName(), GetBitmap());
     }));
 }