All Projects → chsword → Excel2Object

chsword / Excel2Object

Licence: MIT license
excel convert to .NET Object | Excel与.NET 对象进行转换,支持公式、多Sheet等功能

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Excel2Object

X2struct
Convert between json string and c++ object. json字符串和c++结构体之间互相转换
Stars: ✭ 251 (+617.14%)
Mutual labels:  object, convert
xlsx-calc
javascript nodejs excel formula parser
Stars: ✭ 83 (+137.14%)
Mutual labels:  formula, excel
fast-formula-parser
Parse and evaluate MS Excel formula in javascript.
Stars: ✭ 341 (+874.29%)
Mutual labels:  formula, excel
Ormi
A Light-ORM for accesing WMI
Stars: ✭ 176 (+402.86%)
Mutual labels:  mapper, netcore
spreadsheet
TypeScript/javascript spreadsheet parser, with formulas.
Stars: ✭ 40 (+14.29%)
Mutual labels:  formula, excel
Morphism
⚡ Type-safe data transformer for JavaScript, TypeScript & Node.js.
Stars: ✭ 336 (+860%)
Mutual labels:  object, mapper
Reogrid
Fast and powerful .NET spreadsheet component, support data format, freeze, outline, formula calculation, chart, script execution and etc. Compatible with Excel 2007 (.xlsx) format and working on .NET 3.5 (or client profile), WPF and Android platform.
Stars: ✭ 532 (+1420%)
Mutual labels:  formula, excel
Xresloader
跨平台Excel导表工具(Excel=>protobuf/msgpack/lua/javascript/json/xml)
Stars: ✭ 161 (+360%)
Mutual labels:  excel, convert
Calx.js
jQuery Calx - a jQuery plugin for creating formula-based calculation form
Stars: ✭ 190 (+442.86%)
Mutual labels:  formula, excel
Luckysheet
Luckysheet is an online spreadsheet like excel that is powerful, simple to configure, and completely open source.
Stars: ✭ 9,772 (+27820%)
Mutual labels:  formula, excel
Excelmapper
Map POCO objects to Excel files
Stars: ✭ 166 (+374.29%)
Mutual labels:  mapper, excel
hcv-color
🌈 Color model HCV/HCG is an alternative to HSV and HSL, derived by Munsell color system, usable for Dark and Light themes... 🌈
Stars: ✭ 44 (+25.71%)
Mutual labels:  formula, convert
Npoi.mapper
Use this tool to import or export data with Excel file. The tool is a convention based mapper between strong typed object and Excel data via NPOI.
Stars: ✭ 348 (+894.29%)
Mutual labels:  mapper, excel
Change By Example
Finds a function that transforms a given object into another given object.
Stars: ✭ 32 (-8.57%)
Mutual labels:  object, mapper
Poiji
🍬 A tiny library converting excel rows to a list of Java objects based on Apache POI
Stars: ✭ 255 (+628.57%)
Mutual labels:  mapper, excel
Excelize
Golang library for reading and writing Microsoft Excel™ (XLSX) files.
Stars: ✭ 10,286 (+29288.57%)
Mutual labels:  formula, excel
Epplus
EPPlus 5-Excel spreadsheets for .NET
Stars: ✭ 693 (+1880%)
Mutual labels:  excel, netcore
Filecontextcore
FileContextCore is a "Database"-Provider for Entity Framework Core and adds the ability to store information in files instead of being limited to databases.
Stars: ✭ 91 (+160%)
Mutual labels:  excel, netcore
Formula Parser
Javascript Library parsing Excel Formulas and more
Stars: ✭ 544 (+1454.29%)
Mutual labels:  formula, excel
derivejs
DeriveJS is a reactive ODM - Object Document Mapper - framework, a "wrapper" around a database, that removes all the hassle of data-persistence by handling it transparently in the background, in a DRY manner.
Stars: ✭ 54 (+54.29%)
Mutual labels:  object, mapper

Excel2Object

install from nuget release Build status CodeFactor

Excel convert to .NET Object / .NET Object convert to Excel.

Platform

.NET 4.5.2 + .NET Standard 2.0+

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
  • 2021.11.4
  • 2021.10.23
  • Nullable DateTime bugfixed @SunBrook
  • 2021.10.22
  • 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

https://github.com/tonyqus/npoi

https://github.com/chsword/ctrc

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].