Created
December 16, 2022 22:07
-
-
Save jahav/b467e2ed953731005e6c4d1d1d381472 to your computer and use it in GitHub Desktop.
Create a large file for test of issue 1874 for ClosedXML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DataTable dt = new DataTable(); | |
DataColumn dc1 = new DataColumn("A", typeof(String)); | |
DataColumn dc2 = new DataColumn("B", typeof(String)); | |
DataColumn dc3 = new DataColumn("C", typeof(String)); | |
DataColumn dc4 = new DataColumn("D", typeof(String)); | |
DataColumn dc5 = new DataColumn("E", typeof(String)); | |
DataColumn dc6 = new DataColumn("F", typeof(String)); | |
DataColumn dc7 = new DataColumn("G", typeof(String)); | |
DataColumn dc8 = new DataColumn("H", typeof(String)); | |
DataColumn dc9 = new DataColumn("I", typeof(String)); | |
DataColumn dc10 = new DataColumn("J", typeof(String)); | |
DataColumn dc11 = new DataColumn("K", typeof(String)); | |
DataColumn dc12 = new DataColumn("L", typeof(String)); | |
DataColumn dc13 = new DataColumn("M", typeof(String)); | |
DataColumn dc14 = new DataColumn("N", typeof(String)); | |
DataColumn dc15 = new DataColumn("O", typeof(String)); | |
DataColumn dc16 = new DataColumn("P", typeof(String)); | |
DataColumn dc17 = new DataColumn("Q", typeof(String)); | |
DataColumn dc18 = new DataColumn("R", typeof(String)); | |
DataColumn dc19 = new DataColumn("S", typeof(String)); | |
DataColumn dc20 = new DataColumn("T", typeof(String)); | |
DataColumn dc21 = new DataColumn("U", typeof(String)); | |
DataColumn dc22 = new DataColumn("V", typeof(String)); | |
DataColumn dc23 = new DataColumn("W", typeof(String)); | |
DataColumn dc24 = new DataColumn("X", typeof(String)); | |
DataColumn dc25 = new DataColumn("Y", typeof(String)); | |
DataColumn dc26 = new DataColumn("Z", typeof(String)); | |
DataColumn dc27 = new DataColumn("AA", typeof(String)); | |
DataColumn dc28 = new DataColumn("AB", typeof(String)); | |
DataColumn dc29 = new DataColumn("AC", typeof(String)); | |
DataColumn dc30 = new DataColumn("AD", typeof(String)); | |
DataColumn dc31 = new DataColumn("AE", typeof(String)); | |
DataColumn dc32 = new DataColumn("AF", typeof(String)); | |
DataColumn dc33 = new DataColumn("AG", typeof(String)); | |
DataColumn dc34 = new DataColumn("AH", typeof(String)); | |
DataColumn dc35 = new DataColumn("AI", typeof(String)); | |
DataColumn dc36 = new DataColumn("AJ", typeof(String)); | |
DataColumn dc37 = new DataColumn("AK", typeof(String)); | |
DataColumn dc38 = new DataColumn("AL", typeof(String)); | |
DataColumn dc39 = new DataColumn("AM", typeof(String)); | |
DataColumn dc40 = new DataColumn("AN", typeof(String)); | |
DataColumn dc41 = new DataColumn("AO", typeof(String)); | |
DataColumn dc42 = new DataColumn("AP", typeof(String)); | |
DataColumn dc43 = new DataColumn("AQ", typeof(String)); | |
DataColumn dc44 = new DataColumn("AR", typeof(String)); | |
DataColumn dc45 = new DataColumn("AS", typeof(String)); | |
dt.Columns.Add(dc1); | |
dt.Columns.Add(dc2); | |
dt.Columns.Add(dc3); | |
dt.Columns.Add(dc4); | |
dt.Columns.Add(dc5); | |
dt.Columns.Add(dc6); | |
dt.Columns.Add(dc7); | |
dt.Columns.Add(dc8); | |
dt.Columns.Add(dc9); | |
dt.Columns.Add(dc10); | |
dt.Columns.Add(dc11); | |
dt.Columns.Add(dc12); | |
dt.Columns.Add(dc13); | |
dt.Columns.Add(dc14); | |
dt.Columns.Add(dc15); | |
dt.Columns.Add(dc16); | |
dt.Columns.Add(dc17); | |
dt.Columns.Add(dc18); | |
dt.Columns.Add(dc19); | |
dt.Columns.Add(dc20); | |
dt.Columns.Add(dc21); | |
dt.Columns.Add(dc22); | |
dt.Columns.Add(dc23); | |
dt.Columns.Add(dc24); | |
dt.Columns.Add(dc25); | |
dt.Columns.Add(dc26); | |
dt.Columns.Add(dc27); | |
dt.Columns.Add(dc28); | |
dt.Columns.Add(dc29); | |
dt.Columns.Add(dc30); | |
dt.Columns.Add(dc31); | |
dt.Columns.Add(dc32); | |
dt.Columns.Add(dc33); | |
dt.Columns.Add(dc34); | |
dt.Columns.Add(dc35); | |
dt.Columns.Add(dc36); | |
dt.Columns.Add(dc37); | |
dt.Columns.Add(dc38); | |
dt.Columns.Add(dc39); | |
dt.Columns.Add(dc40); | |
dt.Columns.Add(dc41); | |
dt.Columns.Add(dc42); | |
dt.Columns.Add(dc43); | |
dt.Columns.Add(dc44); | |
dt.Columns.Add(dc45); | |
for (int i = 0; i < 30000; i++) | |
{ | |
DataRow dr = dt.NewRow(); | |
dr[0] = "Sample text to test"; | |
dr[1] = "Sample text to test"; | |
dr[2] = "Sample text to test"; | |
dr[3] = "Sample text to test"; | |
dr[4] = "Sample text to test"; | |
dr[5] = "Sample text to test"; | |
dr[6] = "Sample text to test"; | |
dr[7] = "Sample text to test"; | |
dr[8] = "Sample text to test"; | |
dr[9] = "Sample text to test"; | |
dr[10] = "Sample text to test"; | |
dr[11] = "Sample text to test"; | |
dr[12] = "Sample text to test"; | |
dr[13] = "Sample text to test"; | |
dr[14] = "Sample text to test"; | |
dr[15] = "Sample text to test"; | |
dr[16] = "Sample text to test"; | |
dr[17] = "Sample text to test"; | |
dr[18] = "Sample text to test"; | |
dr[19] = "Sample text to test"; | |
dr[20] = "Sample text to test"; | |
dr[21] = "Sample text to test"; | |
dr[22] = "Sample text to test"; | |
dr[23] = "Sample text to test"; | |
dr[24] = "Sample text to test"; | |
dr[25] = "Sample text to test"; | |
dr[26] = "Sample text to test"; | |
dr[27] = "Sample text to test"; | |
dr[28] = "Sample text to test"; | |
dr[29] = "Sample text to test"; | |
dr[30] = "Sample text to test"; | |
dr[31] = "Sample text to test"; | |
dr[32] = "Sample text to test"; | |
dr[33] = "Sample text to test"; | |
dr[34] = "Sample text to test"; | |
dr[35] = "Sample text to test"; | |
dr[36] = "Sample text to test"; | |
dr[37] = "Sample text to test"; | |
dr[38] = "Sample text to test"; | |
dr[39] = "Sample text to test"; | |
dr[40] = "Sample text to test"; | |
dr[41] = "Sample text to test"; | |
dr[42] = "Sample text to test"; | |
dr[43] = "Sample text to test"; | |
dr[44] = "Sample text to test"; | |
dt.Rows.Add(dr); | |
} | |
XLWorkbook wb = new XLWorkbook(); | |
var ws = wb.Worksheets.Add(dt, "Sheet1"); | |
ws.Table(0).ShowAutoFilter = false; | |
ws.Table(0).Theme = XLTableTheme.None; | |
Console.WriteLine("Start saving"); | |
wb.SaveAs(@"C:\temp\1874\large.xlsx", false); | |
Console.WriteLine("Finished saving"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment