andresteingress/gsheets — Issue #4: to many styles are created
Author: tompson
Created: 2012-03-01 21:58:49+00:00
State: open

there is a limit for a maximum of 4000 styles created in one workbook

if you create 4001 rows and you want to apply a bold font to all of them the current way you get the following exception:

The maximum number of cell styles was exceeded. You can define up to 4000 styles in a .xls workbook. Stacktrace follows:
java.lang.IllegalStateException: The maximum number of cell styles was exceeded. You can define up to 4000 styles in a .xls workbook
at org.apache.poi.hssf.usermodel.HSSFWorkbook.createCellStyle(HSSFWorkbook.java:1160)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.createCellStyle(HSSFWorkbook.java:78)
at org.gsheets.ExcelFile$_applyCellStyle_closure1_closure5.doCall(ExcelFile.groovy:212)
at org.gsheets.ExcelFile$_applyCellStyle_closure1.doCall(ExcelFile.groovy:222)
at org.gsheets.ExcelFile.applyCellStyle(ExcelFile.groovy:197)
at com.tritonstyle.abakus.SalesController$_createWorkbook_closure9_closure40.doCall(SalesController.groovy:380)
at org.gsheets.ExcelFile.commands(ExcelFile.groovy:121)
at com.tritonstyle.abakus.SalesController$_createWorkbook_closure9.doCall(SalesController.groovy:378)
at org.gsheets.ExcelFile.workbook(ExcelFile.groovy:99)
at com.tritonstyle.abakus.SalesController.createWorkbook(SalesController.groovy:261)
at com.tritonstyle.abakus.SalesController.bill(SalesController.groovy:411)