ExcelXporter 1.0.4
dotnet add package ExcelXporter --version 1.0.4
NuGet\Install-Package ExcelXporter -Version 1.0.4
<PackageReference Include="ExcelXporter" Version="1.0.4" />
<PackageVersion Include="ExcelXporter" Version="1.0.4" />
<PackageReference Include="ExcelXporter" />
paket add ExcelXporter --version 1.0.4
#r "nuget: ExcelXporter, 1.0.4"
#:package ExcelXporter@1.0.4
#addin nuget:?package=ExcelXporter&version=1.0.4
#tool nuget:?package=ExcelXporter&version=1.0.4
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 | Versions 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. |
-
net6.0
- AngleSharp (>= 1.0.7)
- DocumentFormat.OpenXml (>= 3.3.0)
- DocumentFormat.OpenXml.Framework (>= 3.3.0)
- Microsoft.AspNetCore.Mvc.Core (>= 2.2.5)
- Microsoft.OpenApi (>= 1.6.24)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
* 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.