支持导入和导出通用库,支持 Dto 导入和导出、模板导出、精美导出和动态导出,支持 Excel、Csv、Word、Pdf 和 Html。
支持导入和导出通用库,支持 Dto 导入和导出、模板导出、精美导出和动态导出,支持 Excel、Csv、Word、Pdf 和 Html。
Import and export general library, support Dto import and export, template export, fancy export and dynamic export, support Excel, Csv, Word, Pdf and Html.
A zero-dependency, streaming, low-allocation Excel I/O engine — built from scratch without EPPlus, ClosedXML, or any third-party Excel library. Supports netstandard2.0 / net6.0 / net8.0 / net10.0. Native IAsyncEnumerable, AOT-friendly.
dotnet add package Magicodes.IE.IO// Zero-config export
Xlsx.Write("/tmp/orders.xlsx", orders);
Xlsx.Write(Response.Body, orders);
var bytes = Xlsx.ToBytes(orders);
// Async streaming write — DB query straight to file
await Xlsx.WriteAsync(stream, dbContext.Orders.AsAsyncEnumerable());For details, see: https://dev.azure.com/xinlaiopencode/Magicodes.IE/_build?definitionId=4&_a=summary
See below for other tutorials or unit tests
See below for update history.
Support various filters to support scenarios such as multi-language, dynamic control column display, etc. For specific usage, see unit test:
Export supports text custom filtering or processing;
Import supports automatic skipping of blank lines in the middle;
Import supports automatically generate import templates based on DTO, and automatically mark required items;
Import supports data drop-down selection, currently only supports enumerated types;
Imported data supports the processing of leading and trailing spaces and intermediate spaces, allowing specific columns to be set;
Import supports automatic template checking, automatic data verification, unified exception handling, and unified error encapsulation, including exceptions, template errors and row data errors;
Support import header position setting, the default is 1;
Support import columns out of order, no need to correspond one to one in order;
Support to import the specified column index, automatic recognition by default;
Exporting Excel supports splitting of Sheets, only need to set the value of [MaxRowNumberOnASheet] of the characteristic [ExporterAttribute]. If it is 0, no splitting is required. See unit test for details;
Support importing into Excel for error marking;
Import supports cutoff column setting, if not set, blank cutoff will be encountered by default;
Support exporting HTML, Word, Pdf, support custom export template; -Export HTML
-Export Word
-Export Pdf, support settings, see the update log for details
-Export receipt
Import supports repeated verification;
Support single data template export, often used to export receipts, credentials and other businesses
Support dynamic column export (based on DataTable), and the Sheet will be split automatically if it exceeds 100W. (Thanks to teacher Zhang Shanyou (https://github.com/xin-lai/Magicodes.IE/pull/8))
Support dynamic/ExpandoObject dynamic column export
… /// <summary>
/// Gender
/// </summary>
[ImporterHeader(Name = "Gender")]
[Required(ErrorMessage = "Gender cannot be empty.")]
[ValueMapping(text: "Male", 0)]
[ValueMapping(text: "Female", 1)]
public Genders Gender { get; set; }……- **The bool type will generate "yes" and "no" data items by default**
- **If custom value mapping has been set, no default options will be generated**Support excel multi-sheet import
Support Excel template export, JSON dynamic export, and support image rendering
The rendering syntax is as follows:
{{Company}} //Cell rendering
{{Table>>BookInfos|RowNo}} //Table rendering start syntax
{{Remark|>>Table}}//Table rendering end syntax
{{Image::ImageUrl?Width=50&Height=120&Alt=404}} //Picture rendering
{{Image::ImageUrl?w=50&h=120&Alt=404}} //Picture rendering
{{Image::ImageUrl?Alt=404}} //Picture rendering
{{Formula::AVERAGE?params=G4:G6}} //Formula rendering
{{Formula::SUM?params=G4:G6&G4}} //Formula renderingCustom pipelines will be supported in the future.
Support Excel import template to generate annotation
Support Excel image import and export
Support multiple entities to export multiple Sheets
Support using some features under the System.ComponentModel.DataAnnotations namespace to control import and export #63
Support the use of custom formatter in ASP.NET Core Web API to export content such as Excel, Pdf, Csv #64
Support export by column, sheet, and additional rows
exporter.Append(list1).SeparateByColumn().Append(list2).ExportAppendData(filePath);For details, see the above tutorial "Magicodes.IE Fancy Export"
[ExporterHeader(Width = 100)]
public DateTime Time3 { get; set; }**Excel export supports HeaderRowIndex. Add the HeaderRowIndex attribute to the ExcelExporterAttribute export attribute class, so that it is convenient to specify the export from the first row when exporting. **
Excel generated import template supports built-in data verification
The support for the built-in data validation can be turned on through the IsInterValidation attribute, and it should be noted that only MaxLengthAttribute, MinLengthAttribute, StringLengthAttribute, and RangeAttribute support the opening operation of the built-in data validation.
Support display operations for input prompts:
This project exists thanks to all the people who contribute. [Contribute].
暂无开放 Issues,或尚未同步最近议题。