A C library for creating Excel XLSX files.
Find a file
John McNamara 110af3ff4d Fix for ignored position in chart custom data labels.
Fix issue where custom chart data labels didn't inherit the position
for the data labels in the series.`
2020-10-02 20:44:38 +01:00
.github Update FUNDING.yml 2020-06-12 10:06:13 +01:00
cmake Remove FindZLIB.cmake 2019-06-07 00:08:31 +01:00
cocoapods Prep for release 0.9.2. 2020-01-13 22:56:00 +00:00
dev/release Added docs for diagonal cell borders. 2020-09-12 20:47:59 +01:00
docs Added docs for diagonal cell borders. 2020-09-12 20:47:59 +01:00
examples Added docs for diagonal cell borders. 2020-09-12 20:47:59 +01:00
include Fix for issue where zipfile isn't close when there is a file add error. 2020-09-25 19:28:29 +01:00
lib Initial commit 2014-06-08 17:40:59 +01:00
src Fix for ignored position in chart custom data labels. 2020-10-02 20:44:38 +01:00
test Fix for ignored position in chart custom data labels. 2020-10-02 20:44:38 +01:00
third_party Renamed MD5 functions and struct to avoid conflict with openssl. 2020-01-07 23:45:34 +00:00
.gitignore Added docs for header/footer images. 2020-08-17 23:03:25 +01:00
.indent.pro Added support for conditional formatting. 2020-08-30 21:06:48 +01:00
.travis.yml Add image buffers without a temporary file 2020-05-08 13:48:12 +01:00
Changes.txt Prep for release 1.0.0. 2020-09-08 00:11:51 +01:00
CMakeLists.txt Add image buffers without a temporary file 2020-05-08 13:48:12 +01:00
CONTRIBUTING.md Add docs for lxw_version(). 2018-09-01 20:26:34 +01:00
libxlsxwriter.podspec Prep for release 1.0.0. 2020-09-08 00:11:51 +01:00
License.txt Updated copyright year. 2020-01-12 12:59:31 +00:00
Makefile Add makefile target to publish docs externally. 2020-09-08 09:39:02 +01:00
Readme.md Added docs for conditional formatting. 2020-09-05 21:17:39 +01: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.
  • Data validation and drop down lists.
  • Conditional formatting.
  • Worksheet PNG/JPEG images.
  • Cell comments.
  • Support for adding Macros.
  • 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.
  • Compiles and works on big and little endian systems.
  • 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);

    /* Write 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.