A C library for creating Excel XLSX files.
Find a file
John McNamara ce9922bf13 Explicitly copy member data from user supplied structs.
Explicitly copy member data from user supplied structs rather
than memcpy() the entire struct to, mainly, avoid garbage
in undocumented or internal fields.

Issue #145.
2018-02-04 10:53:45 +00:00
cmake Forgot to include 'FindMINIZIP' module to find system minizip 2017-10-24 10:47:18 -07:00
cocoapods Fix including xlsxwriter as a CocoaPod on macOS. 2017-10-10 13:16:01 +02:00
dev/release Updated copyright year. 2018-02-03 17:15:35 +00:00
docs Updated copyright year. 2018-02-03 17:15:35 +00:00
examples Add docs for data validation 2017-09-25 00:27:24 +01:00
include Explicitly copy member data from user supplied structs. 2018-02-04 10:53:45 +00:00
lib Initial commit 2014-06-08 17:40:59 +01:00
src Explicitly copy member data from user supplied structs. 2018-02-04 10:53:45 +00:00
test Updated copyright year. 2018-02-03 17:15:35 +00:00
third_party Fix for modified zconf.h on Gentoo. 2017-08-12 02:23:00 +01:00
.drone.yml Bug fixes for CMakeLists and CI for the CMakelists to patch #115 2017-10-19 22:10:59 -07:00
.gitignore Fix col width size in 32bit builds. 2016-06-25 21:10:05 +01:00
.indent.pro Implementation of data validation. 2017-09-23 11:52:18 +01:00
.travis.yml Fix for broken apt-get install. 2017-10-18 21:55:08 +01:00
appveyor.yml Bug fixes for CMakeLists and CI for the CMakelists to patch #115 2017-10-19 22:10:59 -07:00
Changes.txt Prep for release 0.7.5. 2017-09-25 00:49:53 +01:00
CMakeLists.txt Add system minizip support to CMakeLists 2017-10-23 18:21:40 -07:00
CONTRIBUTING.md Renamed new_workbook() to workbook_new(). 2016-01-04 19:48:16 +00:00
libxlsxwriter.podspec Fix including xlsxwriter as a CocoaPod on macOS. 2017-10-10 13:16:01 +02:00
License.txt Updated copyright year. 2018-02-03 17:15:35 +00:00
Makefile Updated copyright year. 2018-02-03 17:15:35 +00:00
Readme.md Add docs for data validation 2017-09-25 00:27:24 +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.
  • 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.