Page 1 of 1

libxlsxwriter

Posted: Sun Dec 03, 2023 11:47 am
by the.weavster
I understand PB 6.10 is going to be a feature release and so I'd like to propose the addition of libxlsxwriter.

Databases need reports and I think this would be a good step in that direction.

Re: libxlsxwriter

Posted: Sun Dec 03, 2023 12:29 pm
by Little John
We know that XLS and XLSX are proprietary file formats by Microsoft.
Wouldn't it be better for PureBasic to support spreadsheets according to the Open Document standard? Just an idea.

Re: libxlsxwriter

Posted: Sun Dec 03, 2023 4:13 pm
by the.weavster
Little John wrote: Sun Dec 03, 2023 12:29 pm We know that XLS and XLSX are proprietary file formats by Microsoft.
The XLSX format was developed by Microsoft but I believe it's now an open standard ( ECMA-376, ISO/IEC 29500 ) and covered by Microsoft's Open Specification Promise.

Trying to come up with something as functional as XLSXWriter for the ODF format would be a lot more work than incorporating an existing, well tested library.

Re: libxlsxwriter

Posted: Mon Jan 27, 2025 10:48 am
by the.weavster
Bump
I still think this would be a cool feature for those of us that do business applications 8)

The library is written in ANSI C, the license is FreeBSD and the only dependency is zlib.

Re: libxlsxwriter

Posted: Mon Jan 27, 2025 11:13 am
by Caronte3D
+1

Re: libxlsxwriter

Posted: Mon Jan 27, 2025 11:51 am
by Fred
This one is too specific for PB IMHO, but it seems very easy to wrap. You just need to build the lib with cmake and do the import files.

Re: libxlsxwriter

Posted: Wed Jan 29, 2025 1:16 am
by Justin
This can be useful, so i compiled the static libs for mac, win and linux.

I imported a few functions to test, it works on the 3 platfroms creating an standalone executable. I don't have the time now to translate all the headers but it should be simple.

To install it simply copy the corresponding static libs for the OS to the PureLibraries\UserLibraries folder in every purebasic installation.
Or compile them by yourself, the libs to copy are: libxlsxwriter, libminzip and libz

Run the example xlsxwriter_test.pb, this will create a basic xlsx file.
Only for 64 bit for now.

Project at github:
https://github.com/omegakode/PBXlsxWriter

Re: libxlsxwriter

Posted: Wed Jan 29, 2025 2:29 am
by jack
I had a look at the libxlsxwriter project, the project builds quickly and without any warnings or errors using msys2
but some of the headers are a bit complex

Re: libxlsxwriter

Posted: Wed Jan 29, 2025 9:33 am
by Justin
After looking at it the most complex part will be the macros from sys/queue.h and sys/tree.h, but definitely doable. The rest are normal structs and enums.

Re: libxlsxwriter

Posted: Wed Jan 29, 2025 1:34 pm
by the.weavster
Justin wrote: Wed Jan 29, 2025 1:16 am To install it simply copy the corresponding static libs for the OS to the PureLibraries\UserLibraries folder in every purebasic installation.
Or compile them by yourself, the libs to copy are: libxlsxwriter, libminzip and libz

Run the example xlsxwriter_test.pb, this will create a basic xlsx file.
Only for 64 bit for now.

Project at github:
https://github.com/omegakode/PBXlsxWriter
Thanks, Justin :D
This is really helpful.

Re: libxlsxwriter

Posted: Wed Jan 29, 2025 2:34 pm
by Quin
Justin wrote: Wed Jan 29, 2025 1:16 am This can be useful, so i compiled the static libs for mac, win and linux.

I imported a few functions to test, it works on the 3 platfroms creating an standalone executable. I don't have the time now to translate all the headers but it should be simple.

To install it simply copy the corresponding static libs for the OS to the PureLibraries\UserLibraries folder in every purebasic installation.
Or compile them by yourself, the libs to copy are: libxlsxwriter, libminzip and libz

Run the example xlsxwriter_test.pb, this will create a basic xlsx file.
Only for 64 bit for now.

Project at github:
https://github.com/omegakode/PBXlsxWriter
Managed to get it to work on Windows 10 21H2 IoT. Well done!