private void exportDataToExcel(DataTable dT, DataTable stats) { string exportPath = @"C:\Cohort\ExcelExtracts"; ExcelReports ER = new ExcelReports(); try { SetControlPropertyThreadSafe(fMain.picProgress, "Image", Properties.Resources.progressWheel5); SetControlPropertyThreadSafe(fMain.lblNotify, "Text", "Exporting Results To Excel...."); ER.ExportToExcel(dT, stats, exportPath); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { SetControlPropertyThreadSafe(fMain.picProgress, "Image", null); SetControlPropertyThreadSafe(fMain.lblNotify, "Text", "Successfully Exported"); } }
private void exportDataToExcel(DataTable dT) { ExcelReports ER = new ExcelReports(); try { SetControlPropertyThreadSafe(picProgress, "Image", Properties.Resources.progressWheel5); SetControlPropertyThreadSafe(lblNotify, "Text", "Exporting To Excel...."); SetControlPropertyThreadSafe(cmdART, "Enabled", false); ER.ExportToExcel(dT, exportPath); } catch (Exception ex) { SetControlPropertyThreadSafe(cmdART, "Text", Assets.Messages.ExportToExcel); MessageBox.Show(ex.Message); } finally { SetControlPropertyThreadSafe(picProgress, "Image", null); SetControlPropertyThreadSafe(lblNotify, "Text", "Successfully Exported"); SetControlPropertyThreadSafe(cmdART, "Enabled", true); SetControlPropertyThreadSafe(cmdART, "Text", Assets.Messages.ViewReport); } }