public static void DataTableToExcel(DataTable tbData, string sFile, string sTitle) { frmProgressDataToExcel excel = new frmProgressDataToExcel { DataSourceType = IEDataSourceType.dstDataTable, TbData = tbData, RptTitle = sTitle.Trim(), FileName = sFile }; excel.ShowDialog(); excel.Dispose(); }
public static void DataGridViewToExcel(DataGridView grdX, string sFile, string sTitle) { frmProgressDataToExcel excel = new frmProgressDataToExcel { DataSourceType = IEDataSourceType.dstDataGridView, GrdData = grdX, RptTitle = sTitle.Trim(), FileName = sFile }; excel.ShowDialog(); excel.Dispose(); }