Skip to content

Commit

Permalink
improve time export excel big datatable
Browse files Browse the repository at this point in the history
  • Loading branch information
chuongmep committed Mar 9, 2024
1 parent cb0025b commit ecbba27
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions APSToolkit/Utils/ExcelUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,18 +204,6 @@ public static void ExportDataToExcel(this DataTable dataTable, string filePath,
worksheet.Row(i + 2).Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.LightGray);
}
}

// set freeze panes
worksheet.View.FreezePanes(2, 2);
worksheet.Cells.AutoFitColumns();
// set color header background black, text white
for (int i = 1; i <= dataTable.Columns.Count; i++)
{
worksheet.Cells[1, i].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
worksheet.Cells[1, i].Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.Black);
worksheet.Cells[1, i].Style.Font.Color.SetColor(System.Drawing.Color.White);
}

package.SaveAs(new System.IO.FileInfo(filePath));
}
}
Expand Down

0 comments on commit ecbba27

Please sign in to comment.