Page 1 of 1

plugins.excelxport: number of cell styles was exceeded

PostPosted: Thu Apr 28, 2016 5:15 pm
by Bernd.N
When using plugins.excelxport with a specific amount of data, we get the following error message:

JavaException: java.lang.IllegalStateException: The maximum number of cell styles was exceeded. You can define up to 4000 styles in a .xls workbook

We use this line for exporting:
res = plugins.file.writeFile(file, plugins.excelxport.excelExport(fs, col));

Does someone know how to avoid that error, besides by limiting the amount of data that is send to the plugin?

Re: plugins.excelxport: number of cell styles was exceeded

PostPosted: Fri Apr 29, 2016 11:39 am
by patrick
That's a bug and there is a case for that https://support.servoy.com/browse/SVY-7858

Excel only allows a fixed number of cell styles per sheet and the plugin seems to give every cell it's own style instead of reusing styles for the whole column. As a workaround, have a look at https://github.com/Servoy/svyUtils/wiki/ExcelUtils. That gives you more control over the whole process.

Re: plugins.excelxport: number of cell styles was exceeded

PostPosted: Fri Apr 29, 2016 11:50 am
by Bernd.N
Thanks, Patrick!