A C library for creating Excel XLSX files.
Find a file
2015-10-04 02:24:31 +01:00
dev/release Added docs for worksheet_write_url(). 2015-05-05 00:28:30 +01:00
docs Add docs for cocoa pod installer. 2015-09-27 21:12:53 +01:00
examples Added docs for worksheet_write_url(). 2015-05-05 00:28:30 +01:00
include Added better worksheet error returns. 2015-10-04 01:12:30 +01:00
lib Initial commit 2014-06-08 17:40:59 +01:00
src Test mkstemp replacement for tempfile. 2015-10-04 02:24:31 +01:00
test Added better worksheet error returns. 2015-10-04 01:12:30 +01:00
third_party/minizip Fixed cocoa pod lint warnings. 2015-09-27 21:02:03 +01:00
.gitignore Changes for new ctest framework. 2014-08-08 00:37:42 +01:00
.indent.pro Initial restructuring for hyperlinks. 2015-04-19 23:37:29 +01:00
.travis.yml TravisCI config file. 2015-04-16 23:55:17 +01:00
Changes.txt Fix pod spec for iOS and OS X. 2015-09-28 00:25:06 +01:00
libxlsxwriter.podspec Prep for release 0.1.7. 2015-09-28 00:27:05 +01:00
LICENSE.txt Updated copyright year. 2015-03-07 16:42:13 +00:00
Makefile Updated copyright year. 2015-03-07 16:42:13 +00:00
Readme.md Added docs for worksheet_write_url(). 2015-05-05 00:28: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, 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
  • Autofilters
  • Defined names
  • 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, 4.9, Clang, ICC and TCC.
  • Works on Linux, FreeBSD, OS X and iOS.
  • 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.