ExportKit 8.6.4
dotnet add package ExportKit --version 8.6.4
NuGet\Install-Package ExportKit -Version 8.6.4
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ExportKit" Version="8.6.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ExportKit" Version="8.6.4" />
<PackageReference Include="ExportKit" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ExportKit --version 8.6.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ExportKit, 8.6.4"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ExportKit@8.6.4
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ExportKit&version=8.6.4
#tool nuget:?package=ExportKit&version=8.6.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ExportKit
Универсальная библиотека экспорта и импорта данных для .NET 8. Поддерживает 11 форматов. Экспорт одной строкой кода.
Установка
dotnet add package ExportKit
Поддерживаемые форматы
Экспорт (11 форматов)
| Формат | Расширение | Описание |
|---|---|---|
| JSON | .json |
JavaScript Object Notation |
| XML | .xml |
Extensible Markup Language |
| CSV | .csv |
Comma-Separated Values |
| TXT | .txt |
Текстовый файл с разделителями |
| Excel | .xlsx |
Microsoft Excel (через ClosedXML) |
.pdf |
Portable Document Format (через QuestPDF) | |
| HTML | .html |
Веб-страница с таблицей |
| YAML | .yaml |
YAML Ain't Markup Language |
| Markdown | .md |
Таблица в формате Markdown |
| Word | .docx |
Microsoft Word (через DocumentFormat.OpenXml) |
| SQL | .sql |
SQL INSERT-скрипт |
Импорт (7 форматов)
JSON, XML, CSV, TXT, Excel, HTML, YAML.
API
Класс ExportManager
| Метод | Описание |
|---|---|
void Export(DataTable data, string filePath) |
Экспорт DataTable в файл. Формат определяется по расширению. |
void Export(DataTable data, string filePath, params string[] columns) |
Экспорт с выбором конкретных колонок. |
void ExportList<T>(IEnumerable<T> items, string filePath, string? tableName = null) |
Экспорт коллекции объектов в файл. |
void ExportList<T>(IEnumerable<T> items, string filePath, string? tableName, params string[] columns) |
Экспорт коллекции с выбором колонок. |
void ExportMultiple(string filePath, params DataTable[] tables) |
Экспорт нескольких таблиц в один Excel-файл (разные листы). |
byte[] ExportToBytes(DataTable data, string format) |
Экспорт DataTable в массив байтов. |
byte[] ExportToBytes(DataTable data, string format, params string[] columns) |
Экспорт в байты с выбором колонок. |
byte[] ExportListToBytes<T>(IEnumerable<T> items, string format, string? tableName = null) |
Экспорт коллекции в массив байтов. |
byte[] ExportMultipleToBytes(string format, params DataTable[] tables) |
Экспорт нескольких таблиц в байты. |
DataTable Import(string filePath) |
Импорт файла в DataTable. Формат определяется по расширению. |
DataTable ToDataTable<T>(IEnumerable<T> items, string? tableName = null) |
Преобразование коллекции объектов в DataTable. |
Свойства
| Свойство | Описание |
|---|---|
IReadOnlyList<IDataExporter> Exporters |
Список всех зарегистрированных экспортеров |
IReadOnlyList<IDataImporter> Importers |
Список всех зарегистрированных импортеров |
string ExportFilter |
Фильтр для SaveFileDialog (все форматы экспорта) |
string ImportFilter |
Фильтр для OpenFileDialog (все форматы импорта) |
Примеры
Пример 1: Экспорт списка сотрудников в Excel
using UniversalExport;
var employees = db.Employees.ToList();
ExportManager.ExportList(employees, "employees.xlsx");
Пример 2: Экспорт с диалогом выбора формата
var sfd = new SaveFileDialog { Filter = ExportManager.ExportFilter };
if (sfd.ShowDialog() == DialogResult.OK)
{
var data = ExportManager.ToDataTable(db.Orders.ToList(), "Заказы");
ExportManager.Export(data, sfd.FileName);
}
Пример 3: Несколько таблиц в один Excel + экспорт выбранных колонок
// Несколько листов в одном файле
var employees = ExportManager.ToDataTable(db.Employees.ToList(), "Сотрудники");
var departments = ExportManager.ToDataTable(db.Departments.ToList(), "Отделы");
ExportManager.ExportMultiple("report.xlsx", employees, departments);
// Только нужные колонки
ExportManager.ExportList(db.Employees.ToList(), "names.csv", null, "FullName", "Email", "Phone");
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- ClosedXML (>= 0.105.0)
- DocumentFormat.OpenXml (>= 3.5.1)
- QuestPDF (>= 2026.2.4)
- YamlDotNet (>= 17.0.1)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on ExportKit:
| Package | Downloads |
|---|---|
|
ISBuilder
Information System Builder — full toolkit for building .NET 8 WinForms applications with EF Core, SQL Server. Export, CRUD, forms, charts, auth, reports, validation, themes. |
|
|
AppBuilderKit
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 8.6.4 | 141 | 4/12/2026 |