Winnovative.ExcelLib
11.0.0
Prefix Reserved
dotnet add package Winnovative.ExcelLib --version 11.0.0
NuGet\Install-Package Winnovative.ExcelLib -Version 11.0.0
<PackageReference Include="Winnovative.ExcelLib" Version="11.0.0" />
paket add Winnovative.ExcelLib --version 11.0.0
#r "nuget: Winnovative.ExcelLib, 11.0.0"
// Install Winnovative.ExcelLib as a Cake Addin #addin nuget:?package=Winnovative.ExcelLib&version=11.0.0 // Install Winnovative.ExcelLib as a Cake Tool #tool nuget:?package=Winnovative.ExcelLib&version=11.0.0
Winnovative Excel Library for .NET
Excel Library for .NET | Excel to PDF for .NET | Free Trial | Licensing | Support
Winnovative Excel Library for .NET can be easily integrated in your applications targeting the .NET Framework to create new Excel documents or to edit existing Excel documents.
This version of the library is compatible with .NET Framework on Windows platforms.
For .NET Core and .NET Standard applications on Windows you can use the library from Winnovative.ExcelLib.NetCore NuGet package.
Main Features
- Does not depend on Microsoft Office Excel
- Create new Excel documents or edit existing Excel documents
- Support for Excel 97-2003 (.xls), Excel 2007 and 2010 (.xlsx) formats
- Load a workbook from a stream or from a file
- Save a workbook to a stream or to a file
- Load data from CSV files and save data to CSV format
- Load data from a .NET DataTable or save data to a DataTable object
- Add chart shapes or chart worksheets to a workbook
- Add formulas and array formulas to a worksheet
- Add global styles to a workbook
- Advanced support for Excel 2007 and 2010 gradients and textures
- Add named ranges at worksheet or workbook level
- Add images to a worksheet
- Add hyperlinks and comments to a worksheet
- Support for data validation
- Support for workbook windows and structure protection
- Support for worksheet data protection
- ead and write password protection for .xls workbooks
- Support for worksheet page setup - headers, footers, size, margins, orientation
- Support for workbook properties - author, subject, comments
Compatibility
Winnovative Excel Library for .NET is compatible with Windows platforms which support .NET Framework 4.0 and above, including:
- .NET Framework 4.8.1, 4.7.2, 4.6.1, 4.0 (and above)
- Windows 32-bit (x86) and 64-bit (x64)
- Azure Cloud Services and Azure Virtual Machines
- Web, Console and Desktop applications
Getting Started
After the reference to library was added to your project you are now ready to start writing code to create and edit Excel documents in your .NET application. You can copy the C# code lines from the section below to create an Excel document and save it to a memory buffer for further processing, to an Excel file or send it to browser for download in ASP.NET applications.
C# Code Samples
At the top of your C# source file add the using Winnovative.ExcelLib;
statement to make available the Winnovative Excel Library API for your .NET application.
// add this using statement at the top of your C# file
using Winnovative.ExcelLib;
To create an Excel workbook and save it in an Excel file you can use the C# code below.
// Create an Excel 2007 (.xlsx) workbook
ExcelWorkbookFormat workbookFormat = ExcelWorkbookFormat.Xlsx_2007;
// use the code below instead to create an Excel 97-2003 (.xls) workbook
//ExcelWorkbookFormat workbookFormat = ExcelWorkbookFormat.Xls_2003;
// create the workbook in the desired format with a single worksheet
ExcelWorkbook workbook = new ExcelWorkbook(workbookFormat);
// get the first worksheet in the workbook
ExcelWorksheet worksheet = workbook.Worksheets[0];
// add a style to workbook
ExcelCellStyle helloWorldStyle = workbook.Styles.AddStyle("HelloWorldStyle");
helloWorldStyle.Alignment.HorizontalAlignment = ExcelCellHorizontalAlignmentType.Left;
helloWorldStyle.Alignment.VerticalAlignment = ExcelCellVerticalAlignmentType.Center;
helloWorldStyle.Font.Size = 14;
helloWorldStyle.Font.Bold = true;
// add a text to worksheet using the created style
worksheet["A1"].Text = "Hello World from Winnovative !!!";
worksheet["A1"].Style = helloWorldStyle;
worksheet["A1"].Style.Font.Color = Color.Blue;
worksheet["A1"].RowHeightInPoints = 19.5;
// autofit the Hello World text column
worksheet.AutofitColumn(1);
if (workbookFormat == ExcelWorkbookFormat.Xlsx_2007)
{
// the workbook is saved in Excel 2007 (.xlsx) format
workbook.Save("GettingStarted.xlsx");
}
else if (workbookFormat == ExcelWorkbookFormat.Xls_2003)
{
// the workbook is saved in Excel 97-2003 (.xls) format
workbook.Save("GettingStarted.xls");
}
// close the workbook
workbook.Close();
To create an Excel workbook and save it in a memory buffer and then save it to a file you can use the C# code below.
// Create an Excel 2007 (.xlsx) workbook
ExcelWorkbookFormat workbookFormat = ExcelWorkbookFormat.Xlsx_2007;
// use the code below instead to create an Excel 97-2003 (.xls) workbook
//ExcelWorkbookFormat workbookFormat = ExcelWorkbookFormat.Xls_2003;
// create the workbook in the desired format with a single worksheet
ExcelWorkbook workbook = new ExcelWorkbook(workbookFormat);
// get the first worksheet in the workbook
ExcelWorksheet worksheet = workbook.Worksheets[0];
// add a style to workbook
ExcelCellStyle helloWorldStyle = workbook.Styles.AddStyle("HelloWorldStyle");
helloWorldStyle.Alignment.HorizontalAlignment = ExcelCellHorizontalAlignmentType.Left;
helloWorldStyle.Alignment.VerticalAlignment = ExcelCellVerticalAlignmentType.Center;
helloWorldStyle.Font.Size = 14;
helloWorldStyle.Font.Bold = true;
// add a text to worksheet using the created style
worksheet["A1"].Text = "Hello World from Winnovative !!!";
worksheet["A1"].Style = helloWorldStyle;
worksheet["A1"].Style.Font.Color = Color.Blue;
worksheet["A1"].RowHeightInPoints = 19.5;
// autofit the Hello World text column
worksheet.AutofitColumn(1);
// save the workbook in a memory buffer
byte[] excelDocumentBuffer = workbook.Save();
// close the workbook
workbook.Close();
if (workbookFormat == ExcelWorkbookFormat.Xlsx_2007)
{
// save the memory buffer in an Excel 2007 (.xlsx) format file
System.IO.File.WriteAllBytes("GettingStarted.xlsx", excelDocumentBuffer);
}
else if (workbookFormat == ExcelWorkbookFormat.Xls_2003)
{
// save the memory buffer in Excel 97-2003 (.xls) format file
System.IO.File.WriteAllBytes("GettingStarted.xls", excelDocumentBuffer);
}
To create in your ASP.NET MVC applications an Excel document in a memory buffer and then send it for download to browser you can use the C# code below.
// Create an Excel 2007 (.xlsx) workbook
ExcelWorkbookFormat workbookFormat = ExcelWorkbookFormat.Xlsx_2007;
// use the code below instead to create an Excel 97-2003 (.xls) workbook
//ExcelWorkbookFormat workbookFormat = ExcelWorkbookFormat.Xls_2003;
// create the workbook in the desired format with a single worksheet
ExcelWorkbook workbook = new ExcelWorkbook(workbookFormat);
// get the first worksheet in the workbook
ExcelWorksheet worksheet = workbook.Worksheets[0];
// add a style to workbook
ExcelCellStyle helloWorldStyle = workbook.Styles.AddStyle("HelloWorldStyle");
helloWorldStyle.Alignment.HorizontalAlignment = ExcelCellHorizontalAlignmentType.Left;
helloWorldStyle.Alignment.VerticalAlignment = ExcelCellVerticalAlignmentType.Center;
helloWorldStyle.Font.Size = 14;
helloWorldStyle.Font.Bold = true;
// add a text to worksheet using the created style
worksheet["A1"].Text = "Hello World from Winnovative !!!";
worksheet["A1"].Style = helloWorldStyle;
worksheet["A1"].Style.Font.Color = Color.Blue;
worksheet["A1"].RowHeightInPoints = 19.5;
// autofit the Hello World text column
worksheet.AutofitColumn(1);
// save the workbook in a memory buffer
byte[] excelDocumentBuffer = workbook.Save();
// close the workbook
workbook.Close();
FileResult fileResult = null;
if (workbookFormat == ExcelWorkbookFormat.Xlsx_2007)
{
fileResult = new FileContentResult(excelDocumentBuffer,
"Application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
fileResult.FileDownloadName = "GettingStarted.xlsx";
}
else if (workbookFormat == ExcelWorkbookFormat.Xls_2003)
{
fileResult = new FileContentResult(excelDocumentBuffer,
"Application/x-msexcel");
fileResult.FileDownloadName = "GettingStarted.xls";
}
return fileResult;
To create in your ASP.NET Web Forms application an Excel document in a memory buffer and then send it for download to browser you can use the C# code below.
// Create an Excel 2007 (.xlsx) workbook
ExcelWorkbookFormat workbookFormat = ExcelWorkbookFormat.Xlsx_2007;
// use the code below instead to create an Excel 97-2003 (.xls) workbook
//ExcelWorkbookFormat workbookFormat = ExcelWorkbookFormat.Xls_2003;
// create the workbook in the desired format with a single worksheet
ExcelWorkbook workbook = new ExcelWorkbook(workbookFormat);
// get the first worksheet in the workbook
ExcelWorksheet worksheet = workbook.Worksheets[0];
// add a style to workbook
ExcelCellStyle helloWorldStyle = workbook.Styles.AddStyle("HelloWorldStyle");
helloWorldStyle.Alignment.HorizontalAlignment = ExcelCellHorizontalAlignmentType.Left;
helloWorldStyle.Alignment.VerticalAlignment = ExcelCellVerticalAlignmentType.Center;
helloWorldStyle.Font.Size = 14;
helloWorldStyle.Font.Bold = true;
// add a text to worksheet using the created style
worksheet["A1"].Text = "Hello World from Winnovative !!!";
worksheet["A1"].Style = helloWorldStyle;
worksheet["A1"].Style.Font.Color = Color.Blue;
worksheet["A1"].RowHeightInPoints = 19.5;
// autofit the Hello World text column
worksheet.AutofitColumn(1);
// save the workbook in a memory buffer
byte[] excelDocumentBuffer = workbook.Save();
// close the workbook
workbook.Close();
HttpResponse httpResponse = HttpContext.Current.Response;
if (workbookFormat == ExcelWorkbookFormat.Xlsx_2007)
{
httpResponse.AddHeader("Content-Type",
"Application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
httpResponse.AddHeader("Content-Disposition",
String.Format("attachment; filename=GettingStarted.xlsx; size={0}",
excelDocumentBuffer.Length.ToString()));
}
else if (workbookFormat == ExcelWorkbookFormat.Xls_2003)
{
httpResponse.AddHeader("Content-Type",
"Application/x-msexcel");
httpResponse.AddHeader("Content-Disposition",
String.Format("attachment; filename=GettingStarted.xls; size={0}",
excelDocumentBuffer.Length.ToString()));
}
httpResponse.BinaryWrite(excelDocumentBuffer);
httpResponse.End();
Free Trial
You can download the full Winnovative Excel Library for .NET Framework package from Winnovative Software Downloads page of the website.
The package for .NET Framework contains the product binaries, demo Visual Studio projects with full C# code for ASP.NET Web Forms and Windows Forms targeting .NET Framework 4 and later versions, the library documentation in CHM format.
You can evaluate the library for free as long as it is needed to ensure that the solution fits your application needs.
Licensing
The Winnovative Software licenses are perpetual which means they never expire for a version of the product and include free maintenance for the first year. You can find more details about licensing on website.
Support
For technical and sales questions or for general inquiries about our software and company you can contact us using the email addresses from the contact page of the website.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net40 is compatible. net403 was computed. net45 was computed. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
This package has no dependencies.
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 |
---|---|---|
11.0.0 | 101 | 10/14/2024 |