A C library for creating Excel XLSX files.
Find a file
2015-12-11 21:10:37 +00:00
dev/release Prep for release 0.2.0. 2015-12-09 23:00:23 +00:00
docs Added images to format documentation. 2015-12-09 22:53:03 +00:00
examples Added docs and extra tests for worksheet_set_selection(). 2015-12-09 21:14:08 +00:00
include Convert shared string table from hash to RB tree. 2015-12-11 21:10:37 +00:00
lib Initial commit 2014-06-08 17:40:59 +01:00
src Convert shared string table from hash to RB tree. 2015-12-11 21:10:37 +00:00
test Added worksheet_right_to_left() function. 2015-12-11 00:12:27 +00:00
third_party/minizip Turned off unused minizip encrypt option. 2015-11-07 23:27:19 +00:00
.gitignore Added release Makefile targets. 2015-12-07 20:29:01 +00:00
.indent.pro Minor code refactoring. 2015-12-07 20:05:52 +00:00
.travis.yml TravisCI config file. 2015-04-16 23:55:17 +01:00
Changes.txt Prep for release 0.2.1. 2015-12-11 00:24:33 +00:00
CONTRIBUTING.md Guidelines for Reporting Bugs and creating Pull Requests. 2015-12-08 00:04:22 +00:00
libxlsxwriter.podspec Prep for release 0.2.1. 2015-12-11 00:24:33 +00:00
LICENSE.txt Updated copyright year. 2015-03-07 16:42:13 +00:00
Makefile Added pod lint to release checks. 2015-12-07 22:53:05 +00:00
Readme.md Minor doc fixes. 2015-12-08 23:04:30 +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.
  • Memory optimisation mode for writing large files.
  • Source code available on GitHub.
  • FreeBSD ref license.
  • ANSI C.
  • Works with GCC 4.x, GCC 5.x, Clang, Xcode, MSVC 2015, ICC and TCC.
  • Works on Linux, FreeBSD, OS X, iOS and Windows.
  • 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.