We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Code sample for creating an excel/csv using LightCells

We’re creating a excel & csv file out of custom objects, the collections will contain anywhere between 100k - 200k users. We’re planning to use LightCell API’s for generating these files. We couldn’t find a code sample where an excel file was generated out of custom objects using LightCell.

Currently we’re using it something like this

var workBook = new Aspose.Cells.Workbook();
var dataProvider = new ExportObjectsLightCellDataProvider(workBook, 0, 15);
OoxmlSaveOptions saveOptions;
saveOptions = new OoxmlSaveOptions(SaveFormat.CSV);
…Create object Collection exportObjects…
workBook.Worksheets[0].Cells.ImportCustomObjects(exportObjects, null, true, 1, 1, exportObjects.Count, true, “dd/mm/yyyy”, false);
workBook.Save(fileStream, saveOptions);

Would the above implementation use the LightCell API’s?


Thanks for your query.

Please see the document with example codes on how to read/write Excel files using LightCells APIs for your complete reference:

Hope, this helps a bit.

Thank you.