예제 #1
0
        private void exportAllTablesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DGVExcelWriter writer = new DGVExcelWriter();

            Parallel.ForEach(forms, form =>
            {
                List <DataGridView> grid_views = form.GetDGVs();
                writer.ExportToExcel(grid_views, (form as Form).Name);
            });
            SaveExcelFile(writer, (current_form as Form).MdiParent.Name + "_table.xlsx");
        }
예제 #2
0
        private void SaveExcelFile(DGVExcelWriter writer, string filename)
        {
            saveExcelDialog.FileName = filename;
            DialogResult dr = saveExcelDialog.ShowDialog();

            if (dr == DialogResult.OK)
            {
                writer.SaveToExcel(saveExcelDialog.FileName);
                MessageBox.Show("Successfully exported table.");
            }
            else
            {
                return;
            }
        }
예제 #3
0
        private void exportTablesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            List <DataGridView> grid_views = current_form.GetDGVs();

            if (grid_views == null)
            {
                MessageBox.Show("There is no table on this page to export. Please navigate to another page with the Results tab.");
                return;
            }

            DGVExcelWriter writer = new DGVExcelWriter();

            writer.ExportToExcel(grid_views, (current_form as Form).Name);
            SaveExcelFile(writer, (current_form as Form).Name + "_table.xlsx");
        }