Chsword.Excel2Object
2.0.0.194
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Chsword.Excel2Object --version 2.0.0.194
NuGet\Install-Package Chsword.Excel2Object -Version 2.0.0.194
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="Chsword.Excel2Object" Version="2.0.0.194" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Chsword.Excel2Object --version 2.0.0.194
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Chsword.Excel2Object, 2.0.0.194"
#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 Chsword.Excel2Object as a Cake Addin
#addin nuget:?package=Chsword.Excel2Object&version=2.0.0.194
// Install Chsword.Excel2Object as a Cake Tool
#tool nuget:?package=Chsword.Excel2Object&version=2.0.0.194
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Excel2Object
Excel convert to .NET Object / .NET Object convert to Excel.
Platform
NuGet Install
PM> Install-Package Chsword.Excel2Object
Release Notes and roadmap
Features not supported
- cli tool
- support auto width column
- 1. support date datetime time in excel\
Release Notes
- 2022.03.19
- support ExcelImporterOptions , Skipline Issue32SkipLineImport.cs
- fixed super class prop bug Issue31SuperClass.cs
- 2021.11.4
- multiple sheet , demo & test file : Pr28MultipleSheetTest.cs
- 2021.10.23
- Nullable DateTime bugfixed @SunBrook
- 2021.10.22
- support Nullable, test file :Pr24NullableTest.cs @SunBrook
- 2021.5.28
- support style for header & cell, new [ExcelColumnAttribute] for column.
- support Functions ./ExcelFunctions.md
var list = new List<Pr20Model>
{
new Pr20Model
{
Fullname = "AAA", Mobile = "123456798123"
},
new Pr20Model
{
Fullname = "BBB", Mobile = "234"
}
};
var bytes = ExcelHelper.ObjectToExcelBytes(list, ExcelType.Xlsx);
// model
[ExcelTitle("SheetX")]
public class Pr20Model
{
[ExcelColumn("姓名", CellFontColor = ExcelStyleColor.Red)]
public string Fullname { get; set; }
[ExcelColumn("手机",
HeaderFontFamily = "宋体",
HeaderBold = true,
HeaderFontHeight = 30,
HeaderItalic = true,
HeaderFontColor = ExcelStyleColor.Blue,
HeaderUnderline = true,
HeaderAlignment = HorizontalAlignment.Right,
//cell
CellAlignment = HorizontalAlignment.Justify
)]
public string Mobile { get; set; }
}
- v2.0.0.113
convert project to netstandard2.0 and .net452
fixbug #12 #13
- v1.0.0.80
- support simple formula
- support standard excel model
- excel & JSON convert
- excel & Dictionary<string,object> convert
Support Uri to a hyperlink cell
And also support text cell to Uri Type
- v1.0.0.43
Support xlsx [thanks Soar360]
Support complex Boolean type
- v1.0.0.36
Add ExcelToObject<T>(bytes)
Demo Code
Model
public class ReportModel
{
[Excel("My Title",Order=1)]
public string Title { get; set; }
[Excel("User Name",Order=2)]
public string Name { get; set; }
}
Model List
var models = new List<ReportModel>
{
new ReportModel{Name="a",Title="b"},
new ReportModel{Name="c",Title="d"},
new ReportModel{Name="f",Title="e"}
};
Convert Object to Excel file.
var exporter = new ExcelExporter();
var bytes = exporter.ObjectToExcelBytes(models);
File.WriteAllBytes("C:\\demo.xls", bytes);
Convert Excel file to Object
var importer = new ExcelImporter();
IEnumerable<ReportModel> result = importer.ExcelToObject<ReportModel>("c:\\demo.xls");
// also can use bytes
//IEnumerable<ReportModel> result = importer.ExcelToObject<ReportModel>(bytes);
With ASP.NET MVC In ASP.NET MVC Model, DisplayAttribute can be supported like ExcelTitleAttribute.
Document
http://www.cnblogs.com/chsword/p/excel2object.html
Reference
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.7.2
- NPOI (>= 2.6.0)
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Net.Http (>= 4.3.4)
-
.NETStandard 2.0
- NPOI (>= 2.6.0)
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Net.Http (>= 4.3.4)
-
.NETStandard 2.1
- NPOI (>= 2.6.0)
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Net.Http (>= 4.3.4)
-
net6.0
- NPOI (>= 2.6.0)
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Net.Http (>= 4.3.4)
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 |
---|---|---|
2.0.0.200 | 82 | 4/24/2024 |
2.0.0.198 | 465 | 11/2/2023 |
2.0.0.196 | 220 | 7/31/2023 |
2.0.0.194 | 137 | 7/31/2023 |
2.0.0.193 | 141 | 7/31/2023 |
2.0.0.190 | 469 | 3/4/2023 |
2.0.0.188 | 270 | 2/20/2023 |
2.0.0.181 | 722 | 8/14/2022 |
2.0.0.178 | 693 | 3/19/2022 |
2.0.0.175 | 434 | 3/19/2022 |
2.0.0.171 | 942 | 11/4/2021 |
2.0.0.161 | 345 | 10/23/2021 |
2.0.0.159 | 368 | 10/22/2021 |
2.0.0.156 | 806 | 5/28/2021 |
2.0.0.155 | 371 | 5/24/2021 |
2.0.0.153 | 379 | 5/24/2021 |
2.0.0.143 | 532 | 10/26/2020 |
2.0.0.142 | 453 | 10/26/2020 |
2.0.0.138 | 747 | 4/15/2020 |
2.0.0.131 | 548 | 3/11/2020 |
2.0.0.130 | 550 | 3/11/2020 |
2.0.0.128 | 538 | 3/9/2020 |
2.0.0.124 | 569 | 2/5/2020 |
2.0.0.122 | 567 | 12/26/2019 |
2.0.0.113 | 609 | 12/26/2019 |
2.0.0.105 | 593 | 12/25/2019 |
2.0.0-beta | 592 | 1/15/2019 |
1.0.0.100 | 2,728 | 11/9/2018 |
1.0.0.99 | 898 | 8/24/2018 |
1.0.0.98 | 820 | 8/24/2018 |
1.0.0.96 | 794 | 8/24/2018 |
1.0.0.94 | 839 | 8/24/2018 |
1.0.0.93 | 820 | 8/24/2018 |
1.0.0.92 | 828 | 8/24/2018 |
1.0.0.80 | 1,201 | 7/19/2017 |
1.0.0.43 | 1,373 | 4/13/2016 |
1.0.0.40 | 1,160 | 3/11/2016 |
1.0.0.35 | 1,022 | 3/11/2016 |
1.0.0.32 | 1,077 | 12/31/2015 |
1.0.0.20 | 1,068 | 12/30/2015 |
1.0.0.18 | 1,015 | 12/30/2015 |
1.0.0.10 | 1,490 | 8/16/2014 |
1.0.0.3 | 1,213 | 8/16/2014 |
1.0.0.1 | 1,107 | 8/16/2014 |
1.0.0 | 1,450 | 4/26/2014 |