Skip to content

Save/Load C# generics to/from Excel (XLSX) spreadsheets, easily

License

Notifications You must be signed in to change notification settings

panoramicdata/PanoramicData.SheetMagic

Folders and files

NameName
Last commit message
Last commit date
Jun 27, 2022
Nov 16, 2023
Feb 3, 2025
Apr 7, 2020
Mar 31, 2019
Mar 31, 2019
Mar 21, 2022
Nov 7, 2022
Jun 27, 2022
Mar 31, 2019
Nov 16, 2023
Mar 21, 2022

Repository files navigation

PanoramicData.SheetMagic

Codacy Badge Commit Activity

Easily save/load from/to Excel (XLSX) documents using generics in C#

Writing to a file

// Write a list of items to an XLSX file
var things = new List<Thing>
{
	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

// Read a list of items from an XLSX file
using var workbook = new MagicSpreadsheet(fileInfo);
workbook.Load();
// Use default worksheet
var cars = workbook.GetList<Car>();
// Use a different worksheet
var animals = workbook.GetList<Animal>("Animals");

About

Save/Load C# generics to/from Excel (XLSX) spreadsheets, easily

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published