特点和技术概述

EPPlus,Excel工作簿的.NET引擎

用100%托管的.NET代码创建、阅读、修改和计算Excel工作簿。多种格式的数据导入和导出。无需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");
478
Excel在内置计算引擎中的功能
760,000
每秒写入单元格数
我们的测量方式
74
拥有EPPlus客户的国家
17
多年积极开发,自2009年开源,2020年开始商业化

支持功能

EPPlus 是一个 .NET Framework/.NET Core 库,用于管理 Office Open XML 电子表格,通过 Nuget 分发。请参阅我们的 软件清单页面 ,了解支持的 .NET 框架。EPPlus 完全采用托管代码编写,不依赖其他库,如 Microsoft Excel。

该库的设计考虑了开发者的需求。我们的目标一直是,懂Excel或其他电子表格库的开发者能轻松掌握API。或者——正如有人说的——用智能感知赢得胜利!

Formulas & filters

A built-in calculation engine with no dependency on Excel or any other library, plus filters and slicers.

显示所有功能显示更少
阅读指南: Formulas & filters

Worksheets & ranges

Rows, columns and cells, and everything you do with them.

显示所有功能显示更少
  • 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
  • Named ranges
  • Used range and taking and skipping rows and columns
  • 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
  • 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
阅读指南: Worksheets & ranges

Tables & pivot tables

Formatted tables and pivot tables, including pivot table calculation.

显示所有功能显示更少
阅读指南: Tables & pivot tables

Charts & drawing objects

Charts, shapes, pictures, form controls and other drawing objects.

显示所有功能显示更少
阅读指南: Charts & drawing objects

Styling

Cell styles, conditional formatting and themes.

显示所有功能显示更少
阅读指南: Styling

Import & export data

Move data in and out of worksheets with one line of code.

  • Import from collections, arrays, DataTables, DataReaders and dictionaries
  • Export to CSV, JSON, DataTable or IEnumerable<T>
  • Load and save files, streams and byte arrays, with async/await
  • Read and write CSV and other text files via LoadFromText and SaveToText, also fixed-width
显示所有功能显示更少
  • Attributes on your classes control styling, number formats and formulas when loading collections
  • Fixed-width text files, via LoadFromText and ToText
  • 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
  • External connections and query tables: Power Query, database, OLAP, web and text connections, and pivot tables with an external connection as source
阅读指南: Import & export data

Output formats

Render worksheet content as HTML for web pages, with PDF on the way.

显示所有功能显示更少
阅读指南: Output formats

VBA & protection

Protection, encryption, signatures, sensitivity labels and macros.

显示所有功能显示更少
  • Sensitivity labels via Microsoft Information Protection
  • 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
阅读指南: VBA & protection

使用大型练习册的表现

一本63 MB工作簿,包含200列、10万行,其中一半单元格为整数,另一半为36字符字符串。

EPPlus 8.7.2, Intel Core i9-12900HK (14 cores, 2.5 GHz), 64 GB RAM, NVMe SSD, Windows 11, .NET 10

查看测试源代码
26.2 s
创建工作簿并保存到磁盘
15.7 s
从磁盘加载工作簿

准备好开始了吗?

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及以后库新增的功能。