The error message is about font index. Autosize column uses the font
metrics to calculate
the width of columns. It is trying to get font at index 700 although
your workbook only
have 4 font records.
Are you starting with a blank workbook or reading in a xls file created
through excel?
Regards
Tahir Akhtar
Straw wrote:
Hi,
I have just started using POI. I am calling sheet.autosizeColumn(colNum) .
My column numbers range from 0 to 8. I have made sure that the cells in the
columns are created before calling autosize and am using the default font.
But I get the following exception when this call is executed :
java.lang.ArrayIndexOutOfBoundsException: There are only 4 font records, you
asked for 700
at
org.apache.poi.hssf.model.Workbook.getFontRecordAt(Workbook.java:391)
at
org.apache.poi.hssf.usermodel.HSSFWorkbook.getFontAt(HSSFWorkbook.java:848)
at
org.apache.poi.hssf.usermodel.HSSFSheet.autoSizeColumn(HSSFSheet.java:1438)
at com........MyExcelReport.resizeColumns(MyExcelReport.java:74)
at com......MyExcelReport.createExcelReport(MyExcelReport.java:67)
......
My current data creates only two rows in the sheet ie. 18 cells in all.
Nothing adds up to the '700' mentioned in the exception description.
Could anyone give me an idea of what is possibly going wrong ?
Thanks !
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]