Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void CreateXls(IList<ExportItem> exportItems, string file)
- {
- var workbook = new Workbook();
- Worksheet worksheet = workbook.Worksheets[0];
- Cells cells = worksheet.Cells;
- cells.ImportCustomObjects(new Collection<ExportItem>(exportItems),
- new[] { "ExportCode", "Topic", "Title", "Name", "LastName", "Email", "NewFileName", "NewLicenseAgreement" },
- true, 0, 0, exportItems.Count, true, "dd/MM/yyyy HH:mm", false);
- worksheet.AutoFitColumns();
- workbook.Save(file, SaveFormat.Excel97To2003);
- }
Advertisement
Add Comment
Please, Sign In to add comment