Example #1
0
        private void But_CreatExcel_Click(object sender, EventArgs e)
        {
            string    exportpath = txt_exportpath.Text.Trim();
            DataTable table      = (DataTable)dgv_content.DataSource;

            EpplusHelper.DataTableToExcel(table, "mysheet", exportpath);
            MessageBox.Show("导出成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Example #2
0
        private void But_CreatExcel_Click(object sender, EventArgs e)
        {
            string    sql        = rtb_sql.Text.TrimEnd();
            DataTable dt         = sqlContent.GetTable(sql);
            string    exportpath = txt_exportpath.Text.Trim();

            EpplusHelper.DataTableToExcel(dt, "mysheet", exportpath);
            MessageBox.Show("导出成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }