plugins.excelxport: number of cell styles was exceeded

Questions and answers on developing, deploying and using plugins and JavaBeans

plugins.excelxport: number of cell styles was exceeded

Postby Bernd.N » Thu Apr 28, 2016 5:15 pm

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?
Bernd Korthaus
LinkedIn
Servoy 7.4.9 SC postgreSQL 9.4.11 Windows 10 Pro
User avatar
Bernd.N
 
Posts: 474
Joined: Mon Oct 21, 2013 5:57 pm
Location: Langenhorn, North Friesland, Germany

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

Postby patrick » Fri Apr 29, 2016 11:39 am

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.
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3597
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

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

Postby Bernd.N » Fri Apr 29, 2016 11:50 am

Thanks, Patrick!
Bernd Korthaus
LinkedIn
Servoy 7.4.9 SC postgreSQL 9.4.11 Windows 10 Pro
User avatar
Bernd.N
 
Posts: 474
Joined: Mon Oct 21, 2013 5:57 pm
Location: Langenhorn, North Friesland, Germany


Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 3 guests