private void btnTemplate_Click(object sender, EventArgs e) { DataTable table = new DataTable(); string[] headers = { "AccountCode", "CostCentre", "Amount", "Description 1", "Description 2", "Description 3", "Description 4", "Description 5" }; foreach (string header in headers) { table.Columns.Add(header); } ExportExcelUtil.SaveAsExcel(table, "outstanding"); }
private void btnDownload_Click(object sender, EventArgs e) { DataTable table = (DataTable)dgvVendor.DataSource; ExportExcelUtil.SaveAsExcel(table, "COST"); }