Magicodes.IE 2.4 Release with Enhanced Excel Export Features

The latest version 2.4 of Magicodes.IE has been released, incorporating community feedback and continuously improving based on user requirements. Our current release cycle maintains an average of one beta version per week and a stable release monthly. We encourage more developers to contribute by submitting issues and pull requests.

Project repository: https://github.com/dotnetcore/Magicodes.IE

Following our regular process, we have initiated discussions for version 2.5. Refer to the 2.5 milestone discussion for participation.

Key Updates in This Release

Enhanced Enum Value Mapping for Excel Export

Excel export now supports text mapping for enumeration values through the ValueMapping attribute:

[ValueMapping(text: "Small Business Client", 0)]
[ValueMapping(text: "Tier 1", 1)]

Boolean Type Value Mapping Support

Boolean value mapping is now available for more flexible data representation:

[ValueMapping(text: "confirmed", true)]
[ValueMapping(text: "pending", false)]

Dependency Injection Support for Filters

To enable dynamic processing during import/export operations, dependency injection is now supported for filters. In ASP.NET Core applications, register dependencies in the Startup class:

public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
    AppDependencyResolver.Init(app.ApplicationServices);
    services.AddSingleton<IImportResultFilter, ImportResultFilterTest>();
    services.AddSingleton<IImportHeaderFilter, ImportHeaderFilterTest>();
    services.AddSingleton<IExporterHeaderFilter, TestExporterHeaderFilter1>();
}

Key points about filter dependency injection:

  • Injected filter types take precedence over attribute-specified filters
  • Injected filters operate globally across all applicable scenarios
  • Requires version 2.4.0-beta2 or later

Example implementation:

public class CustomExportHeaderFilter : IExporterHeaderFilter
{
    public ExporterHeaderInfo Filter(ExporterHeaderInfo headerInfo)
    {
        if (headerInfo.ExporterHeaderAttribute.IsIgnore)
        {
            headerInfo.ExporterHeaderAttribute.IsIgnore = false;
        }
        return headerInfo;
    }
}

Global Filter Disabling Capability

To disable all filters for specific import/export operations, set the IsDisableAllFilter property to true on import/export attributes.

AutoFit Row Limit Configuration

Added AutoFitMaxRows configuraton to limit automatic column sizing based on row count:

[ExcelExporter(Name = "General Export Test", AutoFitMaxRows = 5000)]

Custom Cell Width Settings

Individual column width control is now available:

[ExporterHeader(Width = 100)]
public DateTime CreationTime { get; set; }

We appreciate your continued support for Magicodes.IE. For detailed release notes, please visit: Release Documentation

Tags: Magicodes.IE Excel Export C# ASP.NET Core Data Export

Posted on Sat, 30 May 2026 22:41:58 +0000 by The_Black_Knight