A C library for creating Excel XLSX files.
Find a file
2017-09-16 17:53:29 +01:00
cmake improve cmake file for MSVC 2017-04-20 15:42:54 +10:00
cocoapods Flattened third party include structure. 2016-07-11 23:15:32 +01:00
dev/release Fix const char* for C++ and added tests. 2017-06-25 20:16:36 +01:00
docs Share single license file between docs and src tree. 2017-08-30 01:29:04 +01:00
examples Initial meson build system. 2017-09-16 17:53:29 +01:00
include Initial meson build system. 2017-09-16 17:53:29 +01:00
lib Initial commit 2014-06-08 17:40:59 +01:00
src Initial meson build system. 2017-09-16 17:53:29 +01:00
test Added option to use system minizip in make build. 2017-08-20 11:33:02 +01:00
third_party Initial meson build system. 2017-09-16 17:53:29 +01:00
.drone.yml Test Tea-CI build. 2017-07-31 11:50:58 +01:00
.gitignore Initial meson build system. 2017-09-16 17:53:29 +01:00
.indent.pro Add chart trendlines. 2017-01-29 02:20:06 +00:00
.travis.yml Improve "make install". 2017-08-20 11:48:11 +01:00
appveyor.yml Added integrations for Tea-CI (MinGW, using a MSYS2-like environment, and AppVeyor, an MSVC CI service. 2017-07-10 17:53:18 -07:00
Changes.txt Add homebrew installation to getting started guide. 2017-08-20 23:12:37 +01:00
CMakeLists.txt Fix for modified zconf.h on Gentoo. 2017-08-12 14:50:31 +01:00
CONTRIBUTING.md Renamed new_workbook() to workbook_new(). 2016-01-04 19:48:16 +00:00
libxlsxwriter.podspec Prep for release 0.7.4. 2017-08-20 12:11:42 +01:00
License.txt Share single license file between docs and src tree. 2017-08-30 01:29:04 +01:00
Makefile Improve "make install". 2017-08-20 11:48:11 +01:00
meson.build Initial meson build system. 2017-09-16 17:53:29 +01:00
meson_options.txt Initial meson build system. 2017-09-16 17:53:29 +01:00
Readme.md Prep for release 0.5.9. 2017-01-14 01:01:05 +00:00

libxlsxwriter

Libxlsxwriter: A C library for creating Excel XLSX files.

demo image

The libxlsxwriter library

Libxlsxwriter is a C library that can be used to write text, numbers, formulas and hyperlinks to multiple worksheets in an Excel 2007+ XLSX file.

It supports features such as:

  • 100% compatible Excel XLSX files.
  • Full Excel formatting.
  • Merged cells.
  • Defined names.
  • Autofilters.
  • Charts.
  • Worksheet PNG/JPEG images.
  • Memory optimization mode for writing large files.
  • Source code available on GitHub.
  • FreeBSD license.
  • ANSI C.
  • Works with GCC, Clang, Xcode, MSVC 2015, ICC, TCC, MinGW, MingGW-w64/32.
  • Works on Linux, FreeBSD, OpenBSD, OS X, iOS and Windows. Also works on MSYS/MSYS2 and Cygwin.
  • Compiles for 32 and 64 bit.
  • The only dependency is on zlib.

Here is an example that was used to create the spreadsheet shown above:

#include "xlsxwriter.h"

int main() {

    /* Create a new workbook and add a worksheet. */
    lxw_workbook  *workbook  = workbook_new("demo.xlsx");
    lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);

    /* Add a format. */
    lxw_format *format = workbook_add_format(workbook);

    /* Set the bold property for the format */
    format_set_bold(format);

    /* Change the column width for clarity. */
    worksheet_set_column(worksheet, 0, 0, 20, NULL);

    /* Write some simple text. */
    worksheet_write_string(worksheet, 0, 0, "Hello", NULL);

    /* Text with formatting. */
    worksheet_write_string(worksheet, 1, 0, "World", format);

    /* Writer some numbers. */
    worksheet_write_number(worksheet, 2, 0, 123,     NULL);
    worksheet_write_number(worksheet, 3, 0, 123.456, NULL);

    /* Insert an image. */
    worksheet_insert_image(worksheet, 1, 2, "logo.png");

    workbook_close(workbook);

    return 0;
}

See the full documentation for the getting started guide, a tutorial, the main API documentation and examples.