-
Notifications
You must be signed in to change notification settings - Fork 293
Import
Mats Alm edited this page Mar 23, 2022
·
8 revisions
From the Cells property (ExcelRange) you can access these methods to load data from various sources:
-
LoadFromText
andLoadFromTextAsync
- Read a csv text file and load the data into a range on a worksheet. -
LoadFromDataReader
andLoadFromDataReaderAsync
- Loads data into a range from a DataReader -
LoadFromDataTable
- Loads data into a range from a DataTable. Can be used for importing data from a range of sources, like XML (example provided) and databases. -
LoadFromCollection
- Loads data into a range from an IEnumerable using reflection. -
LoadFromCollection using attributes
- Loads data into a range/table from an IEnumerable using reflection. Uses attributes that specifies styling, number formats, formulas, etc. -
LoadFromDictionaries
- Loads data into a range from an IEnumerable of ExpandoObject/dynamic objects (via their IDictionary<string, object> interface. Useful for importing json data, example provided. -
LoadFromArrays
- Loads data into a range from an IEnumerable of object[] 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. For more detailed examples, have a look at sample 4 & 5 the sample project Sample-.NET Framework or Sample-.NET Framework.
EPPlus Software AB - https://epplussoftware.com
- What is new in EPPlus 5+
- Breaking Changes in EPPlus 5
- Breaking Changes in EPPlus 6
- Breaking Changes in EPPlus 7
- Breaking Changes in EPPlus 8
- Addressing a worksheet
- Dimension/Used range
- Copying ranges/sheets
- Insert/Delete
- Filling ranges
- Sorting ranges
- Taking and skipping columns/rows
- Data validation
- Comments
- Freeze and Split Panes
- Header and Footer
- Hyperlinks
- Autofit columns
- Grouping and Ungrouping Rows and Columns
- Formatting and styling
- Conditional formatting
- Using Themes
- Working with custom named table- or slicer- styles