Cross-Platform C++ Library for Excel Spreadsheet
Open Source API allows to Read, Write, Modify & Export Microsoft Excel XLSX Spreadsheet Files via C++ API.
Xlnt is a modern open source C++ library that provides features for manipulating XLSX spreadsheets files. It enables software developers to read and write spreadsheet files from/to XLSX files. On May 10th, 2017 the first public release of Xlnt version 1.0 was available for public use. The recent work mostly focuses on compatibility enhancements and better performance.
The Xlnt library offers functionality for many important features, such as creating Excel-style workbook and numbers-style workbook, encrypted Workbook creation, Excel Binary Workbook, document Properties, hyperlink support, Page Margins, Comments, Cell Styles and many more.
At A Glance
An overview of Xlnt features.
- Excel-style workbook
- numbers-style workbook
- encrypted Workbook
- Page Margins
- Add Comments
- Cell Styles
- Excel Binary Workbook
- Hyperlink support
- Document Properties
- Open spreadsheets
- save spreadsheets
- Read cells
- Add rows
Xlnt supports Excel spreadsheet format as well as it can export data to common file formats.
Xlnt requires C++14 or higher
Getting Started with Xlnt
The following steps update the compiler and set the appropriate environment variables.
Install via APT
sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt update sudo apt-get upgrade sudo apt-get install gcc-6 g++-6 export CC=/usr/bin/gcc-6 export CXX=/usr/bin/g++-6
C++ API to Read from an Existing XLSX Spreadsheet
The open source Xlnt library provides functionality for reading an existing XLSX spreadsheet inside C++ applications. It also allows developers to print the string values to the screen. Moreover, once you read the contents it is also possible to export the contents into a file and store on the location of your choice.
Apply Formatting & Style to Excel Spreadsheet
The Xlnt library enables programmers to apply formatting and styles to their data inside an Excel spreadsheet. A format in Xlnt corresponds to the alignment, border, fill, font, number format, and protection settings applied to a cell. On the other hand, a style is a named style created in the"Cell styles" dropdown in Excel. It needs to have a name and optionally any of alignment, border, fill, font, number format, protection. A cell can have both a format and a style.
Setting Page Margins of a Worksheet
The open source Xlnt enables programmers to apply page margins to an Excel worksheet page inside their own C++ applications. Page margins specify how much blank area should be left around the information in an Excel worksheet. They provide a visual border for users printed pages and an area where the page can be held or bound.