EPPlus, le moteur .NET pour les cahiers Excel
Créer, lire, modifier et calculer des cahiers Excel en code .NET 100 % géré. Importer et exporter des données dans de nombreux formats. Aucun Microsoft Excel requis.
// 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");
Caractéristiques prises en charge
EPPlus est une bibliothèque .NET Framework/.NET Core pour gérer les tableaux Office Open XML , distribués via Nuget . Consultez notre page Lettre de connaissances logicielles pour les frameworks .NET pris en charge. EPPlus est entièrement écrit en code managé et ne dépend d’aucune autre bibliothèque comme Microsoft Excel.
La bibliothèque est conçue en pensant au développeur. Notre objectif a toujours été qu’un développeur connaissant Excel ou toute autre bibliothèque de feuilles de calcul puisse facilement se mettre à jour avec l’API. Ou – comme quelqu’un l’a dit – intellise ta façon de gagner !
Formulas & filters
A built-in calculation engine with no dependency on Excel or any other library, plus filters and slicers.
- 478 Excel functions
- Dynamic array formulas with spill ranges, and legacy array formulas
- LAMBDA and LET, including recursion and LAMBDAs as defined names
- Filters and slicers on ranges, tables and pivot tables
Afficher toutes les fonctionnalitésAfficher moins
- Add your own functions at runtime
- Cancel a running calculation, and log the calculation to troubleshoot formulas
- Precision as displayed: numeric values are rounded according to the number format
- Table references, named ranges and the R1C1 format
- Trim reference operators
- Regression analysis functions
- Circular references
- External workbooks: update the cache, add references or break links, or calculate the external workbook
- Security controls for calculating workbooks from external sources
- Value, date/time, custom, top 10 and dynamic filters
- 14 built-in slicer styles, and custom slicer styles
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
Afficher toutes les fonctionnalitésAfficher moins
- 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
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
- Create pivot tables with row, column, page and data fields, grouping and calculated fields
- Pivot table calculation and GETPIVOTDATA
Afficher toutes les fonctionnalitésAfficher moins
- Table filters and slicers
- Work with table data rows
- 12 data field functions, and Show Values As
- Export tables to DataTable, JSON, HTML/CSS or IEnumerable<T>
- Expand and collapse pivot table items
- Pivot table sorting
- Styling with pivot areas, and custom pivot table styles
- Pivot table filters and slicers
Charts & drawing objects
Charts, shapes, pictures, form controls and other drawing objects.
- All Excel 2019 chart types, with strongly typed classes per type
- Modern chart styles and chart templates (crtx)
- 187 shape types with text, fills, gradients, effects and shadows
- Pictures and in-cell pictures, also via the IMAGE function
Afficher toutes les fonctionnalitésAfficher moins
- Line, column and win/loss sparklines
- Nine form control types, linked to cells or VBA macros
- OLE objects, linked or embedded, with custom icons
- Copy drawings within and between worksheets
- Picture formats: jpg, gif, png, tiff, bmp, emf, wmf, svg, ico and webp, from files, streams or byte arrays
- In-cell pictures with alt text, or marked as decorative
- Chart samples
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
Afficher toutes les fonctionnalitésAfficher moins
- Custom named table and slicer styles
- Formatted cell text via the ExcelRange.Text property
- Color scales, icon sets, custom icon sets and data bars
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
Afficher toutes les fonctionnalitésAfficher moins
- 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
Output formats
Render worksheet content as HTML for web pages, with PDF on the way.
- Export ranges and tables to HTML and CSS, with conditional formatting, icon sets and data bars
- Settings for styling, pictures and hyperlinks, and data attributes for use in web apps
- Accessible HTML output
- Save workbooks as PDF Preview in EPPlus 9
Afficher toutes les fonctionnalitésAfficher moins
- Fonts: configure fonts and font fallbacks
- PDF page setup Preview in EPPlus 9
VBA & protection
Protection, encryption, signatures, sensitivity labels 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
Afficher toutes les fonctionnalitésAfficher moins
- 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
Performance avec de grands cahiers d’exercices
Un cahier d’exercices de 63 Mo avec 200 colonnes et 100 000 lignes, où la moitié des cellules contient des entiers et l’autre moitié des chaînes de 36 caractères.
EPPlus 8.7.2, Intel Core i9-12900HK (14 cores, 2.5 GHz), 64 GB RAM, NVMe SSD, Windows 11, .NET 10
Consultez le code source du testPrêt à commencer ?
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.
Consultez cette page pour les fonctionnalités ajoutées à la bibliothèque à partir de la version 5.