EPPlus, .NET-движок для рабочих книг Excel
Создавайте, читайте, изменяйте и рассчитывайте рабочие книги Excel в 100% управляемом .NET-коде. Импортируйте и экспортируйте данные в различных форматах. Microsoft Excel не требуется.
// EPPlus 8: set the license once at startup
ExcelPackage.License.SetNonCommercialPersonal("Your name");
using var package = new ExcelPackage();
var sheet = package.Workbook.Worksheets.Add("Sales");
sheet.Cells["A1"].LoadFromCollection(
orders, true, TableStyles.Medium2);
sheet.Cells["F2"].Formula = "SUM(D2:D100)";
package.Workbook.Calculate();
package.SaveAs("sales.xlsx");
Функции поддерживаются
EPPlus — это библиотека .NET Framework/.NET Core для управления Office Open XML-таблицами , распространяемая через Nuget . См. нашу страницу Программный список материалов для поддерживаемых .NET-фреймворков. EPPlus полностью написан на управляемом коде и не зависит от других библиотек, таких как Microsoft Excel.
Библиотека разработана с учётом разработчика. Наша цель всегда заключалась в том, чтобы разработчик с знаниями Excel или любой другой библиотеки таблиц легко освоил API. Или — как кто-то сказал — интеллисенс на пути к победе!
Worksheets & ranges
Rows, columns and cells, and everything you do with them.
- Copy worksheets and ranges, also to other workbooks, with styles and shifted references
- Insert and delete, sort and fill ranges
- Freeze and split panes, grouping, autofit and merged cells
- Data validation with a strongly typed interface per validation type
Показать все функцииПоказать меньше
- Add, remove, reorder, rename and hide worksheets
- Print areas, page breaks, document and printer settings
- Headers and footers
- Worksheet properties such as gridlines and tab colors
- Sort top to bottom or left to right, with custom lists, and the sort state is updated
- FillNumber, FillDateTime and FillList
- Copy styles only, or exclude cell properties when copying
- Row and column access via EntireRow and EntireColumn
- Named ranges
- Hyperlinks
- Notes with rich text, and threaded comments with mentions and resolve/re-open
- Query cells and ranges with LINQ
- Validation types: integer, decimal, list, date, time, any and custom
Formula calculation
A built-in calculation engine, with no dependency on Excel or any other library.
- 478 Excel functions
- Dynamic array formulas and LAMBDA
- Calculate a workbook, a worksheet or a single range
- Add your own functions at runtime
Показать все функцииПоказать меньше
- Legacy array formulas
- Precision as displayed: numeric values are rounded according to the number format
- Named ranges and the R1C1 format
- External links: update the cache of xlsx, xlsm and xltx workbooks, add references or break links
- Calculate via the external cache, or by loading and calculating the external workbook
- OLE and DDE links are retained (read only)
- More about formula calculation
Filters & slicers
Create, read, modify, apply and delete filters on ranges and tables.
- Value, date/time, custom, top 10 and dynamic filters
- Table and pivot table slicers
- 14 built-in slicer styles
- Custom slicer styles, from scratch or based on a built-in style
Tables & pivot tables
Formatted tables and pivot tables, including pivot table calculation.
- 60 table styles and 84 pivot table styles, or your own custom styles
- Total rows, sorting and filters, and adding or deleting rows and columns with shifting
- Pivot table calculation and GETPIVOTDATA
- Export tables to DataTable, JSON, HTML/CSS or IEnumerable<T>
Показать все функцииПоказать меньше
- Tables: sort with updated sort state, total row functions supported by the calculation engine
- Table filters and slicers
- Pivot tables: row, column, page and data fields
- 12 data field functions
- Numeric and date grouping
- Calculated fields
- Styling with pivot areas
- Pivot table filters and slicers
Charts & sparklines
Every Excel 2019 chart type, with modern styling.
- All Excel 2019 chart types, with strongly typed classes per type
- Full support for modern chart styles
- Load charts from crtx files
- Line, column and win/loss sparklines
Pictures, shapes & controls
Drawing objects on the worksheet and inside cells.
- 187 shape types with text, fills, gradients, effects and shadows
- Pictures: jpg, gif, png, tiff, bmp, emf, wmf, svg, ico and webp
- In-cell pictures with alt text, also via the IMAGE function
- Nine form control types, linked to cells or VBA macros
Показать все функцииПоказать меньше
- Add pictures from files, streams or byte arrays
- In-cell pictures can be marked as decorative; formats png, jpg, gif, bmp, webp and ico
- OLE objects, linked or embedded, with custom icons
Styling
Cell styles, conditional formatting and themes.
- Number formats, fonts, fills, borders, alignment and protection
- Named styles, wrap text and text rotation
- Conditional formatting: 45 types, strongly typed
- Themes: load thmx files or modify the current theme
Import, export & formats
Move data in and out of worksheets with one line of code.
- Import from collections, arrays, DataSets, DataReaders and text files into formatted tables
- Export to CSV, JSON, HTML/CSS, DataTable, IEnumerable<T> or streams
- Load and save files, streams and byte arrays, with async/await
- External connections and query tables
Показать все функцииПоказать меньше
- Write to a web response stream without file access
- Templates
- Reads and writes xlsx and xlsm. The xlsx Strict format is not supported.
- Reads xltx, crtx and thmx
- Reads and writes txt and csv via LoadFromText and SaveToText
- Power Query, database, OLAP, web and text connections, and pivot tables with an external connection as source
Security & VBA
Protection, encryption, signatures and macros.
- Protect workbooks, worksheets and ranges, or set a workbook to read-only with a password
- Standard and Agile encryption
- Digital signatures, signature lines and stamps
- VBA: create, modify, sign and password protect VBA projects
Показать все функцииПоказать меньше
- Open password protected workbooks
- Standard encryption for older Office versions, Agile for Office 2010 and later
- VBA signatures: Legacy, Agile and V3, with five hash algorithms
Производительность с большими рабочими тетрадями
Рабочая тетрадь объёмом 63 МБ с 200 столбцами и 100 000 строк, где половина ячеек содержит целые числа, а половина — строки по 36 символов.
EPPlus 8.7.2, Intel Core i9-12900HK (14 cores, 2.5 GHz), 64 GB RAM, NVMe SSD, Windows 11, .NET 10
Просмотр исходного кода тестаГотовы начать?
A battle-hardened codebase after many years as the world's most downloaded .NET library for spreadsheets, with quality ensured by thousands of unit tests.
The source code for EPPlus is openly available on GitHub , distributed under the Polyform Noncommercial license.
См. эту страницу с добавленными функциями в библиотеку начиная с версии 5 и выше.