https://github.com/panoramicdata/panoramicdata.sheetmagic
Save/Load C# generics to/from Excel (XLSX) spreadsheets, easily
https://github.com/panoramicdata/panoramicdata.sheetmagic
Last synced: 9 months ago
JSON representation
Save/Load C# generics to/from Excel (XLSX) spreadsheets, easily
- Host: GitHub
- URL: https://github.com/panoramicdata/panoramicdata.sheetmagic
- Owner: panoramicdata
- License: mit
- Created: 2019-03-31T13:45:57.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2025-09-02T06:58:15.000Z (10 months ago)
- Last Synced: 2025-09-02T07:08:33.446Z (10 months ago)
- Language: C#
- Size: 2.23 MB
- Stars: 12
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# PanoramicData.SheetMagic
[](https://www.codacy.com/gh/panoramicdata/PanoramicData.SheetMagic/dashboard?utm_source=github.com&utm_medium=referral&utm_content=panoramicdata/PanoramicData.SheetMagic&utm_campaign=Badge_Grade)

Easily save/load from/to Excel (XLSX) documents using generics in C#
## Writing to a file
```c#
// Write a list of items to an XLSX file
var things = new List
{
new Thing
{
PropertyA = "Value 1",
PropertyB = 1
},
new Thing
{
PropertyA = "Value 2",
PropertyB = 2
},
};
var fileInfo = new FileInfo($"Output {DateTime.UtcNow:yyyyMMddTHHmmss}Z.xlsx");
using var workbook = new MagicSpreadsheet(fileInfo);
workbook.AddSheet(things);
workbook.Save();
```
## Reading from a file
```c#
// Read a list of items from an XLSX file
using var workbook = new MagicSpreadsheet(fileInfo);
workbook.Load();
// Use default worksheet
var cars = workbook.GetList();
// Use a different worksheet
var animals = workbook.GetList("Animals");