Easy.ExportToExcel
1.0.6
dotnet add package Easy.ExportToExcel --version 1.0.6
NuGet\Install-Package Easy.ExportToExcel -Version 1.0.6
<PackageReference Include="Easy.ExportToExcel" Version="1.0.6" />
paket add Easy.ExportToExcel --version 1.0.6
#r "nuget: Easy.ExportToExcel, 1.0.6"
// Install Easy.ExportToExcel as a Cake Addin
#addin nuget:?package=Easy.ExportToExcel&version=1.0.6
// Install Easy.ExportToExcel as a Cake Tool
#tool nuget:?package=Easy.ExportToExcel&version=1.0.6
Easy.ExportToExcel
A simple C# library to export data to an Excel file
Ever wanted to easily create a real Excel file in C#, from your DataSet, DataTable or List data ? Now you can.
To add this library to your project:
- In Visual Studio, click on "Tools\NuGet Package Manager\Manage NuGet Packages for Solution.."
- Search for "Easy.ExportToExcel"
- Install the package
- By default, this package works "out of the box" for C# WinForms applications.
There are two lines commented-out at the top of the "CreateExcelFile.cs" file. If your application is an ASP.Net Core application, please uncomment the first line. If your application is a regular ASP.Net application, please uncomment the second line.
// #define USING_ASP_NET_CORE // Uncomment this line, if you're using ASP.NET Core 2+
// #define USING_ASP_NET // Uncomment this line, if you're using regular ASP.NET
- In your code, simply add call the
CreateExcelDocument()
function, telling it the name of the Excel file to create, and where your data is stored.
// Step 1: Create a DataSet, and put some sample data in it
DataSet ds = CreateSampleData();
// Step 2: Create the Excel .xlsx file
try
{
string excelFilename = "C:\\Sample.xlsx";
CreateExcelFile.CreateExcelDocument(ds, excelFilename);
}
catch (Exception ex)
{
MessageBox.Show("Couldn't create Excel file.\r\nException: " + ex.Message);
return;
}
You can read more about this project on my CodeProject article.
And you can follow my other work on my Mikes Knowledge Base website.
Mike Gledhill
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. |
.NET Core | netcoreapp3.1 is compatible. |
-
.NETCoreApp 3.1
- DocumentFormat.OpenXml (>= 2.15.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.