ExcelXporter 1.0.4

dotnet add package ExcelXporter --version 1.0.4
                    
NuGet\Install-Package ExcelXporter -Version 1.0.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="ExcelXporter" Version="1.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ExcelXporter" Version="1.0.4" />
                    
Directory.Packages.props
<PackageReference Include="ExcelXporter" />
                    
Project file
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 ExcelXporter --version 1.0.4
                    
#r "nuget: ExcelXporter, 1.0.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 ExcelXporter@1.0.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=ExcelXporter&version=1.0.4
                    
Install as a Cake Addin
#tool nuget:?package=ExcelXporter&version=1.0.4
                    
Install as a Cake Tool

Feel free to post any suggestions or log any issue and enjoy exporting.

Just create any model list and pass that to the library and it will generate the excel for you in no time.

✅ What's New 🎨 Header styling with background color, font color, and bold text

📐 Cell alignment (Left, Center, Right)

🖋️ Custom font colors for data cells

📦 Optional borders for all cells with configurable color and style

🧱 Fully customizable via a simple StyleOptions model

-------------------------------------------------------- Sample call if you have a single data list to export:

add namespace on top using ExcelXporter and use below -

    [HttpGet("exportxls")]
    public IActionResult TestExportExcel()
    {
        // these styles are optional and no need to create and pass if not needed
        // default styles will be applied if not passed
        var styleOptions = new StyleOptions
        {
            HeaderStyle = new HeaderStyle
            {
                BackgroundColorHex = "4CAF50",  // Header color
                FontColorHex = "FFFFFF"         // Header font color
            },
            DefaultCellStyle = new ExcelCellStyle
            {
                FontColorHex = "333333",  // Font color
                HorizontalAlignment = TextAlignment.Center  // Alignment
            },
            BorderStyle = new BorderStyle
            {
                ApplyBorders = true,
                BorderColorHex = "000000", // black
                Style = BorderStyleValues.Thin
            }
        };

        List<TestModel> objList = new()
        {
            new TestModel ()
            {
                Id = 1,
                Name = "John",
                Email = "john.doe@gmail.com"
            },
            new TestModel
            {
                Id = 2,
                Name = "Wick",
                Email = "john.wick@gmail.com"
            },
        };
        return objList.ExportToExcel("Output", styleOptions);
    }

--------------------------------------------------------

-------------------------------------------------------- Sample call if you have a multiple data list to export:

add namespace on top using ExcelXporter and use below -

    [HttpGet("exportmultisheetxls")]
    public IActionResult TestExportMultiSheetExcel()
    {
        // these styles are optional and no need to create and pass if not needed
        // default styles will be applied if not passed
        var styleOptions = new StyleOptions
        {
            HeaderStyle = new HeaderStyle
            {
                BackgroundColorHex = "4CAF50",  // Header background color
                FontColorHex = "FFFFFF"         // Header font color
            },
            DefaultCellStyle = new ExcelCellStyle
            {
                FontColorHex = "333333",  // Font color
                HorizontalAlignment = TextAlignment.Center  // Alignment
            },
            BorderStyle = new BorderStyle
            {
                ApplyBorders = true,
                BorderColorHex = "000000", // black
                Style = BorderStyleValues.SlantDashDot
            }
        };

        List<TestModel> objList = new()
        {
            new TestModel ()
            {
                Id = 1,
                Name = "John",
                Email = "john.doe@gmail.com"
            },
            new TestModel
            {
                Id = 2,
                Name = "Wick",
                Email = "john.wick@gmail.com"
            },
        };

        List<dynamic> objList2 = new();
        objList2.Add(objList);
        objList2.Add(Get().ToList());
        return objList2.ExportToExcelMultipleSheets("Output", styleOptions); 
    }

--------------------------------------------------------

Above sample APIs will download excel with single/multiple sheets

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.4 81 7/4/2025
1.0.3 242 1/8/2024
1.0.2 208 11/29/2023
1.0.1 150 11/29/2023
1.0.0 156 11/17/2023

* Header styling with background color, font color, and bold text
* Cell alignment (Left, Center, Right)
* Custom font colors for data cells
* Optional borders for all cells with configurable color and style
* Fully customizable via a simple StyleOptions model
* updated readme.