1. The libxlsxwriter library
- Posted by ghaberek (admin) Sep 09, 2015
- 3489 views
- Last edited Sep 11, 2015
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
2. Re: The libxlsxwriter library
- Posted by andi49 Sep 10, 2015
- 3447 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.
[...]
-Greg
A really big THANK YOU!
But memstructs (as much as i like them) are not on the roadmap for Eu4.1, as far as i know.
There is not even a Beta release or something.
For myself, i need a stable base. Also i mostly write 'throw away code' (means code that is used once ore twice to solve a special problem).
So i would prefer a 4.0 or a 4.1 (more the 4.0) version.
(from the Windows side, a 32bit Watcom binary works nice from XP to Win10, on both 32bit and 64bit hosts).
For sure, this is up to you.
Andreas
3. Re: The libxlsxwriter library
- Posted by ghaberek (admin) Sep 10, 2015
- 3395 views
So i would prefer a 4.0 or a 4.1 (more the 4.0) version.
This won't really be too difficult; it will just take more time. Bear with me and I'll have it ready soon.
(from the Windows side, a 32bit Watcom binary works nice from XP to Win10, on both 32bit and 64bit hosts).
The Euphoria developers don't really support OpenWatcom any more AFAIK. I built this with 32-bit TDM-GCC 4.8.1 (aka MinGW).
-Greg
4. Re: The libxlsxwriter library
- Posted by xecronix Sep 11, 2015
- 3336 views
But memstructs (as much as i like them) are not on the roadmap for Eu4.1, as far as i know.
There is not even a Beta release or something.
I think structs are on the EuphoriaRoadmap for 4.1.
5. Re: The libxlsxwriter library
- Posted by ghaberek (admin) Sep 11, 2015
- 3305 views
I think structs are on the EuphoriaRoadmap for 4.1.
I believe Jim said that 4.1 is currently feature-frozen for release without memstruct. So we can more likely expect memstruct in 4.2. (circa 2018?)
-Greg
6. Re: The libxlsxwriter library
- Posted by jimcbrown (admin) Sep 11, 2015
- 3317 views
I think structs are on the EuphoriaRoadmap for 4.1.
I believe Jim said that 4.1 is currently feature-frozen for release without memstruct. So we can more likely expect memstruct in 4.2. (circa 2018?)
-Greg
If there's enough demand, and if Matt's willing to do the merge, I think we could make an exception for this one case.
The reason for the feature freeze was to get 4.1.0 out the door faster, but it doesn't really seem to have helped.
7. Re: The libxlsxwriter library
- Posted by jmduro Sep 11, 2015
- 3334 views
But memstructs (as much as i like them) are not on the roadmap for Eu4.1, as far as i know.
There is not even a Beta release or something.
My Windows 32-bit All-ii-One package uses EU41 with memstruct:
http://rapideuphoria.com/euphoria32_for_win64_with_win32lib_and_wxeuphoria.zip
I tried the libxlswriter library with it and it works.
Regards
Jean-Marc
8. Re: The libxlsxwriter library
- Posted by ghaberek (admin) Sep 11, 2015
- 3396 views
If there's enough demand, and if Matt's willing to do the merge, I think we could make an exception for this one case.
The reason for the feature freeze was to get 4.1.0 out the door faster, but it doesn't really seem to have helped.
That would be swell. This is a good example of how I was able to kick out a wrapper for something much faster using memstruct instead of the "classic" method.
We still have some limitations when it comes to structures (such as passing them on the stack) but this is a big step forward.
My Windows 32-bit All-ii-One package uses EU41 with memstruct:
http://rapideuphoria.com/euphoria32_for_win64_with_win32lib_and_wxeuphoria.zip
I tried the libxlswriter library with it and it works.
Neat! Thanks for testing.
-Greg
9. Re: The libxlsxwriter library
- Posted by ghaberek (admin) Sep 11, 2015
- 3314 views
- Last edited Sep 12, 2015
Updated: added support for non-memstruct Euphoria (4.0, 4.1).
http://www.rapideuphoria.com/libxlsxwriter.zip (145 KB)
-Greg
10. Re: The libxlsxwriter library
- Posted by andi49 Sep 13, 2015
- 3254 views
Updated: added support for non-memstruct Euphoria (4.0, 4.1).
http://www.rapideuphoria.com/libxlsxwriter.zip (145 KB)
-Greg
Hi
it works great using memstruct, but i can't get it to work with eu4.0 maybe a setup problem on my side.
i have not testet with 4.1 without memstruct.
But again THANK YOU. It's really what i needed.
Andreas
11. Re: The libxlsxwriter library
- Posted by ghaberek (admin) Sep 14, 2015
- 3216 views
it works great using memstruct, but i can't get it to work with eu4.0 maybe a setup problem on my side.
i have not testet with 4.1 without memstruct.
Curious. What problem are you having? Maybe I or someone else here can help if you need.
But again THANK YOU. It's really what i needed.
Glad to be of service. I stumbled across this library when I used the Python version for a project at work.
When I found the C library version, I immediately set out to get it wrapped in Euphoria, thinking "I know someone will have a need for this!"
-Greg
12. Re: The libxlsxwriter library
- Posted by andi49 Sep 21, 2015
- 3109 views
it works great using memstruct, but i can't get it to work with eu4.0 maybe a setup problem on my side.
i have not testet with 4.1 without memstruct.
Curious. What problem are you having? Maybe I or someone else here can help if you need.
The Parser seems to crash on dot ntotation even if it is in a ifdef ... end ifdef.
(on EU4.0.6 from the repo compiled with Watcom)
commenting out the lines works. like this:
ifdef MEMSTRUCT then --atom worksheets = workbook.lxw_workbook.worksheets --atom next = worksheets.stailq_head.stqh_first while next != NULL do result = append( result, next ) -- next = next.lxw_worksheet.list_pointers.stqe_next end while elsedef
The same is true for Eu4.1 from the repo (tip) compiled with gcc 4.9.2
Andreas