Skip to content

plantain-00/ExcelFile.net

Repository files navigation

NuGet version

ExcelFile.net

  • a Excel template editor.
  • a Fluent Excel File Writer based on NPOI.
  • a enumerator of worksheets, rows and cells.

Example A

A.xlsx

Code

//Example A from A.xlsx
IExcelEditor excelA = new ExcelEditor("../../A.xlsx");
excelA.Set("name", "Sara");
excelA.Set("age", 123);
excelA.Save("../../A_result.xlsx");

A_result.xlsx

Example B

B.xlsx

Code

//Example B from B.xlsx
IExcelEditor excelB = new ExcelEditor("../../B.xlsx");
excelB.Set("s",
           new[]
           {
               new
               {
                   Name = "Tommy",
                   Age = 12 as int?
               },
               new
               {
                   Name = "Philips",
                   Age = 13 as int?
               },
               new
               {
                   Name = "Sara",
                   Age = null as int?
               }
           });
excelB.Save("../../B_result.xlsx");

B_result.xlsx

Example C

C.xlsx

Code

//Example C from C.xlsx
IExcelEditor excelC = new ExcelEditor("../../C.xlsx");
excelC.Set("s",
           new[]
           {
               new
               {
                   Name = "Tommy",
                   Age = 12
               },
               new
               {
                   Name = "Philips",
                   Age = 13
               }
           },
           false);
excelC.UpdateFormula();
excelC.Save("../../C_result.xlsx");

C_result.xlsx

About

A Excel File operator based on NPOI.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages