Example #1
0
        private void ExportTables_Click(object sender, RoutedEventArgs e)
        {
            List <DataTable> data_tables = current_form.SetTables();

            if (data_tables == null)
            {
                MessageBox.Show("There is no table on this page to export. Please navigate to another page with the Results tab.");
                return;
            }
            ProteoformSuiteGUI.ExcelWriter writer = new ProteoformSuiteGUI.ExcelWriter();
            writer.ExportToExcel(data_tables, (current_form as UserControl).Name);
            SaveExcelFile(writer, (current_form as UserControl).Name + "_table.xlsx");
        }
Example #2
0
 private void exportAllTablesToolStripMenuItem_Click(object sender, RoutedEventArgs e)
 {
     ProteoformSuiteGUI.ExcelWriter writer = new ProteoformSuiteGUI.ExcelWriter();
     if (MessageBox.Show("Will prepare for export. This may take a while.", "Export Data", MessageBoxButton.OKCancel) == MessageBoxResult.Cancel)
     {
         return;
     }
     Parallel.ForEach(forms, form => form.SetTables());
     writer.BuildHyperlinkSheet(forms.Select(sweet => new Tuple <string, List <DataTable> >((sweet as Window).Name, sweet.DataTables)).ToList());
     Parallel.ForEach(forms, form => writer.ExportToExcel(form.DataTables, (form as Window).Name));
     if (MessageBox.Show("Finished preparing. Ready to save? This may take a while.", "Export Data", MessageBoxButton.OKCancel) == MessageBoxResult.Cancel)
     {
         return;
     }
     SaveExcelFile(writer, MDIHelpers.getParentWindow(current_form as UserControl).Name + "_table.xlsx"); //get the window hosting tabcontrol, which hosts usercontrol
 }