zlib and struct libraries

Well, I am in very need of these 2 libraries (zlib and struct), I found a similar zlib library that is written in pure lua but it has some limitations and I also found a struct library written in lua but some functions are also missing,

https://github.com/brimworks/lua-zlib

http://www.inf.puc-rio.br/~roberto/struct/

Why do I need these libraries ? Well I am creating a windows program which creates excel files, I use the lua xlsx module and the zlib and struct alternative libraries (that are written in lua only) aren’t compatible with the xlsx module.

my question is can I load these libraries (.dll or .c) using corona ? (will run on windows only)

if not, what can I do ?

Hi Nerox.

Not terribly obvious, I suppose, but I’ve included struct in my serialize plugin. (It’s just that and two other plugins.) I’m afraid I’m no help for zlib , though.

Thanks for the struct plugin I really  appreciate it.

Problem is I still need the  zlib library  in order to fix my problem, If I use corona native will I be able to “just” include (require) the C file in my corona project ?

You definitely cannot just include the C file.  :smiley: If you’re willing to give a DLL a go, see this. You would need to rename luaopen_zlib  to luaopen_plugin_zlib along with some other steps that might be mentioned there.

Curious as to whether you really need to create Excel files at all. Are you just piping out cell data or are you actually creating Excel proprietary elements, like colouring rows in?

If this is just for data then a CSV would be infinitely easier, and is industry standard so can be loaded in to any spreadsheet software, including Excel, and other tools such as CRMs or mailing lists.

To output a CSV you literally just have to pipe out the plain text to a file. Separate the cells using a comma, if the cell content contains a comma wrap it in quotes, and if the quoted text needs to contain a quote just prefix it with another quote. E.g:

Hello,World,“This is, ““my””, data”,Foobar

No need for any additional libs or complex code, and the result will be useful for more people.

I’ve actually thought of CSV but I am not sure if CSV supports formatting (merging cells, bold fonts, coloring cells, etc…)

Also there must be a way that I can do to include zlip, in worst cases I will make a plugin for it myself just as  StarCrunch  suggested, and If I won’t be able to do it I will go for CSV.

There’s no formatting in CSV no, just raw data. If you need formatting then that’s reason to use xlsx.

Hi Nerox.

Not terribly obvious, I suppose, but I’ve included struct in my serialize plugin. (It’s just that and two other plugins.) I’m afraid I’m no help for zlib , though.

Thanks for the struct plugin I really  appreciate it.

Problem is I still need the  zlib library  in order to fix my problem, If I use corona native will I be able to “just” include (require) the C file in my corona project ?

You definitely cannot just include the C file.  :smiley: If you’re willing to give a DLL a go, see this. You would need to rename luaopen_zlib  to luaopen_plugin_zlib along with some other steps that might be mentioned there.

Curious as to whether you really need to create Excel files at all. Are you just piping out cell data or are you actually creating Excel proprietary elements, like colouring rows in?

If this is just for data then a CSV would be infinitely easier, and is industry standard so can be loaded in to any spreadsheet software, including Excel, and other tools such as CRMs or mailing lists.

To output a CSV you literally just have to pipe out the plain text to a file. Separate the cells using a comma, if the cell content contains a comma wrap it in quotes, and if the quoted text needs to contain a quote just prefix it with another quote. E.g:

Hello,World,“This is, ““my””, data”,Foobar

No need for any additional libs or complex code, and the result will be useful for more people.

I’ve actually thought of CSV but I am not sure if CSV supports formatting (merging cells, bold fonts, coloring cells, etc…)

Also there must be a way that I can do to include zlip, in worst cases I will make a plugin for it myself just as  StarCrunch  suggested, and If I won’t be able to do it I will go for CSV.

There’s no formatting in CSV no, just raw data. If you need formatting then that’s reason to use xlsx.