{"id":19992824,"url":"https://github.com/eraydin/EPPlus.Core.Extensions","last_synced_at":"2025-05-04T12:30:26.501Z","repository":{"id":96094809,"uuid":"100799350","full_name":"eraydin/EPPlus.Core.Extensions","owner":"eraydin","description":"An extensions library for EPPlus package to generate and manipulate Excel files easily.","archived":true,"fork":false,"pushed_at":"2020-12-05T00:01:49.000Z","size":665,"stargazers_count":68,"open_issues_count":4,"forks_count":24,"subscribers_count":8,"default_branch":"develop","last_synced_at":"2025-05-02T11:54:14.731Z","etag":null,"topics":["epplus","epplus-library","excel","extensions","msexcel","netframework","netstandard"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eraydin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-19T14:22:37.000Z","updated_at":"2025-04-22T23:11:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"db3c14dc-d492-49c4-b5e0-1140ac537c97","html_url":"https://github.com/eraydin/EPPlus.Core.Extensions","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eraydin%2FEPPlus.Core.Extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eraydin%2FEPPlus.Core.Extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eraydin%2FEPPlus.Core.Extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eraydin%2FEPPlus.Core.Extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eraydin","download_url":"https://codeload.github.com/eraydin/EPPlus.Core.Extensions/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252333946,"owners_count":21731301,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["epplus","epplus-library","excel","extensions","msexcel","netframework","netstandard"],"created_at":"2024-11-13T04:52:20.354Z","updated_at":"2025-05-04T12:30:26.488Z","avatar_url":"https://github.com/eraydin.png","language":"C#","funding_links":[],"categories":["C\\#"],"sub_categories":[],"readme":"# **EPPlus.Core.Extensions** [![Build status](https://ci.appveyor.com/api/projects/status/cdhoa8m20k2k71ke?svg=true)](https://ci.appveyor.com/project/eraydin/epplus-core-extensions) [![codecov](https://codecov.io/gh/eraydin/EPPlus.Core.Extensions/graph/badge.svg)](https://codecov.io/gh/eraydin/EPPlus.Core.Extensions)\n\n### **Installation** [![NuGet version](https://badge.fury.io/nu/EPPlus.Core.Extensions.svg)](https://badge.fury.io/nu/EPPlus.Core.Extensions)\n\nIt's as easy as `PM\u003e Install-Package EPPlus.Core.Extensions` from [nuget](http://nuget.org/packages/EPPlus.Core.Extensions)\n\n### **Dependencies**\n\n**.NET Framework 4.6.1**\n      \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;*EPPlus \u003e= 4.5.3.3* \n      \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;*System.ComponentModel.Annotations \u003e= 4.7.0*\n\n**.NET Standard 2.0**\n    \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;*EPPlus \u003e= 4.5.3.3*\n    \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;*System.ComponentModel.Annotations \u003e= 4.7.0*\n\n### **Documentation and Examples**\n\nThe project will be documented soon but you can look at the test project for now. I hope it has enough number of examples to give you better idea about how to use these extension methods. \n\n- Converts IEnumerable\u003cT\u003e into an Excel worksheet/package\n- Reads data from Excel packages and convert them into a List\u003cT\u003e.\n\n##### Basic examples:\n\n```cs\npublic class PersonDto\n    {      \n        [ExcelTableColumn(\"First name\")]\n        [Required(ErrorMessage = \"First name cannot be empty.\")]\n        [MaxLength(50, ErrorMessage = \"First name cannot be more than {1} characters.\")] \n        public string FirstName { get; set; }\n\n        [ExcelTableColumn(columnName = \"Last name\", isOptional = true)]       \n        public string LastName { get; set; }\n        \n        [ExcelTableColumn(3)]\n        [Range(1900, 2050, ErrorMessage = \"Please enter a value bigger than {1}\")]\n        public int YearBorn { get; set; }\n        \n        public decimal NotMapped { get; set; }\n\n        [ExcelTableColumn(isOptional = true)]\n        public decimal OptionalColumn1 { get; set; }\n\n        [ExcelTableColumn(columnIndex=999, isOptional = true)]\n        public decimal OptionalColumn2 { get; set; }\n    }      \n```\n\n- Converting from Excel to list of objects\n\n```cs\n    // Direct usage: \n        excelPackage.ToList\u003cPersonDto\u003e(configuration =\u003e configuration.SkipCastingErrors());\n\n    // Specific worksheet: \n        excelPackage.GetWorksheet(\"Persons\").ToList\u003cPersonDto\u003e(); \n``` \n    \n- From a list of objects to Excel package\n\n```cs\n    List\u003cPersonDto\u003e persons = new List\u003cPersonDto\u003e();\n         \n    // Convert list into ExcelPackage\n        ExcelPackage excelPackage = persons.ToExcelPackage();\n\n    // Convert list into byte array \n        byte[] excelPackageXlsx = persons.ToXlsx();\n       \n\n    // Generate ExcelPackage with configuration\n\n    List\u003cPersonDto\u003e pre50 = persons.Where(x =\u003e x.YearBorn \u003c 1950).ToList();\n    List\u003cPersonDto\u003e post50 = persons.Where(x =\u003e x.YearBorn \u003e= 1950).ToList();\n        \n    ExcelPackage excelPackage = pre50.ToWorksheet(\"\u003c 1950\")\n                             .WithConfiguration(configuration =\u003e configuration.WithColumnConfiguration(x =\u003e x.AutoFit()))\n                             .WithColumn(x =\u003e x.FirstName, \"First Name\")\n                             .WithColumn(x =\u003e x.LastName, \"Last Name\")\n                             .WithColumn(x =\u003e x.YearBorn, \"Year of Birth\")\n                             .WithTitle(\"\u003c 1950\")\n                             .NextWorksheet(post50, \"\u003e 1950\")\n                             .WithColumn(x =\u003e x.LastName, \"Last Name\")\n                             .WithColumn(x =\u003e x.YearBorn, \"Year of Birth\")\n                             .WithTitle(\"\u003e 1950\")\n                             .ToExcelPackage(); \n```\n\n- Generating an Excel template from ExcelWorksheetAttribute marked classes\n\n```cs \n    [ExcelWorksheet(\"Stocks\")]\n    public class StocksDto\n    {\n        [ExcelTableColumn(\"SKU\")]\n        public string Barcode { get; set; }\n    \n        [ExcelTableColumn]\n        public int Quantity { get; set; }\n    }   \n\n    // To ExcelPackage\n    ExcelPackage excelPackage = Assembly.GetExecutingAssembly().GenerateExcelPackage(nameof(StocksDto));\n \n    // To ExcelWorksheet\n    using(var excelPackage = new ExcelPackage()){ \n    \n        ExcelWorksheet worksheet = excelPackage.GenerateWorksheet(Assembly.GetExecutingAssembly(), nameof(StocksDto));\n    \n    }  \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feraydin%2FEPPlus.Core.Extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feraydin%2FEPPlus.Core.Extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feraydin%2FEPPlus.Core.Extensions/lists"}