OLT.Extensions.EPPlus
10.0.0
Prefix Reserved
dotnet add package OLT.Extensions.EPPlus --version 10.0.0
NuGet\Install-Package OLT.Extensions.EPPlus -Version 10.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OLT.Extensions.EPPlus" Version="10.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OLT.Extensions.EPPlus" Version="10.0.0" />
<PackageReference Include="OLT.Extensions.EPPlus" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OLT.Extensions.EPPlus --version 10.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: OLT.Extensions.EPPlus, 10.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OLT.Extensions.EPPlus@10.0.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OLT.Extensions.EPPlus&version=10.0.0
#tool nuget:?package=OLT.Extensions.EPPlus&version=10.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
- Converts IEnumerable<T> into an Excel worksheet/package
- Reads data from Excel packages and convert them into a List<T>.
How to Use
public class PersonDto
{
[ExcelTableColumn("First name")]
[Required(ErrorMessage = "First name cannot be empty.")]
[MaxLength(50, ErrorMessage = "First name cannot be more than {1} characters.")]
public string FirstName { get; set; }
[ExcelTableColumn(columnName = "Last name", isOptional = true)]
public string LastName { get; set; }
[ExcelTableColumn(3)]
[Range(1900, 2050, ErrorMessage = "Please enter a value bigger than {1}")]
public int YearBorn { get; set; }
public decimal NotMapped { get; set; }
[ExcelTableColumn(isOptional = true)]
public decimal OptionalColumn1 { get; set; }
[ExcelTableColumn(columnIndex=999, isOptional = true)]
public decimal OptionalColumn2 { get; set; }
}
- Converting from Excel to list of objects
// Direct usage:
excelPackage.ToList<PersonDto>(configuration => configuration.SkipCastingErrors());
// Specific worksheet:
excelPackage.GetWorksheet("Persons").ToList<PersonDto>();
- From a list of objects to Excel package
List<PersonDto> persons = new List<PersonDto>();
// Convert list into ExcelPackage
ExcelPackage excelPackage = persons.ToExcelPackage();
// Convert list into byte array
byte[] excelPackageXlsx = persons.ToXlsx();
// Generate ExcelPackage with configuration
List<PersonDto> pre50 = persons.Where(x => x.YearBorn < 1950).ToList();
List<PersonDto> post50 = persons.Where(x => x.YearBorn >= 1950).ToList();
ExcelPackage excelPackage = pre50.ToWorksheet("< 1950")
.WithConfiguration(configuration => configuration.WithColumnConfiguration(x => x.AutoFit()))
.WithColumn(x => x.FirstName, "First Name")
.WithColumn(x => x.LastName, "Last Name")
.WithColumn(x => x.YearBorn, "Year of Birth")
.WithTitle("< 1950")
.NextWorksheet(post50, "> 1950")
.WithColumn(x => x.LastName, "Last Name")
.WithColumn(x => x.YearBorn, "Year of Birth")
.WithTitle("> 1950")
.ToExcelPackage();
- Generating an Excel template from ExcelWorksheetAttribute marked classes
[ExcelWorksheet("Stocks")]
public class StocksDto
{
[ExcelTableColumn("SKU")]
public string Barcode { get; set; }
[ExcelTableColumn]
public int Quantity { get; set; }
}
// To ExcelPackage
ExcelPackage excelPackage = Assembly.GetExecutingAssembly().GenerateExcelPackage(nameof(StocksDto));
// To ExcelWorksheet
using(var excelPackage = new ExcelPackage()){
ExcelWorksheet worksheet = excelPackage.GenerateWorksheet(Assembly.GetExecutingAssembly(), nameof(StocksDto));
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.0 | 124 | 12/25/2025 |
| 9.0.0 | 33,169 | 11/12/2024 |
| 8.2.0 | 52,760 | 10/6/2024 |
| 8.1.0 | 703 | 3/21/2024 |
| 8.0.0 | 599 | 12/20/2023 |
| 8.0.0-beta-0005 | 194 | 12/10/2023 |
| 1.0.0 | 673 | 5/5/2023 |
| 0.1.0-beta-0002 | 309 | 5/5/2023 |
| 0.1.0-beta-0001 | 1,560 | 8/25/2022 |