public void ExportWithPlainClass() { IList <DummyPerson> dummyPeople = new List <DummyPerson>(); for (int index = 0; index < 30; index++) { dummyPeople.Add(DummyFactory.CreateDummyPerson()); } IExportEngine engine = new ExcelExportEngine(); engine.AddData(dummyPeople); var fileName = Guid.NewGuid().ToString() + "-plain-class.xlsx"; var filePath = PathConfig.BASE_PATH + fileName; engine.Export(filePath); }
public void ExportWithPlainClassAndSheetName() { IList <DummyPerson> dummyPeople = new List <DummyPerson>(); for (int index = 0; index < 30; index++) { dummyPeople.Add(DummyFactory.CreateDummyPerson()); } IExcelExportEngine engine = new ExcelExportEngine(); engine.AsExcel().SetFormat(ExcelVersion.XLS); engine.AsExcel().AddData(dummyPeople, "Dummy People"); var fileName = Guid.NewGuid().ToString() + "-plain-class-sheets-names.xls"; var filePath = PathConfig.BASE_PATH + fileName; engine.Export(filePath); }