EPPlus 5




EPPlus 是一个 .NET 框架/.NET 核心库,用于管理 Office Open XML 电子表格,通过Nuget 分发 。版本 5 支持版本 3.5 的 .NET 框架,版本 2.0 的 .NET 核心。它当前是单个 DLL,对任何其他库(如 Microsoft Excel)没有依赖关系。

库的设计考虑到了开发人员。我们的目标一直是,具有 Excel 或任何其他电子表格库知识的开发人员应轻松启动以加快 API 的速度。或者-正如有人说的-说,你告诉胜利的方式!

EPPlus 5 中的新闻


General features

  • Create, read and modify Office Open XML workbooks (xslx and xlsm)
  • Supports both .NET Framework and .NET Core. No difference in feature set between the frameworks.
  • Provides an easy to use, strongly typed, programming interface, which is closely related to the well-known Excel VBA API.
  • Managed code only, no dependencies to Microsoft Excel
  • Battle-hardened codebase after many years as the worlds most downloaded .NET library for managing spreadsheets. Quality ensured by thousands of unit-tests.
  • The source code for EPPlus is openly available on Github , distributed under the Polyform Noncommercial license

Performance (large workbook)

EPPlus 5.3.2 creates the following workbook and writes it to disk in approximately 47 seconds (i7 CPU 1.8 Ghz, 16 GB RAM, SSD, Win10, .NET Core 3.1). It loads the same workbook from disk into an ExcelPackage instance in approximately 32 seconds.

  • 200 columns
  • 100,000 rows
  • 50% of the data written to the cells are integers, 50% are strings with a length of 36 characters
  • Workbook size: 65 Mb

Feature list

  • Workbook
    • Document/Printer settings
  • Worksheets
    • Supports 1,048,576 rows and 16,384 columns
    • Add, remove, re-order, rename, hide/unhide worksheets in a workbook
    • Copy worksheets within a workbook or to another workbook with maintained styling and shifting of addresses/references.
    • Print areas
    • Header/Footer
    • Page breaks
    • Freeze/unfreeze panes
    • Merge cells
    • Autofit columns
    • Altering worksheet properties such as gridlines, tab colors, etc.
  • Cell Ranges
    • Create, modify, delete, hide/unhide cells or entire ranges
    • Sort ranges
    • Insert/delete ranges - depending addresses will be shifted.
    • Copy ranges to a new address with maintained styling and addresses/reference shifting within a workbook or to another workbook.
    • Named ranges
    • The cell store supports IEnumerable, so Cells/Ranges can be queried with Linq
  • Cell Styling
    • Number
    • Alignment
    • Font
    • Fill
    • Border
    • Protection
    • Wrap text, text rotations and more
    • Named Styles
  • Formula calculation
    • Built in calculation engine with no dependency to Excel or any other library
    • Calculate entire workbook, a worksheet or a single range
    • Supports 260 of the most common functions
    • Support for named ranges and the R1C1 format.
    • Add custom functions in runtime
  • Import/export data to and from worksheets
    • Import data into a formatted table from enumerables of objects, arrays, DataSets, DataReaders, text-files, etc., with just one line of code.
    • Export data to csv files, strings or streams with many configuration parameters
  • Supports load and save from/to both files and streams
    • Can create workbooks in a web application and write to the response stream without file access.
    • Get workbook as byte-array
    • Supports async/await
  • Templates
  • Auto filters/Table Filters
    • Create, read, modify, apply and delete filters of the types below:
      • Value filters
      • Date/Time filters
      • Custom filters
      • Top 10 filters
      • Dynamic filters
  • Data validation
    • Create, read, modify, delete Data validations
    • Types of validations supported: Integer (whole in Excel), Decimal, List, Date, Time, Any and Custom.
    • Strongly typed interface for each validation type
  • Conditional Formatting
    • Create, read, modify Conditional formatting
    • 45 types of conditional formatting supported
    • Strongly typed interface for each conditional formatting type
  • Tables
    • 60 predefined styles
    • Support for adding and deleting rows/columns (with shifting)
    • Total row with predefined functions (supported by the built in Formula calculation)
  • Pivot Tables
  • Hyperlinks
  • Comments
    • Create, read, modify and delete comments (in later Excel versions renamed to Notes)
    • Rich-text supported
    • Threaded comments with support for mentions, resolve/re-open threads
  • Shapes
  • Pictures
  • Charts
  • Sparklines
    • Create, read, modify and delete Sparklines
    • Line
    • Column
    • Win/loss
  • Themes
    • Load themes from thmx-files
    • Modify current theme
  • Protection
    • Protect workbooks with password
    • Open protected workbooks with password
    • Protect workbook, worksheets or ranges
  • Encryption
    • Encrypt/decrypt workbooks
    • Supports both Standard (Older office versions) and Agile encryption (Office 2010 and later)
  • VBA
    • Create, read, delete, modify VBA code/modules
    • Sign VBA code with certificates
    • Password protect VBA projects
  • Supported formats
    • Reads and writes xlsx, xlsm
    • Reads xltx, crtx, thmx
    • Reads and writes txt, csv via the LoadFromText and SaveToText methods