PicoXLSX 2.11.1
See the version list below for details.
dotnet add package PicoXLSX --version 2.11.1
NuGet\Install-Package PicoXLSX -Version 2.11.1
<PackageReference Include="PicoXLSX" Version="2.11.1" />
paket add PicoXLSX --version 2.11.1
#r "nuget: PicoXLSX, 2.11.1"
// Install PicoXLSX as a Cake Addin #addin nuget:?package=PicoXLSX&version=2.11.1 // Install PicoXLSX as a Cake Tool #tool nuget:?package=PicoXLSX&version=2.11.1
PicoXLSX
PicoXLSX is a small .NET library written in C#, to create Microsoft Excel files in the XLSX format (Microsoft Excel 2007 or newer) in an easy and native way
- Minimum of dependencies (*
- No need for an installation of Microsoft Office
- No need for Office interop libraries
- No need for 3rd party libraries
- No need for an installation of the Microsoft Open Office XML SDK (OOXML)
Please have a look at the successor library NanoXLSX for reader support.
Project website: https://picoxlsx.rabanti.ch See the Change Log for recent updates.
What's new in version 2.x
- Complete replacement of the old style handling
- Added asynchronous methods to save workbooks as files or streams
- Added appending of styles for an easier composition of complex styles
- Added more options to assign styles to cells
- Added Shortener (property WS) to reduce the code overhead
- Added static methods for the most important formulas (round, floor, ceil, min, max, average, median, sum, vlookup)
- Added Save option to save the XLSX file as stream
- Added an option for sanitizing of worksheet names
- Replaced specific exception classes with general exceptions (e.g. StyleException, FormatException or WorksheetException)
- Added functions to retrieve stored data and the current cell address
- Added functions to split and freeze worksheets as panes
- Added properties to hide worksheets and workbooks
- Many internal optimizations and additional documentation
Requirements
PicoXLSX was created with .NET version 4.5. Newer versions like 4.6 are working and tested. Furthermore, .NET Standard 2.0 is supported since v2.9. Older versions of.NET like 3.5 and 4.0 may also work with minor changes. Some functions introduced in .NET 4.5 were used and must be adapted in this case.
.NET 4.5 or newer
*)The only requirement to compile the library besides .NET (v4.5 or newer) is the assembly WindowsBase, as well as System.IO.Compression. These assemblies are standard components in all Microsoft Windows systems (except Windows RT systems). If your IDE of choice supports referencing assemblies from the Global Assembly Cache (GAC) of Windows, select WindowsBase and Compression from there. If you want so select the DLLs manually and Microsoft Visual Studio is installed on your system, the DLL of WindowsBase can be found most likely under "c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\WindowsBase.dll", as well as System.IO.Compression under "c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.IO.Compression.dll". Otherwise you find them in the GAC, under "c:\Windows\Microsoft.NET\assembly\GAC_MSIL\WindowsBase" and "c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.IO.Compression"
The NuGet package does not require dependencies
.NET Standard
.NET Standard v2.0 resolves the dependency System.IO.Compression automatically, using NuGet and does not rely anymore on WindowsBase in the development environment. In contrast to the .NET >=4.5 version, no manually added dependencies necessary (as assembly references) to compile the library.
Please note that the demo project of the .NET Standard version will not work in Visual Studio 2017. To get the build working, unload the demo project of the .NET Standard version.
Documentation project
If you want to compile the documentation project (folder: Documentation; project file: shfbproj), you need also the Sandcastle Help File Builder (SHFB). It is also freely available. But you don't need the documentation project to build the NanoXLSX library.
The .NET version of the documentation may vary, based on the installation. If v4.5 is not available, upgrade to target to a newer version, like v4.6
Installation
Using Nuget
By Package Manager (PM):
Install-Package PicoXLSX
By .NET CLI:
dotnet add package PicoXLSX
As DLL
Simply place the PicoXLSX DLL into your .NET project and add a reference to it. Please keep in mind that the .NET version of your solution must match with the runtime version of the PicoXLSX DLL (currently compiled with 4.5 and .NET Standard 2.0).
As source files
Place all .CS files from the PicoXLSX source folder into your project. You can place them into a sub-folder if you wish. The files contains definitions for workbooks, worksheets, cells, styles, meta-data, low level methods and exceptions. In case of the .NET >=4.5 version, the necessary dependencies have to be referenced as well.
Usage
Quick Start (shortened syntax)
Workbook workbook = new Workbook("myWorkbook.xlsx", "Sheet1"); // Create new workbook with a worksheet called Sheet1
workbook.WS.Value("Some Data"); // Add cell A1
workbook.WS.Formula("=A1"); // Add formula to cell B1
workbook.WS.Down(); // Go to row 2
workbook.WS.Value(DateTime.Now, Style.BasicStyles.Bold); // Add formatted value to cell A2
workbook.Save(); // Save the workbook as myWorkbook.xlsx
Quick Start (regular syntax)
Workbook workbook = new Workbook("myWorkbook.xlsx", "Sheet1"); // Create new workbook with a worksheet called Sheet1
workbook.CurrentWorksheet.AddNextCell("Some Data"); // Add cell A1
workbook.CurrentWorksheet.AddNextCell(42); // Add cell B1
workbook.CurrentWorksheet.GoToNextRow(); // Go to row 2
workbook.CurrentWorksheet.AddNextCell(DateTime.Now); // Add cell A2
workbook.Save(); // Save the workbook as myWorkbook.xlsx
Further References
See the full API-Documentation at: https://rabanti-github.github.io/PicoXLSX/.
The Demo project contains 17 simple use cases. You can find also the full documentation in the Documentation-Folder (html files or single chm file) or as C# documentation in the particular .CS files.
See also: Getting started in the Wiki
License
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 | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net45 is compatible. 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. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.5
- No dependencies.
-
.NETStandard 2.0
- System.IO.Packaging (>= 4.7.0)
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 |
---|---|---|
3.3.2 | 53 | 11/24/2024 |
3.3.1 | 275 | 10/25/2024 |
3.3.0 | 1,419 | 7/23/2024 |
3.2.1 | 4,923 | 2/25/2024 |
3.2.0 | 4,318 | 9/7/2023 |
3.1.1 | 11,320 | 8/9/2023 |
3.1.0 | 27,609 | 11/11/2022 |
3.0.2 | 12,239 | 10/4/2022 |
3.0.1 | 407 | 10/1/2022 |
3.0.0 | 1,013 | 9/3/2022 |
2.11.5 | 539 | 8/6/2022 |
2.11.4 | 5,005 | 3/26/2022 |
2.11.3 | 439 | 3/20/2022 |
2.11.2 | 442 | 3/10/2022 |
2.11.1 | 9,784 | 9/12/2021 |
2.11.0 | 16,036 | 7/10/2021 |
2.10.0 | 1,871 | 6/5/2021 |
2.9.0 | 1,494 | 4/18/2021 |
2.8.1 | 2,715 | 12/10/2020 |
2.8.0 | 415 | 12/10/2020 |
2.7.0 | 2,133 | 8/30/2020 |
2.6.6 | 558 | 7/19/2020 |
2.6.5 | 5,897 | 1/12/2020 |
2.6.4 | 1,681 | 5/20/2019 |
2.6.3 | 894 | 12/8/2018 |
2.6.2 | 731 | 11/4/2018 |
2.6.1 | 2,234 | 10/6/2018 |
2.6.0 | 782 | 10/4/2018 |
2.5.1 | 839 | 8/19/2018 |
2.5.0 | 1,765 | 7/2/2018 |
2.4.0 | 979 | 6/6/2018 |
2.3.2 | 1,538 | 5/30/2018 |
2.3.1 | 1,052 | 3/12/2018 |
2.3.0 | 954 | 2/9/2018 |
2.2.0 | 1,105 | 12/10/2017 |
2.1.1 | 1,500 | 12/8/2017 |
Please see https://github.com/rabanti-github/PicoXLSX/blob/master/Changelog.md for the release notes