A C library for creating Excel XLSX files.
Find a file
John McNamara f111c60ff7 Fix for format ordering
Fix format objects so that they are written to the file in the
order of used rather than the order the of creation. This bug
caused incorrect formats in cells.

Issue #3
2015-03-01 12:36:59 +00:00
dev/release Added constant_memory mode. 2014-06-26 00:49:41 +01:00
docs Changes for new ctest framework. 2014-08-08 00:37:42 +01:00
examples Added constant_memory mode. 2014-06-26 00:49:41 +01:00
include Fix for format ordering 2015-03-01 12:36:59 +00:00
lib Initial commit 2014-06-08 17:40:59 +01:00
src Fix for format ordering 2015-03-01 12:36:59 +00:00
test Fix for format ordering 2015-03-01 12:36:59 +00:00
third_party/minizip Initial commit 2014-06-08 17:40:59 +01:00
.gitignore Changes for new ctest framework. 2014-08-08 00:37:42 +01:00
.indent.pro Fix handling of NULL strings to the write() functions. 2014-06-27 20:20:38 +01:00
.travis.yml TravisCI config file. 2014-08-08 00:45:56 +01:00
Changes.txt Prep for release 0.0.3. 2015-01-07 00:13:40 +00:00
LICENSE.txt Initial commit 2014-06-08 17:40:59 +01:00
Makefile Updated coverity version. 2015-02-23 23:47:54 +00:00
Readme.md Minor doc fix. 2014-06-26 01:20:30 +01:00

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 and formulas to multiple worksheets in an Excel 2007+ XLSX file.

It supports features such as:

  • 100% compatible Excel XLSX files
  • Full Excel formatting
  • Memory optimisation mode for writing large files
  • Source code available on GitHub
  • FreeBSD license
  • ANSI C
  • Works with GCC 4.4, 4.6, 4.7, 4.8, tcc and clang
  • Works on Linux, FreeBSD and OS X.
  • 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  = new_workbook("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);

    /* Widen the first column to make the text clearer. */
    worksheet_set_column(worksheet, 0, 0, 20, NULL, 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);

    workbook_close(workbook);

    return 0;
}

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