예제 #1
0
        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);
        }
예제 #2
0
        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);
        }