paxa / fast_excel Goto Github PK
View Code? Open in Web Editor NEWUltra Fast Excel Writer for Ruby
License: MIT License
Ultra Fast Excel Writer for Ruby
License: MIT License
I have hit the limit of maximum number of URLs. From lib/fast_excel/binding.rb
MAX_NUMBER_URLS = 65530
It looks like this is a libxlswriter limitation. Is there a workaround to this?
If I run the following command:
docker run --rm -it docker.io/library/ruby:3.0.3-bullseye gem install fast_excel
I get the following error as the installer attempts to compile libxlsxwriter/third_party/minizip
.
Fetching fast_excel-0.4.0.gem
Fetching ffi-1.15.4.gem
Building native extensions. This could take a while...
Successfully installed ffi-1.15.4
Building native extensions. This could take a while...
ERROR: Error installing fast_excel:
ERROR: Failed to build gem native extension.
current directory: /usr/local/bundle/gems/fast_excel-0.4.0
/usr/local/bin/ruby -I /usr/local/lib/ruby/3.0.0 -r ./siteconf20220103-1-kw768g.rb extconf.rb
current directory: /usr/local/bundle/gems/fast_excel-0.4.0
make DESTDIR\= clean
make[1]: Entering directory '/usr/local/bundle/gems/fast_excel-0.4.0/libxlsxwriter'
make[2]: Entering directory '/usr/local/bundle/gems/fast_excel-0.4.0/libxlsxwriter/src'
make[2]: Leaving directory '/usr/local/bundle/gems/fast_excel-0.4.0/libxlsxwriter/src'
# @make clean -C test/unit
# @make clean -C test/functional/src
# @make clean -C examples
make[2]: Entering directory '/usr/local/bundle/gems/fast_excel-0.4.0/libxlsxwriter/third_party/minizip'
make[2]: Leaving directory '/usr/local/bundle/gems/fast_excel-0.4.0/libxlsxwriter/third_party/minizip'
make[2]: Entering directory '/usr/local/bundle/gems/fast_excel-0.4.0/libxlsxwriter/third_party/tmpfileplus'
make[2]: Leaving directory '/usr/local/bundle/gems/fast_excel-0.4.0/libxlsxwriter/third_party/tmpfileplus'
make[1]: Leaving directory '/usr/local/bundle/gems/fast_excel-0.4.0/libxlsxwriter'
current directory: /usr/local/bundle/gems/fast_excel-0.4.0
make DESTDIR\=
# @echo "Compiling ext/text_width ..."
# rake compile
Compiling libxlsxwriter ...
make[1]: Entering directory '/usr/local/bundle/gems/fast_excel-0.4.0/libxlsxwriter'
make[2]: Entering directory '/usr/local/bundle/gems/fast_excel-0.4.0/libxlsxwriter/third_party/minizip'
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
In file included from ioapi.h:46,
from ioapi.c:29:
/usr/include/zlib.h:98:5: error: unknown type name ‘alloc_func’
98 | alloc_func zalloc; /* used to allocate the internal state */
| ^~~~~~~~~~
/usr/include/zlib.h:99:5: error: unknown type name ‘free_func’
99 | free_func zfree; /* used to free the internal state */
| ^~~~~~~~~
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
ioapi.h:135:51: note: in expansion of macro ‘OF’
135 | typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode));
| ^~
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
ioapi.h:136:51: note: in expansion of macro ‘OF’
136 | typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size));
| ^~
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
ioapi.h:137:51: note: in expansion of macro ‘OF’
137 | typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
| ^~
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
ioapi.h:138:51: note: in expansion of macro ‘OF’
138 | typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream));
| ^~
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
ioapi.h:139:51: note: in expansion of macro ‘OF’
139 | typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream));
| ^~
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
ioapi.h:141:51: note: in expansion of macro ‘OF’
141 | typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream));
| ^~
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
ioapi.h:142:51: note: in expansion of macro ‘OF’
142 | typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin));
| ^~
In file included from ioapi.c:29:
ioapi.h:148:5: error: unknown type name ‘open_file_func’
148 | open_file_func zopen_file;
| ^~~~~~~~~~~~~~
ioapi.h:149:5: error: unknown type name ‘read_file_func’
149 | read_file_func zread_file;
| ^~~~~~~~~~~~~~
ioapi.h:150:5: error: unknown type name ‘write_file_func’
150 | write_file_func zwrite_file;
| ^~~~~~~~~~~~~~~
ioapi.h:151:5: error: unknown type name ‘tell_file_func’
151 | tell_file_func ztell_file;
| ^~~~~~~~~~~~~~
ioapi.h:152:5: error: unknown type name ‘seek_file_func’
152 | seek_file_func zseek_file;
| ^~~~~~~~~~~~~~
ioapi.h:153:5: error: unknown type name ‘close_file_func’
153 | close_file_func zclose_file;
| ^~~~~~~~~~~~~~~
ioapi.h:154:5: error: unknown type name ‘testerror_file_func’
154 | testerror_file_func zerror_file;
| ^~~~~~~~~~~~~~~~~~~
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
ioapi.h:158:51: note: in expansion of macro ‘OF’
158 | typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream));
| ^~
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
ioapi.h:159:51: note: in expansion of macro ‘OF’
159 | typedef long (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin));
| ^~
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
ioapi.h:160:51: note: in expansion of macro ‘OF’
160 | typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, const void* filename, int mode));
| ^~
In file included from ioapi.c:29:
ioapi.h:164:5: error: unknown type name ‘open64_file_func’
164 | open64_file_func zopen64_file;
| ^~~~~~~~~~~~~~~~
ioapi.h:165:5: error: unknown type name ‘read_file_func’
165 | read_file_func zread_file;
| ^~~~~~~~~~~~~~
ioapi.h:166:5: error: unknown type name ‘write_file_func’
166 | write_file_func zwrite_file;
| ^~~~~~~~~~~~~~~
ioapi.h:167:5: error: unknown type name ‘tell64_file_func’
167 | tell64_file_func ztell64_file;
| ^~~~~~~~~~~~~~~~
ioapi.h:168:5: error: unknown type name ‘seek64_file_func’
168 | seek64_file_func zseek64_file;
| ^~~~~~~~~~~~~~~~
ioapi.h:169:5: error: unknown type name ‘close_file_func’
169 | close_file_func zclose_file;
| ^~~~~~~~~~~~~~~
ioapi.h:170:5: error: unknown type name ‘testerror_file_func’
170 | testerror_file_func zerror_file;
| ^~~~~~~~~~~~~~~~~~~
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
ioapi.h:174:28: note: in expansion of macro ‘OF’
174 | void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def));
| ^~
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
ioapi.h:175:26: note: in expansion of macro ‘OF’
175 | void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def));
| ^~
In file included from ioapi.c:29:
ioapi.h:181:5: error: unknown type name ‘open_file_func’
181 | open_file_func zopen32_file;
| ^~~~~~~~~~~~~~
ioapi.h:182:5: error: unknown type name ‘tell_file_func’
182 | tell_file_func ztell32_file;
| ^~~~~~~~~~~~~~
ioapi.h:183:5: error: unknown type name ‘seek_file_func’
183 | seek_file_func zseek32_file;
| ^~~~~~~~~~~~~~
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
ioapi.h:194:21: note: in expansion of macro ‘OF’
194 | voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode));
| ^~
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
ioapi.h:195:22: note: in expansion of macro ‘OF’
195 | long call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin));
| ^~
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
ioapi.h:196:23: note: in expansion of macro ‘OF’
196 | ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream));
| ^~
ioapi.c: In function ‘call_zopen64’:
ioapi.c:33:46: warning: comparison between pointer and integer
33 | if (pfilefunc->zfile_func64.zopen64_file != NULL)
| ^~
ioapi.c:34:17: error: invalid type argument of unary ‘*’ (have ‘int’)
34 | return (*(pfilefunc->zfile_func64.zopen64_file)) (pfilefunc->zfile_func64.opaque,filename,mode);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ioapi.c:37:17: error: invalid type argument of unary ‘*’ (have ‘int’)
37 | return (*(pfilefunc->zopen32_file))(pfilefunc->zfile_func64.opaque,(const char*)filename,mode);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
ioapi.c: In function ‘call_zseek64’:
ioapi.c:43:46: warning: comparison between pointer and integer
43 | if (pfilefunc->zfile_func64.zseek64_file != NULL)
| ^~
ioapi.c:44:17: error: invalid type argument of unary ‘*’ (have ‘int’)
44 | return (*(pfilefunc->zfile_func64.zseek64_file)) (pfilefunc->zfile_func64.opaque,filestream,offset,origin);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ioapi.c:51:21: error: invalid type argument of unary ‘*’ (have ‘int’)
51 | return (*(pfilefunc->zseek32_file))(pfilefunc->zfile_func64.opaque,filestream,offsetTruncated,origin);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
ioapi.c: In function ‘call_ztell64’:
ioapi.c:57:46: warning: comparison between pointer and integer
57 | if (pfilefunc->zfile_func64.zseek64_file != NULL)
| ^~
ioapi.c:58:17: error: invalid type argument of unary ‘*’ (have ‘int’)
58 | return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ioapi.c:61:29: error: invalid type argument of unary ‘*’ (have ‘int’)
61 | uLong tell_uLong = (*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
ioapi.c: In function ‘fill_zlib_filefunc64_32_def_from_filefunc32’:
ioapi.c:71:48: warning: assignment to ‘int’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
71 | p_filefunc64_32->zfile_func64.zopen64_file = NULL;
| ^
ioapi.c:76:48: warning: assignment to ‘int’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
76 | p_filefunc64_32->zfile_func64.ztell64_file = NULL;
| ^
ioapi.c:77:48: warning: assignment to ‘int’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
77 | p_filefunc64_32->zfile_func64.zseek64_file = NULL;
| ^
ioapi.c: At top level:
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
ioapi.c:87:42: note: in expansion of macro ‘OF’
87 | static voidpf ZCALLBACK fopen_file_func OF((voidpf opaque, const char* filename, int mode));
| ^~
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
ioapi.c:88:42: note: in expansion of macro ‘OF’
88 | static uLong ZCALLBACK fread_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size));
| ^~
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
ioapi.c:89:43: note: in expansion of macro ‘OF’
89 | static uLong ZCALLBACK fwrite_file_func OF((voidpf opaque, voidpf stream, const void* buf,uLong size));
| ^~
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
ioapi.c:90:45: note: in expansion of macro ‘OF’
90 | static ZPOS64_T ZCALLBACK ftell64_file_func OF((voidpf opaque, voidpf stream));
| ^~
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
ioapi.c:91:44: note: in expansion of macro ‘OF’
91 | static long ZCALLBACK fseek64_file_func OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin));
| ^~
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
ioapi.c:92:43: note: in expansion of macro ‘OF’
92 | static int ZCALLBACK fclose_file_func OF((voidpf opaque, voidpf stream));
| ^~
<command-line>: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_Z_OF’
ioapi.c:93:43: note: in expansion of macro ‘OF’
93 | static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream));
| ^~
ioapi.c: In function ‘fill_fopen_filefunc’:
ioapi.c:237:36: warning: assignment to ‘int’ from ‘void * (*)(void *, const char *, int)’ makes integer from pointer without a cast [-Wint-conversion]
237 | pzlib_filefunc_def->zopen_file = fopen_file_func;
| ^
ioapi.c:238:36: warning: assignment to ‘int’ from ‘uLong (*)(void *, void *, void *, uLong)’ {aka ‘long unsigned int (*)(void *, void *, void *, long unsigned int)’} makes integer from pointer without a cast [-Wint-conversion]
238 | pzlib_filefunc_def->zread_file = fread_file_func;
| ^
ioapi.c:239:37: warning: assignment to ‘int’ from ‘uLong (*)(void *, void *, const void *, uLong)’ {aka ‘long unsigned int (*)(void *, void *, const void *, long unsigned int)’} makes integer from pointer without a cast [-Wint-conversion]
239 | pzlib_filefunc_def->zwrite_file = fwrite_file_func;
| ^
ioapi.c:240:36: warning: assignment to ‘int’ from ‘long int (*)(void *, void *)’ makes integer from pointer without a cast [-Wint-conversion]
240 | pzlib_filefunc_def->ztell_file = ftell_file_func;
| ^
ioapi.c:241:36: warning: assignment to ‘int’ from ‘long int (*)(void *, void *, uLong, int)’ {aka ‘long int (*)(void *, void *, long unsigned int, int)’} makes integer from pointer without a cast [-Wint-conversion]
241 | pzlib_filefunc_def->zseek_file = fseek_file_func;
| ^
ioapi.c:242:37: warning: assignment to ‘int’ from ‘int (*)(void *, void *)’ makes integer from pointer without a cast [-Wint-conversion]
242 | pzlib_filefunc_def->zclose_file = fclose_file_func;
| ^
ioapi.c:243:37: warning: assignment to ‘int’ from ‘int (*)(void *, void *)’ makes integer from pointer without a cast [-Wint-conversion]
243 | pzlib_filefunc_def->zerror_file = ferror_file_func;
| ^
ioapi.c: In function ‘fill_fopen64_filefunc’:
ioapi.c:249:38: warning: assignment to ‘int’ from ‘void * (*)(void *, const void *, int)’ makes integer from pointer without a cast [-Wint-conversion]
249 | pzlib_filefunc_def->zopen64_file = fopen64_file_func;
| ^
ioapi.c:250:36: warning: assignment to ‘int’ from ‘uLong (*)(void *, void *, void *, uLong)’ {aka ‘long unsigned int (*)(void *, void *, void *, long unsigned int)’} makes integer from pointer without a cast [-Wint-conversion]
250 | pzlib_filefunc_def->zread_file = fread_file_func;
| ^
ioapi.c:251:37: warning: assignment to ‘int’ from ‘uLong (*)(void *, void *, const void *, uLong)’ {aka ‘long unsigned int (*)(void *, void *, const void *, long unsigned int)’} makes integer from pointer without a cast [-Wint-conversion]
251 | pzlib_filefunc_def->zwrite_file = fwrite_file_func;
| ^
ioapi.c:252:38: warning: assignment to ‘int’ from ‘ZPOS64_T (*)(void *, void *)’ {aka ‘long long unsigned int (*)(void *, void *)’} makes integer from pointer without a cast [-Wint-conversion]
252 | pzlib_filefunc_def->ztell64_file = ftell64_file_func;
| ^
ioapi.c:253:38: warning: assignment to ‘int’ from ‘long int (*)(void *, void *, ZPOS64_T, int)’ {aka ‘long int (*)(void *, void *, long long unsigned int, int)’} makes integer from pointer without a cast [-Wint-conversion]
253 | pzlib_filefunc_def->zseek64_file = fseek64_file_func;
| ^
ioapi.c:254:37: warning: assignment to ‘int’ from ‘int (*)(void *, void *)’ makes integer from pointer without a cast [-Wint-conversion]
254 | pzlib_filefunc_def->zclose_file = fclose_file_func;
| ^
ioapi.c:255:37: warning: assignment to ‘int’ from ‘int (*)(void *, void *)’ makes integer from pointer without a cast [-Wint-conversion]
255 | pzlib_filefunc_def->zerror_file = ferror_file_func;
| ^
make[2]: *** [Makefile:43: ioapi.o] Error 1
make[2]: Leaving directory '/usr/local/bundle/gems/fast_excel-0.4.0/libxlsxwriter/third_party/minizip'
make[1]: *** [Makefile:23: all] Error 2
make[1]: Leaving directory '/usr/local/bundle/gems/fast_excel-0.4.0/libxlsxwriter'
make: *** [Makefile:16: all] Error 2
make failed, exit code 2
If I use the same container to build the latest version of libxlsxwriter, it builds fine, so maybe this is an outdated dependency?
docker run -it -v $PWD:/src -v /run/docker.sock:/run/docker.sock docker.io/library/ruby:3.0.3-bullseye /bin/bash
root@3ae5a9c9eb2f:/# git clone https://github.com/jmcnamara/libxlsxwriter.git
Cloning into 'libxlsxwriter'...
remote: Enumerating objects: 15525, done.
remote: Counting objects: 100% (2247/2247), done.
remote: Compressing objects: 100% (597/597), done.
remote: Total 15525 (delta 1707), reused 2136 (delta 1642), pack-reused 13278
Receiving objects: 100% (15525/15525), 24.14 MiB | 8.02 MiB/s, done.
Resolving deltas: 100% (12213/12213), done.
root@3ae5a9c9eb2f:/# cd libxlsxwriter/
root@3ae5a9c9eb2f:/libxlsxwriter# make
make[1]: Entering directory '/libxlsxwriter/third_party/minizip'
make[1]: Leaving directory '/libxlsxwriter/third_party/minizip'
make[1]: Entering directory '/libxlsxwriter/third_party/tmpfileplus'
make[1]: Leaving directory '/libxlsxwriter/third_party/tmpfileplus'
make[1]: Entering directory '/libxlsxwriter/third_party/md5'
make[1]: Leaving directory '/libxlsxwriter/third_party/md5'
make[1]: Entering directory '/libxlsxwriter/src'
make[1]: Leaving directory '/libxlsxwriter/src'
When I do this, it causes the bg color to not get set.
header_format.set_bg_color(0x98AAEE)
header_format.set_fg_color(0x000000)
Maybe related to: #6
[WARNING]: workbook_add_worksheet(): worksheet name 'Something' has error: Worksheet name is already in use.
/Users/pavel/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/bundler/gems/fast_excel-9ba40c87ed9f/lib/fast_excel/binding/worksheet.rb:324: [BUG] Segmentation fault at 0x00000000000098
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/CrashReporter
* /Library/Logs/CrashReporter
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.
Don't forget to include the above Crash Report log file in bug reports.
-- Control frame information -----------------------------------------------
c:0083 p:---- s:0598 e:000597 CFUNC :worksheet_set_column
c:0082 p:0023 s:0589 e:000588 METHOD /Users/pavel/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/bundler/gems/fast_excel-9ba40c87ed9f/lib/fast_excel/binding/worksheet.rb
c:0081 p:0021 s:0581 e:000580 METHOD /Users/pavel/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/bundler/gems/fast_excel-9ba40c87ed9f/lib/fast_excel.rb:427
c:0080 p:0015 s:0573 e:000572 METHOD /Users/pavel/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/bundler/gems/fast_excel-9ba40c87ed9f/lib/fast_excel.rb:431
c:0079 p:0154 s:0567 e:000566 BLOCK /Users/pavel/Work/mrt/app/services/new_recon_report_service.rb:156 [FINISH]
c:0078 p:---- s:0559 e:000558 IFUNC
c:0077 p:---- s:0556 e:000555 CFUNC :each
c:0076 p:---- s:0553 e:000552 CFUNC :each_with_index
Thank you for this great gem! I had a quick question about how to add a list data type inside a cell for example where user can only select from a, b, and c and its a dropdown list.
Building native gems on Windows lately has been increasingly difficult (I've tried the last 2 hours troubleshooting various problems and still unable to). I've noticed some gems offer pre-compiled versions:
Example ffi:
I think this would help increase the adaption and have other benefits too.
When I did a gem install fast_excel
on macOS Mojave and Xcode 10, I was getting the error:
ld: library not found for -lgcc_s.10.4
After a bit of digging, I found this fix which allowed the install to proceed as expected:
$ cd /usr/local/lib
$ sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.4.dylib
I think this might be fixed by updating to a more recent Libxlsxwriter
. It seems to be related to macOS deprecating something, and the latest Libxlsxwriter
seems to account for this in their build scripts updated for Xcode 10.
FYI in case someone else hits this and/or it can be corrected...
Hi there!
Very usefull gem and i would start by thank you for your great job!
I'm looking for generate some selecting box with severals options of value by the user, i didn't see command for that and i'm asking if this is possible, and if is not, maybe you have planned to do this ?
Thank you for your attention :)
Whenever I try to run the first command in your example I get this error.
uninitialized constant FastExcel::WorkbookExt::Set
This is the variable assignment i am attempting
workbook = FastExcel.open("hello_world_ffi.xlsx", constant_memory: true)
NameError: uninitialized constant FastExcel::WorkbookExt::Set from /home/alb/.rvm/gems/ruby-2.3.5/gems/fast_excel-0.2.5/lib/fast_excel.rb:326:in
initialize'
from /home/alb/.rvm/gems/ruby-2.3.5/gems/fast_excel-0.2.5/lib/fast_excel.rb:35:in new' from /home/alb/.rvm/gems/ruby-2.3.5/gems/fast_excel-0.2.5/lib/fast_excel.rb:35:in
open'
from (irb):33
from /usr/share/rvm/rubies/ruby-2.3.5/bin/irb:11:in <main>'
/data/data/com.termux/files/usr/lib/ruby/gems/2.5.0/gems/ffi-1.10.0/lib/ffi/library.rb:145:in `block in ffi_lib': Could not open library '/data/data/com.termux/files/usr/lib/ruby/gems/2.5.0/gems/fast_excel-0.2.5/libxlsxwriter/lib/libxlsxwriter.so': dlopen failed: cannot locate symbol "fopen64" referenced by "/data/data/com.termux/files/usr/lib/ruby/gems/2.5.0/gems/fast_excel-0.2.5/libxlsxwriter/lib/libxlsxwriter.so"... (LoadError)
Hello.
When using sheet.set_column
to add formats, it works perfectly on LibreOffice, but when opening on Excel, those columns are set to numbers. Changed to set formats on the sheet.append_row(values, format_array)
and it worked even though it was the same format.
Code used on set_column
(Works on LibreOffice but not on Excel), styles are set on col tag in the file's xml
workbook = FastExcel.open(path, constant_memory: true)
date_format = workbook.number_format("d/m/yyyy;@")
sheet = workbook.add_worksheet
sheet.auto_width = true
sheet.append_row(header)
values_array.each do |array_of_values|
sheet.append_row(array_of_values)
end
sheet.set_column(6, 6, 15, date_format)
sheet.set_column(19, 19, 15, date_format)
Code used when passing array of formats (Works on both LibreOffice and Excel), styles are set on the cell tag in the file's xml
workbook = FastExcel.open(path, constant_memory: true)
date_format = workbook.number_format("d/m/yyyy;@")
sheet = workbook.add_worksheet
sheet.auto_width = true
sheet.append_row(header)
values_array.each do |array_of_values|
sheet.append_row(array_of_values, [].fill(nil, 0..5)+[date_format]+[].fill(nil, 0..11)+[date_format])
end
Did i do anything wrong or its an Excel problem?
Hello!
I'm trying to access this enum, but it does not seem to exists in the binding. Maybe they need to be regenerated? Do you still have the command you used to generate the original binding?
current directory: /bundle/gems/fast_excel-0.2.6
/usr/local/bin/ruby -I /usr/local/lib/ruby/site_ruby/2.6.0 -r ./siteconf20190910-1-97hcrj.rb extconf.rb
current directory: /bundle/gems/fast_excel-0.2.6
make "DESTDIR=" clean
make[1]: Entering directory '/bundle/gems/fast_excel-0.2.6/libxlsxwriter'
make[2]: Entering directory '/bundle/gems/fast_excel-0.2.6/libxlsxwriter/src'
make[2]: Leaving directory '/bundle/gems/fast_excel-0.2.6/libxlsxwriter/src'
make[2]: Entering directory '/bundle/gems/fast_excel-0.2.6/libxlsxwriter'
make[2]: *** test/unit: No such file or directory. Stop.
make[2]: Leaving directory '/bundle/gems/fast_excel-0.2.6/libxlsxwriter'
make[1]: *** [Makefile:35: clean] Error 2
make[1]: Leaving directory '/bundle/gems/fast_excel-0.2.6/libxlsxwriter'
make: *** [Makefile:13: clean] Error 2
current directory: /bundle/gems/fast_excel-0.2.6
make "DESTDIR="
Compiling ext/text_width ...
rake compile
/bundle/gems/bundler-2.0.2/lib/bundler/resolver.rb:287:in `block in verify_gemfile_dependencies_are_found!': Could not find gem 'fast_excel' in any of the gem sources listed in your Gemfile. (Bundler::GemNotFound)
from /bundle/gems/bundler-2.0.2/lib/bundler/resolver.rb:255:in `each'
from /bundle/gems/bundler-2.0.2/lib/bundler/resolver.rb:255:in `verify_gemfile_dependencies_are_found!'
from /bundle/gems/bundler-2.0.2/lib/bundler/resolver.rb:49:in `start'
from /bundle/gems/bundler-2.0.2/lib/bundler/resolver.rb:22:in `resolve'
from /bundle/gems/bundler-2.0.2/lib/bundler/definition.rb:258:in `resolve'
from /bundle/gems/bundler-2.0.2/lib/bundler/definition.rb:170:in `specs'
from /bundle/gems/bundler-2.0.2/lib/bundler/definition.rb:237:in `specs_for'
from /bundle/gems/bundler-2.0.2/lib/bundler/definition.rb:226:in `requested_specs'
from /bundle/gems/bundler-2.0.2/lib/bundler/runtime.rb:108:in `block in definition_method'
from /bundle/gems/bundler-2.0.2/lib/bundler/runtime.rb:20:in `setup'
from /bundle/gems/bundler-2.0.2/lib/bundler.rb:107:in `setup'
from /bundle/gems/bundler-2.0.2/lib/bundler/setup.rb:20:in `<top (required)>'
from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /bundle/gems/spring-2.1.0/lib/spring/commands.rb:33:in `<module:Spring>'
from /bundle/gems/spring-2.1.0/lib/spring/commands.rb:4:in `<top (required)>'
from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /bundle/gems/spring-2.1.0/lib/spring/server.rb:9:in `<top (required)>'
from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /bundle/gems/spring-2.1.0/lib/spring/client/server.rb:9:in `call'
from /bundle/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call'
from /bundle/gems/spring-2.1.0/lib/spring/client.rb:30:in `run'
from /bundle/gems/spring-2.1.0/bin/spring:49:in `<main>'
make: *** [Makefile:8: all] Error 1
make failed, exit code 2
What happens to the memory allocated for an object when the option: constant_memory: true or false is set ? The file is not actually stored on disk If the file path is specified in initialize? With constant_memory true - meaning it is stored in RAM? In theory, stored data in an object (data table) should be cleared when an application error occurs.
def sample(file_path, collection)
workbook = FastExcel.open(file_path, constant_memory: true)
sheet = workbook.add_worksheet(self.class::MODEL_NAME)
collection.each do |object|
sheet.append_row(object)
end
raise StandartError
ensure
#What does happens to the memory of the fast _excel object
end
In my code I have
img_options[:width] = 20
img_options[:height] = 20
But the image always comes out the same size even if I change those settings.
I am trying to set the keyword property in the excel file as 'Confidential' by using the below method
workbook = FastExcel.open('./dummy.xlsx')
workbook.set_properties({ keywords: 'Confidential' })
It gives me error that "Argument is not a valid pointer"
After Going through the gem it looks like that it expects a DocProperties Object
d = Libxlsxwriter::DocProperties.new
d[:keywords] = 'Confidential'
workbook.set_properties(d)
When i try to assign d[:keywords] = 'Confidential' then it gives me error that "Cannot set string field"
Could you please let me know how to assign properties
Do you have any plans to expose worksheet_write_rich_string
? If not, do you have a rough idea of how much work it would be to add that support?
Thanks for your work on this gem!
Hey!
I like your code to generate excel reports with high amount of rows.
But can you make please the automated column width feature? :-)
It would be a great feature.
Thanks!
WorkbookWrappers#validate_worksheet_name
is broken because the function in libxlsxwriter was changed from workbook_validate_worksheet_name
to workbook_validate_sheet_name
libxslxwriter header:
binding:
fast_excel/lib/fast_excel/binding/workbook.rb
Line 327 in 8fafe6f
fast_excel/lib/fast_excel/binding/workbook.rb
Lines 149 to 151 in 8fafe6f
Is their plans to release a Ruby 3.0.0 supported version of them gem?
When I try installed 0.3.0, it says
fast_excel-0.3.0 requires ruby version ~> 2.0, which is incompatible with the current version, ruby 3.0.0p0
Hi! I got the error probably after installing XCode 14.0.1. There was no problem before.
rails | /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/fast_excel-0.2.6/lib/fast_excel/binding/worksheet.rb:324: [BUG] Segmentation fault at 0x0000000000000058
rails | ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [arm64-darwin21]
rails |
rails | -- Crash Report log information --------------------------------------------
rails | See Crash Report log file under the one of following:
rails | * ~/Library/Logs/DiagnosticReports
rails | * /Library/Logs/DiagnosticReports
rails | for more details.
rails | Don't forget to include the above Crash Report log file in bug reports.
rails |
rails | -- Control frame information -----------------------------------------------
rails | c:0096 p:---- s:0659 e:000658 CFUNC :worksheet_set_column
rails | c:0095 p:0020 s:0650 e:000649 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/fast_excel-0.2.6/lib/fast_excel/binding/worksheet.rb:324
rails | c:0094 p:0031 s:0642 e:000641 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/fast_excel-0.2.6/lib/fast_excel.rb:495
rails | c:0093 p:0047 s:0634 e:000633 BLOCK /Users/work/projects/some_project/app/services/reports/worksheets/templates/fast_base.rb:26 [FINISH]
rails | c:0092 p:---- s:0629 e:000628 IFUNC
rails | c:0091 p:---- s:0626 e:000625 CFUNC :each
rails | c:0090 p:---- s:0623 e:000622 CFUNC :each_with_index
rails | c:0089 p:0006 s:0619 e:000618 METHOD /Users/work/projects/some_project/app/services/reports/worksheets/templates/fast_base.rb:24
rails | c:0088 p:0017 s:0613 e:000612 METHOD /Users/work/projects/some_project/app/services/reports/worksheets/templates/fast_base.rb:9
rails | c:0087 p:0014 s:0605 e:000604 BLOCK /Users/work/projects/some_project/app/lib/reports/fast_base.rb:57 [FINISH]
rails | c:0086 p:---- s:0600 e:000599 CFUNC :each
rails | c:0085 p:0031 s:0596 e:000595 METHOD /Users/work/projects/some_project/app/lib/reports/fast_base.rb:57
rails | c:0084 p:0003 s:0591 e:000590 METHOD /Users/work/projects/some_project/app/lib/reports/fast_base.rb:66
rails | c:0083 p:0029 s:0587 e:000585 METHOD /Users/work/projects/some_project/app/controllers/crm/pools_controller.rb:88
rails | c:0082 p:0010 s:0581 e:000580 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_controller/metal/basic_implicit_render.r
rails | c:0081 p:0009 s:0575 e:000574 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/abstract_controller/base.rb:194
rails | c:0080 p:0024 s:0569 e:000568 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_controller/metal/rendering.rb:30
rails | c:0079 p:0009 s:0564 e:000563 BLOCK /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/abstract_controller/callbacks.rb:42
rails | c:0078 p:0048 s:0561 e:000559 BLOCK /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:109
rails | c:0077 p:0021 s:0551 e:000550 METHOD /Users/work/projects/some_project/app/controllers/application_controller.rb:74
rails | c:0076 p:0127 s:0547 e:000546 BLOCK /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:118
rails | c:0075 p:0021 s:0538 e:000537 METHOD /Users/work/projects/some_project/app/controllers/application_controller.rb:81
rails | c:0074 p:0127 s:0534 e:000533 BLOCK /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:118
rails | c:0073 p:0036 s:0525 e:000524 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/react-rails-2.5.0/lib/react/rails/controller_lifecycle.rb:31
rails | c:0072 p:0127 s:0520 e:000519 BLOCK /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:118
rails | c:0071 p:0124 s:0511 E:001ec8 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:136
rails | c:0070 p:0006 s:0502 E:002648 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/abstract_controller/callbacks.rb:41
rails | c:0069 p:0008 s:0497 e:000496 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_controller/metal/rescue.rb:22
rails | c:0068 p:0009 s:0491 e:000490 BLOCK /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_controller/metal/instrumentation.rb:34
rails | c:0067 p:0010 s:0486 e:000485 BLOCK /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activesupport-5.2.3/lib/active_support/notifications.rb:168
rails | c:0066 p:0017 s:0483 e:000482 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activesupport-5.2.3/lib/active_support/notifications/instrumenter.rb
rails | c:0065 p:0023 s:0475 e:000474 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activesupport-5.2.3/lib/active_support/notifications.rb:168
rails | c:0064 p:0095 s:0469 e:000468 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_controller/metal/instrumentation.rb:32
rails | c:0063 p:0078 s:0463 e:000462 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_controller/metal/params_wrapper.rb:256
rails | c:0062 p:0026 s:0455 e:000454 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activerecord-5.2.3/lib/active_record/railties/controller_runtime.rb:
rails | c:0061 p:0077 s:0449 e:000448 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/abstract_controller/base.rb:134
rails | c:0060 p:0062 s:0442 e:000441 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionview-5.2.3/lib/action_view/rendering.rb:32
rails | c:0059 p:0017 s:0436 e:000435 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_controller/metal.rb:191
rails | c:0058 p:0034 s:0429 e:000428 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_controller/metal.rb:252
rails | c:0057 p:0010 s:0422 e:000421 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_dispatch/routing/route_set.rb:52
rails | c:0056 p:0036 s:0414 e:000413 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_dispatch/routing/route_set.rb:34
rails | c:0055 p:0007 s:0406 e:000405 BLOCK /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_dispatch/routing/mapper.rb:18
rails | c:0054 p:0026 s:0401 e:000400 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_dispatch/routing/mapper.rb:48
rails | c:0053 p:0111 s:0396 e:000395 BLOCK /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_dispatch/journey/router.rb:52 [FINISH]
rails | c:0052 p:---- s:0384 e:000383 CFUNC :each
rails | c:0051 p:0008 s:0380 e:000379 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_dispatch/journey/router.rb:35
rails | c:0050 p:0042 s:0375 e:000374 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_dispatch/routing/route_set.rb:840
rails | c:0049 p:0015 s:0369 e:000368 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-2.0.8/lib/rack/config.rb:17
rails | c:0048 p:0072 s:0364 e:000363 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/remotipart-1.4.2/lib/remotipart/middleware.rb:32
rails | c:0047 p:0035 s:0357 e:000356 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-2.0.8/lib/rack/tempfile_reaper.rb:15
rails | c:0046 p:0007 s:0348 e:000347 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-2.0.8/lib/rack/etag.rb:25
rails | c:0045 p:0048 s:0337 e:000336 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-2.0.8/lib/rack/conditional_get.rb:25
rails | c:0044 p:0007 s:0328 e:000327 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-2.0.8/lib/rack/head.rb:12
rails | c:0043 p:0026 s:0320 e:000319 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_dispatch/http/content_security_policy.rb
rails | c:0042 p:0026 s:0308 e:000307 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-2.0.8/lib/rack/session/abstract/id.rb:259
rails | c:0041 p:0005 s:0297 e:000296 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-2.0.8/lib/rack/session/abstract/id.rb:253
rails | c:0040 p:0026 s:0292 e:000291 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/cookies.rb:670
rails | c:0039 p:0065 s:0282 e:000281 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:559
rails | c:0038 p:0008 s:0276 e:000275 BLOCK /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/callbacks.rb:28
rails | c:0037 p:0024 s:0273 e:000272 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:98
rails | c:0036 p:0009 s:0264 e:000263 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/callbacks.rb:26
rails | c:0035 p:0014 s:0257 e:000256 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/executor.rb:14
rails | c:0034 p:0022 s:0249 e:000248 BLOCK /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rollbar-3.3.0/lib/rollbar/middleware/rails/rollbar.rb:25
rails | c:0033 p:0027 s:0243 e:000242 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rollbar-3.3.0/lib/rollbar.rb:145
rails | c:0032 p:0045 s:0235 e:000234 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rollbar-3.3.0/lib/rollbar/middleware/rails/rollbar.rb:22
rails | c:0031 p:0026 s:0229 e:000228 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/debug_exceptions.rb:
rails | c:0030 p:0005 s:0218 e:000217 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rollbar-3.3.0/lib/rollbar/middleware/rails/show_exceptions.rb:22
rails | c:0029 p:0026 s:0211 e:000210 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/show_exceptions.rb:3
rails | c:0028 p:0041 s:0204 E:001f80 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/railties-5.2.3/lib/rails/rack/logger.rb:38
rails | c:0027 p:0008 s:0194 e:000193 BLOCK /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/railties-5.2.3/lib/rails/rack/logger.rb:26
rails | c:0026 p:0004 s:0191 e:000190 BLOCK /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activesupport-5.2.3/lib/active_support/tagged_logging.rb:71
rails | c:0025 p:0012 s:0188 e:000187 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activesupport-5.2.3/lib/active_support/tagged_logging.rb:28
rails | c:0024 p:0010 s:0182 e:000181 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activesupport-5.2.3/lib/active_support/tagged_logging.rb:71
rails | c:0023 p:0039 s:0177 e:000176 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/railties-5.2.3/lib/rails/rack/logger.rb:26
rails | c:0022 p:0038 s:0171 e:000170 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/quiet_assets.rb:13
rails | c:0021 p:0052 s:0166 e:000165 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/remote_ip.rb:81
rails | c:0020 p:0019 s:0160 e:000159 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/request_store-1.4.1/lib/request_store/middleware.rb:19
rails | c:0019 p:0038 s:0153 e:000152 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/request_id.rb:27
rails | c:0018 p:0092 s:0147 e:000146 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-2.0.8/lib/rack/method_override.rb:22
rails | c:0017 p:0020 s:0141 e:000140 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-2.0.8/lib/rack/runtime.rb:22
rails | c:0016 p:0033 s:0131 e:000130 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activesupport-5.2.3/lib/active_support/cache/strategy/local_cache_mi
rails | c:0015 p:0014 s:0124 e:000123 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/executor.rb:14
rails | c:0014 p:0078 s:0116 e:000115 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/static.rb:127
rails | c:0013 p:0007 s:0108 e:000107 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-2.0.8/lib/rack/sendfile.rb:111
rails | c:0012 p:0208 s:0096 e:000095 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-cors-1.0.3/lib/rack/cors.rb:95
rails | c:0011 p:0151 s:0083 e:000082 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/webpacker-5.4.3/lib/webpacker/dev_server_proxy.rb:25
rails | c:0010 p:0009 s:0078 e:000076 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-proxy-0.7.0/lib/rack/proxy.rb:63
rails | c:0009 p:0016 s:0072 e:000071 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/railties-5.2.3/lib/rails/engine.rb:524
rails | c:0008 p:0028 s:0066 e:000065 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/puma-5.6.4/lib/puma/configuration.rb:252
rails | c:0007 p:0008 s:0061 e:000060 BLOCK /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/puma-5.6.4/lib/puma/request.rb:77
rails | c:0006 p:0023 s:0058 e:000057 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/puma-5.6.4/lib/puma/thread_pool.rb:340
rails | c:0005 p:0286 s:0053 e:000052 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/puma-5.6.4/lib/puma/request.rb:76
rails | c:0004 p:0128 s:0032 e:000031 METHOD /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/puma-5.6.4/lib/puma/server.rb:441 [FINISH]
rails | c:0003 p:---- s:0020 e:000019 IFUNC
rails | c:0002 p:0099 s:0017 e:000014 BLOCK /Users/work/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/puma-5.6.4/lib/puma/thread_pool.rb:147 [FINISH]
rails | c:0001 p:---- s:0003 e:000002 (none) [FINISH]
Hi really awesome gem! I was wondering if there was any way to add a hyperlink url inside the cell I am currently using write_value but the value is only appearing as regular text. Thank you!
The README file has an impress 4x speed bump pver axlsx. I switched last year to spreadsheet_architect which is a wrapper for caxlsx. What does your benchmarks show against caxlsx?
I'm asking because I have some files that are taking over 30 minutes to render with 5 sheets and less than 100K total rows. fast_excel looks like a potential drop in replacement.
Dewayne
o-*
Hi,
if I run the file examples/example_filters.rb
(with require('fast_excel')
instead of require_relative '../lib/fast_excel'
I receive this error:
undefined method enable_filters! for #<Libxlsxwriter::Worksheet:0x00007fa4c695a750> (NoMethodError)
When trying to bold a row, I followed what is in the README.md
and did:
bold = workbook.bold_format
worksheet.append_row(["message", "price", "date"], bold)
But I got the following error message:
ActionView::Template::Error (undefined method `bold_format' for #<Libxlsxwriter::Workbook:0x00007fc8d5882548>
Did you mean? bold_cell_format):
When using bold_cell_format
, it works perfectly fine.
I had a look in the code base to see if it was a typo but it appears you are aliasing bold_format
to bold_cell_format
here:
alias_method :bold_format, :bold_cell_format
So I'm not sure why it's not working. I'm on the latest version, 0.2.6. I wonder if making this alias
instead of alias_method
would make a difference.
Let me know what you think.
Just wondering if you know what kind of formatting trickery might be used to get the '$' aligned far left with the numbers aligned right? Thanks!
Hey @Paxa !
Thank you for this gem. I'm interested what's your intention with it? I.e do you plan to update the libxlswriter source? Are there any blockers?Do you see some milestones? Do you plan to maintain this gem in future?
Thanks for your feedback!
Best regards
Hi,I am using windows OS, I have installed the gem and started running your given example, but I am getting the following error
C:\Ruby26\bin\ruby.exe C:/A/RubyAutomation/AppData/Example.rb
Traceback (most recent call last):
2: from C:/A/RubyAutomation/AppData/Example.rb:2:in `<main>'
1: from C:/Ruby26/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
C:/Ruby26/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- fast_excel (LoadError)
10: from C:/A/RubyAutomation/AppData/Example.rb:2:in `<main>'
9: from C:/Ruby26/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:34:in `require'
8: from C:/Ruby26/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:130:in `rescue in require'
7: from C:/Ruby26/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:130:in `require'
6: from C:/Ruby26/lib/ruby/gems/2.6.0/gems/fast_excel-0.2.6/lib/fast_excel.rb:1:in `<top (required)>'
5: from C:/Ruby26/lib/ruby/gems/2.6.0/gems/fast_excel-0.2.6/lib/fast_excel.rb:1:in `require_relative'
4: from C:/Ruby26/lib/ruby/gems/2.6.0/gems/fast_excel-0.2.6/lib/fast_excel/binding.rb:5:in `<top (required)>'
3: from C:/Ruby26/lib/ruby/gems/2.6.0/gems/fast_excel-0.2.6/lib/fast_excel/binding.rb:14:in `<module:Libxlsxwriter>'
2: from C:/Ruby26/lib/ruby/gems/2.6.0/gems/ffi-1.12.2-x86-mingw32/lib/ffi/library.rb:99:in `ffi_lib'
1: from C:/Ruby26/lib/ruby/gems/2.6.0/gems/ffi-1.12.2-x86-mingw32/lib/ffi/library.rb:99:in `map'
(LoadError)b/ruby/gems/2.6.0/gems/ffi-1.12.2-x86-mingw32/lib/ffi/library.rb:145:in `block in ffi_lib': Could not open library 'C:/Ruby26/lib/ruby/gems/2.6.0/gems/fast_excel-0.2.6/libxlsxwriter/lib/libxlsxwriter.so': The specified module could not be found.
no matters what i do, it always create the sheets as right_to_left, even if right_to_left was never called, i tried things like:
worksheet[:right_to_left]=0
worksheet[:right_to_left]=1
worksheet[:right_to_left]=false
worksheet.right_to_left
none gave me a normal left-to-right sheet
I have this issue when trying to find existing worksheet and then write to it:
NoMethodError:
undefined method `constant_memory?' for nil:NilClass
# /Users/gradus/.rvm/gems/ruby-2.3.1/bundler/gems/fast_excel-07292bd3b116/lib/fast_excel.rb:403:in `write_value'
# /Users/gradus/.rvm/gems/ruby-2.3.1/bundler/gems/fast_excel-07292bd3b116/lib/fast_excel.rb:397:in `block in write_row'
Code to repeat:
workbook = FastExcel.open(destination, constant_memory: true)
worksheet = workbook.get_worksheet_by_name('Report 1')
worksheet.write_row(0, ['1'])
I am using it ina jruby rails application. I have added to the Gemfile, bundle install is a success.
$ bundle install | grep fast
Using fast_excel 0.4.0
After creating the war file by using the warbler gem,
when I want to run the war file it is not able to find the gem and saying to install the missing gem.
$ java -jar rtti_web.war
2021-10-06 13:14:26.699:INFO::main: Logging initialized @189ms
2021-10-06 13:14:26.707:INFO:oejr.Runner:main: Runner
2021-10-06 13:14:26.851:INFO:oejs.Server:main: jetty-9.2.9.v20150224
2021-10-06 13:14:32.941:WARN:oeja.AnnotationConfiguration:main: ServletContainerInitializers: detected. Class hierarchy: empty
2021-10-06 13:14:33.198:INFO:/:main: INFO: jruby 9.3.0.0 (2.6.8) 2021-09-17 85c20e780f OpenJDK 64-Bit Server VM 11.0.11+9-Ubuntu-0ubuntu2.20.04 on 11.0.11+9-Ubuntu-0ubuntu2.20.04 +jit [linux-x86_64]
2021-10-06 13:14:33.199:INFO:/:main: INFO: using a shared (threadsafe!) runtime
uri:classloader:/jruby/rack/response.rb:294: warning: constant ::Fixnum is deprecated
uri:classloader:/jruby/rack/core_ext.rb:26: warning: constant ::NativeException is deprecated
Could not find fast_excel-0.4.0 in any of the sources
Run bundle install
to install missing gems.
2021-10-06 13:14:36.766:INFO:/:main: An exception happened during JRuby-Rack startup|exit|--- System|jruby 9.3.0.0 (2.6.8) 2021-09-17 85c20e780f OpenJDK 64-Bit Server VM 11.0.11+9-Ubuntu-0ubuntu2.20.04 on 11.0.11+9-Ubuntu-0ubuntu2.20.04 +jit [linux-x86_64]|Time: 2021-10-06 13:14:36 +0530|Server: jetty/9.2.9.v20150224|jruby.home: uri:classloader://META-INF/jruby.home||--- Context Init Parameters:|jruby.max.runtimes = 1|jruby.min.runtimes = 1|public.root = /rtti_web|rails.env = development||--- Backtrace|SystemExit: exit| exit at org/jruby/RubyKernel.java:790| exit at org/jruby/RubyKernel.java:753|
I think it would be nice if auto width could coexist with fixed width.
I use auto width most of the time, but sometimes a single column content can make a mess if it's too large. I would like to set width of some columns, and still have autowidth for the rest of them.
In my project, i did this as a monkey patch, but i could make a PR if you think this could me useful.
def initialize(struct)
@fixed_witdh_columns = []
@is_open = true
@col_formats = {}
@last_row_number = -1
super(struct)
end
def set_column_width(col, width)
@fixed_witdh_columns << col
set_column(col, col, width, @col_formats[col])
end
def close
return unless auto_width?
@column_widths.each do |num, width|
next if @fixed_witdh_columns.include?(num)
set_column_width(num, width + 0.2)
end
end
Is there a way to centralize converting of cell values e.g
price_format allows a string formatting, however is there a way to convert a cents value to dollars at the presentation level?
It'd be nice to be able to simply do
sheet.append_row(data, some_style)
and have the library keep track of the row number.
See Note number 1 of #83.
There are cases where Libxlsxwriter returns a NULL pointer intentionally (rather than because of a memory error).
In those cases, I think FastExcel should return nil
instead of a Struct of null pointer, especially because further usage on the Struct is likely to yield segmentation fault error and crashes the whole process (rather than just a Ruby RuntimeError when using nil values improperly).
For example:
WorkbookWrappers#get_worksheet_by_name
when worksheet is not foundWorkbookWrappers#default_format
when there are no formats?WorksheetWrappers#find_row
when row is not found?Hi,
We can add add urls like this:
worksheet.append_row([
FastExcel::URL.new("https://github.com/Paxa/fast_excel"),
FastExcel::URL.new("postgres://localhost")
], url_format)
But how can we add a url to the excel file and set the text that will be the anchor to the url? Essentially I want to show a title, and when the user clicks the title it goes to a url.
Something like this would be useful:
FastExcel::URL.new("Super link", "https://github.com/Paxa/fast_excel"),
How can I do this?
This is very promising solution to Axlsx, if it would only have the possibility to add columns in the middle of file generation process.
We have this process of generating large Excel files, which also need to dynamically add columns, if certain data appears.
How could that be possible to achieve that result?
Hey!
We have some data, and want to query it from the DB, and export it to excel.
workbook = FastExcel.open(tmp_file_path, constant_memory: true)
sheet = workbook.add_worksheet('name)
sheet.write_row(0, column_names, workbook.bold_cell_format)
So the problem is, I want to write it parallelly.
limit = 50_000
count = 523_523 # whatever
0.step(count, limit).each do |offset|
fork do
data = db_query(offset, limit)
data.each.with_index do |row, idx|
sheet.write_row(
offset + idx + 1,
row
)
end
end
end
Process.waitall
workbook.close
But the result is weird. Sometimes I have the half of the data, and sometimes a bit more. (but without empty rows!! which is super weird)
So the question is, fast_excel
is thread unsafe, or I did miss something?
This does not work:
header_format.set(bg_color: 0xff0000)
It neither sets the color, nor fails with an error.
Naturally, this works ok, but it's convenient to set a lot of things at once:
header_format.set_bg_color(0xff0000)
Trying to set a footer / header margin causes the following error ":pointer argument is not a valid pointer".
Below is some of the inputs I have tried, I'm not sure if this is a bug or am I doing something wrong?
options = Libxlsxwriter::HeaderFooterOptions
worksheet.set_header_opt('&L&A&CPage &P of &N', options)
worksheet.set_footer_opt('&L&A&CPage` &P of &N', {margin: 0.2} )
worksheet.set_footer_opt('&L&A&CPage` &P of &N', {0.2} )
worksheet.set_footer_opt('&L&A&CPage` &P of &N', 0.2 )
Using set_header / set_footer works fine.
I did see this in the libxsltwriter FAQ though:
https://libxlsxwriter.github.io/faq.html
Unfortunately, there is no way to specify "AutoFit" for a column in the Excel file format. This feature is only available at runtime from within Excel. It is possible to simulate "AutoFit" by tracking the width of the data in the column as your write it.
It looks like axlsx does this:
# This is still not perfect...
# - scaling is not linear as font sizes increst
# - different fonts have different mdw and char widths
def autowidth
return if is_formula? || value == nil
mdw = 1.78 #This is the widest width of 0..9 in arial@10px)
font_scale = (font_size/10.0).to_f
((value.to_s.count(Worksheet.thin_chars) * mdw + 5) / mdw * 256) / 256.0 * font_scale
end
Thanks for the great gem, this is so much better than using axlsx!
To build this gem on OpenBSD, I need to set MAKE=gmake. This is because some makefile uses GNU make concepts. I would like to create a PR to autodetect the existence of gmake on the system and if available use that automatically. I'm not sure how to incorporate this correctly into the gem, do you have any pointers?
Hey!
It's been a long time since the last release (20 Jun) and there were a few pull requests that improved the performance. We'd really appreciate it if you released a new version since we'd love to include fast_excel
in one of our gem's dependencies .
Sorry a mistake! Wrong repo!
I would like to do:
fr.set(align: :align_center)
fr.set(align: :align_vertical_center)
Together - is there a way to do that that I'm missing?
Hi, I was wondering if a new release is planned, since stuff like FastExcel::URL is mentioned in the documentation but it's not present in the 0.2.6 release.
require 'fast_excel'
workbook = FastExcel.open()
sheet = workbook.add_worksheet('Sheet1')
pp sheet[:default_row_height] # This is 0.3, but should be 15.0
I expect the sheet[:default_row_height]
to be equal to LXW_DEF_ROW_HEIGHT
, as defined here:
But instead I keep getting a value of 0.3
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.