Zeytinbey.SwiftExcelHelper 1.0.1

dotnet add package Zeytinbey.SwiftExcelHelper --version 1.0.1                
NuGet\Install-Package Zeytinbey.SwiftExcelHelper -Version 1.0.1                
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="Zeytinbey.SwiftExcelHelper" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Zeytinbey.SwiftExcelHelper --version 1.0.1                
#r "nuget: Zeytinbey.SwiftExcelHelper, 1.0.1"                
#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.
// Install Zeytinbey.SwiftExcelHelper as a Cake Addin
#addin nuget:?package=Zeytinbey.SwiftExcelHelper&version=1.0.1

// Install Zeytinbey.SwiftExcelHelper as a Cake Tool
#tool nuget:?package=Zeytinbey.SwiftExcelHelper&version=1.0.1                

Zeytinbey.SwiftExcelHelper

About

Zeytinbey.SwiftExcelHelper is an easy-to-use package that streamlines SwiftExcel tasks. Create Excel files effortlessly with handy helper classes and extension methods, making your workflow simpler and more efficient.

Usage

Create Model Class

public class ExcelModel()
{
    [ExcelColumn(Header = "Job Title", Width = 27)]
    public string? JobTitle { get; set; }

    [Display(Name = "Full Name")]
    [ExcelColumn(Width = 16)]
    public string? FullName { get; set; }

    [DisplayName("Total Payment")]
    [ExcelColumn(Width = 15)]
    public decimal TotalPayment { get; set; }

    public int Age { get; set; }
}

Get Data

var data = new List<ExcelModel>
{
    new() { JobTitle = "Software Engineer", FullName = "Peter Baker", TotalPayment = 200m, Age = 28 },
    new() { JobTitle = "Marketing Specialist", FullName = "Sarah Gordon", TotalPayment = 250m, Age = 35 },
    new() { JobTitle = "Financial Analyst", FullName = "John Smith", TotalPayment = 300m, Age = 42 },
    new() { JobTitle = "HR Manager", FullName = "Emma Johnson", TotalPayment = 150m, Age = 29 },
    new() { JobTitle = "Graphic Designer", FullName = "Michael Davis", TotalPayment = 500m, Age = 31 },
    new() { JobTitle = "Sales Representative", FullName = "Olivia Miller", TotalPayment = 450m, Age = 26 },
    new() { JobTitle = "Data Scientist", FullName = "David Brown", TotalPayment = 700m, Age = 38 },
    new() { JobTitle = "Project Manager", FullName = "Sophia Wilson", TotalPayment = 120m, Age = 45 },
    new() { JobTitle = "Customer Support Specialist", FullName = "Daniel Taylor", TotalPayment = 800m, Age = 32 },
    new() { JobTitle = "Product Manager", FullName = "Mia Anderson", TotalPayment = 350m, Age = 27 }
};

Create Excel File

SwiftExcelHelper.WriteEnumerable(data, @"C:\File.xslx", "Sheet Name");

Dependencies

SwiftExcel (>= 1.1.3)

Written by Sinan İLYAS. It's licensed under MIT.

Product 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. 
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
1.0.1 270 2/1/2024
1.0.0 248 1/12/2024

Now, the package recognizes Excel column headers not only from [ExcelColumn(Header="Title")] attributes but also from the widely-used [Display(Name="Title")] and [DisplayName("Title")] attributes.