Import (original) (raw)
Load data into a spreadsheet
From the Cells property (ExcelRange) you can access these methods to loads data from various sources:
- and - Read a text file (csv, tsv, etc) and load the data into a range on a worksheet.
- and - Loads data into a range from an
System.Data.IDataReader - - Loads data into a range from a
System.Data.DataTable. Can be used for importing data from a range of sources, like XML (example provided) and databases. - - Loads data into a range from an
IEnumerableusing reflection. - LoadFromCollection using attributes - Loads data into a range/table from an
IEnumerableusing reflection. Uses attributes that specifies styling, number formats, formulas, etc. - - Loads data into a range from an
IEnumerableofExpandoObject/dynamic objects (via theirIDictionary<string, object>interface. Useful for importing json data, example provided. - - Loads data into a range from an
IEnumerableofobject[]where each object array becomes a row in the worksheet.
You can optionally specify a parameter to create an ExcelTable when you use these methods.