ExcelUtility 1.0.6

There is a newer version of this package available.
See the version list below for details.
dotnet add package ExcelUtility --version 1.0.6
                    
NuGet\Install-Package ExcelUtility -Version 1.0.6
                    
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="ExcelUtility" Version="1.0.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ExcelUtility" Version="1.0.6" />
                    
Directory.Packages.props
<PackageReference Include="ExcelUtility" />
                    
Project file
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 ExcelUtility --version 1.0.6
                    
#r "nuget: ExcelUtility, 1.0.6"
                    
#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.
#addin nuget:?package=ExcelUtility&version=1.0.6
                    
Install as a Cake Addin
#tool nuget:?package=ExcelUtility&version=1.0.6
                    
Install as a Cake Tool

EPPlusHelper

https://www.cnblogs.com/ives/p/ExcelUtility.html

安装:

Install-Package ExcelUtility -Version 1.0.0

需要为对象添加特性,

[Column]
//试用Column指定需要保存到excel中的字段
[Description(description:"ATest")]
//使用Description添加表头显示的名称

public class Table
{
[Column]
[Description(description:"ATest")]
public string A { get; set; }

    [Column]  
    [Description(description: "BTest")]  
    public string B { get; set; }  

}  

需要注意单元格定位从0开始

//首先构造需要保存的对象
var testData = new List<Entity.Table>() {
new Entity.Table { A = "11111f", B = "1111111111111fff" },
new Entity.Table { A = "1111f", B = "111111fff" }
};
//在构造函数中传入表名,如果存在此文件则会删除旧文件
using (var tools = new ExcelHelper(new System.IO.FileInfo("test.xls")))
{
//1:自动化的将list中的数据写入表格
//写入默认的sheet1中
tools.SetData<Entity.Table>(testData);
//可以指定写入的表名
//tools.SetData<Entity.Table>(testData, "testSheet");
tools.Save();
}
using (var tools = new ExcelHelper(new System.IO.FileInfo("test.xls")))
{
//2:提供自定义的方式向任何表写入数据
//首先获取指定的sheet页
//提供默认参数为sheet1,即默认的sheet页
//var workSheet = tools.GetWorkSheet();
//也可以指定sheet页名称
var workSheet = tools.GetWorkSheet("newSheetName");
//向指定的单元格写入数据
workSheet.WriteCell(0, 0, "value");
tools.Save();
}

将excel中的数据映射到指定的数据类型
要求同上,需要
[Column]
//试用Column指定需要保存到excel中的字段
[Description(description:"ATest")]
//使用Description添加表头显示的名称
使用方式如下

//选择需要转换的表格并指定欲转换类型
var t = new Excel2Data<Table>(new System.IO.FileInfo("test.xls"));
//指定待转换的sheet页,默认值为sheet1
//var data = t.GetData();
var data=t.GetData("newSheetName");

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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 was computed.  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 was computed.  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. 
.NET Core netcoreapp2.1 is compatible.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 2.1

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.1.4 1,051 11/8/2019
1.1.2 597 11/8/2019
1.1.0 653 11/7/2019
1.0.9 1,267 11/7/2019
1.0.8 609 11/7/2019
1.0.7 680 11/7/2019
1.0.6 586 11/7/2019
1.0.5 906 11/7/2019
1.0.4 587 11/7/2019
1.0.2 604 11/7/2019
1.0.1 610 11/7/2019
1.0.0 815 11/7/2019