The libxlsxwriter library
- Posted by ghaberek (admin) Sep 09, 2015
- 3488 views
I have completed wrapping libxlsxwriter and posted it to The Archive. This does require Euphoria 4.1 with memstruct support. There are a few structure-heavy elements to this library and it was a lot easier to wrap with memstruct instead of the ol' peek 'n' poke method. That being said, if there is enough interest in this library, I can put in some extra effort to make it compatible with Euphoria 4.0 as well. I have provided a Windows 32-bit DLL in the download. Linux users should be able to download the source and make/make install. I can try to provide 64-bit and Linux binaries if requested. Update: Now supports all 32-bit Euhporia! (4.0/4.1) Just add with define MEMSTRUCT before including xlsxwriter.e in your 4.1 in order to use memstructs.
libxlsxwriter
Sample code to create the above spreadsheet:
/* * A simple example of some of the features of the libxlsxwriter library. * * Copyright 2014-2015, John McNamara, jmcnamara@cpan.org * */ include "xlsxwriter.e" procedure main() /* Create a new workbook and add a worksheet. */ atom workbook = new_workbook( "demo.xlsx" ) atom worksheet = workbook_add_worksheet( workbook, NULL ) /* Add a format. */ atom 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 ) end procedure
Get it here: libxlsxwriter.zip (144 KB)
-Greg