Skip to content

Commit b1013d1

Browse files
995361-PerformanceMetrics
1 parent 9f505b0 commit b1013d1

File tree

60 files changed

+145
-864
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+145
-864
lines changed

Performance Metrics/Create/Boolean Data Type/.NET/Boolean Data Type/Boolean Data Type/Program.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,22 @@ static void Main(string[] args)
1414
IWorkbook workbook = application.Workbooks.Create(1);
1515
IWorksheet sheet = workbook.Worksheets[0];
1616

17-
//Fill 150 rows × 10,000 columns with boolean
18-
for (int row = 1; row <= 150; row++)
17+
int count = 0;
18+
19+
//Fill 10,000 rows × 50 columns with boolean
20+
for (int row = 1; row <= 100000; row++)
1921
{
20-
for (int col = 1; col <= 10000; col++)
22+
for (int column = 1; column <= 50; column++)
2123
{
22-
sheet[row, col].Boolean = (col % 2 == 0);
24+
//Boolean
25+
sheet.SetBoolean(row, column, count % 2 == 0);
26+
27+
count++;
2328
}
29+
2430
}
31+
32+
workbook.SaveAs(@"../../../Output/Output.xlsx");
2533
}
2634
}
2735
}

Performance Metrics/Create/DateTime Data Type/.NET/DateTime Data Type/DateTime Data Type/Program.cs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,23 @@ static void Main(string[] args)
1414
IWorkbook workbook = application.Workbooks.Create(1);
1515
IWorksheet sheet = workbook.Worksheets[0];
1616

17-
//Fill 150 rows × 10,000 columns with date
18-
for (int row = 1; row <= 150; row++)
17+
DateTime dateTime = new DateTime(1900, 1, 1);
18+
19+
//Fill 10,000 rows × 50 columns with date
20+
for (int row = 1; row <= 100000; row++)
1921
{
20-
for (int col = 1; col <= 10000; col++)
22+
for (int column = 1; column <= 50; column++)
2123
{
22-
sheet[row, col].DateTime = new DateTime(2025, 1, 1).AddDays(col);
24+
25+
//Date Time set method
26+
sheet.SetValue(row, column, dateTime.ToString(), "mm/dd/yyyy");
27+
2328
}
29+
dateTime = dateTime.AddDays(1);
2430
}
31+
32+
33+
workbook.SaveAs(@"../../../Output/Output.xlsx");
2534
}
2635
}
2736
}

Performance Metrics/Create/Formula Data Type/.NET/Formula Data Type/Formula Data Type/Program.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,17 @@ static void Main(string[] args)
1414
IWorkbook workbook = application.Workbooks.Create(1);
1515
IWorksheet sheet = workbook.Worksheets[0];
1616

17-
//Fill 150 rows × 10,000 columns with formula
18-
for (int row = 1; row <= 150; row++)
17+
//Fill 10,000 rows × 50 columns with formula
18+
for (int row = 2; row <= 100000; row++)
1919
{
20-
for (int col = 1; col <= 10000; col++)
20+
for (int column = 1; column <= 50; column++)
2121
{
22-
sheet[row, col].Formula = $"=SUM({row},{col})";
22+
//Fill 10,000 rows × 150 columns with formula
23+
sheet.SetFormula(row, column, "IF(A1>10,SUM(A1,10),10)");
2324
}
2425
}
26+
27+
workbook.SaveAs(@"../../../Output/Output.xlsx");
2528
}
2629
}
2730
}

Performance Metrics/Create/Number Data Type/.NET/Number Data Type/Number Data Type/Program.cs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,25 @@ static void Main(string[] args)
1212
IApplication application = excelEngine.Excel;
1313
application.DefaultVersion = ExcelVersion.Xlsx;
1414
IWorkbook workbook = application.Workbooks.Create(1);
15+
16+
//Access the first worksheet which contains data
1517
IWorksheet sheet = workbook.Worksheets[0];
1618

17-
//Fill 150 rows × 10,000 columns with number
18-
for (int row = 1; row <= 150; row++)
19+
int count = 0;
20+
21+
//Fill 10,000 rows × 50 columns with number
22+
for (int row = 1; row <= 100000; row++)
1923
{
20-
for (int col = 1; col <= 10000; col++)
24+
for (int column = 1; column <= 50; column++)
2125
{
22-
sheet[row, col].Number = row * col;
26+
//Number set method
27+
sheet.SetNumber(row, column, count);
28+
29+
count++;
2330
}
2431
}
32+
33+
workbook.SaveAs(@"../../../Output/Output.xlsx");
2534
}
2635
}
2736
}

Performance Metrics/Create/String Data Type/.NET/String Data Type/String Data Type/Program.cs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
using System.IO;
2-
using Syncfusion.XlsIO;
1+
using Syncfusion.XlsIO;
2+
using System.IO;
3+
using static System.Net.WebRequestMethods;
34

45
namespace String_Data_Type
56
{
@@ -13,15 +14,20 @@ static void Main(string[] args)
1314
application.DefaultVersion = ExcelVersion.Xlsx;
1415
IWorkbook workbook = application.Workbooks.Create(1);
1516
IWorksheet sheet = workbook.Worksheets[0];
16-
17-
//Fill 150 rows × 10,000 columns with string
18-
for (int row = 1; row <= 150; row++)
17+
18+
int count = 0;
19+
// Fill 10,000 rows × 50 columns with string
20+
for (int row = 1; row <= 100000; row++)
1921
{
20-
for (int col = 1; col <= 10000; col++)
22+
for (int column = 1; column <= 50; column++)
2123
{
22-
sheet[row, col].Text = $"R{row}C{col}";
24+
25+
sheet.SetText(row, column, "One" + count);
26+
27+
count++;
2328
}
2429
}
30+
workbook.SaveAs(@"../../../Output/Output.xlsx");
2531
}
2632
}
2733
}

0 commit comments

Comments
 (0)