Tuesday, November 17, 2009

Problem with POI-Excel Fonts solved!

Today suddenly i get the following error opening a POI-generated file with Microsoft Excel:


"Excel cannot complete this task with available resources. Choose less data or close other applications."


More info in: http://markmail.org/message/bzy5wv2bziodqeoi

The solution was:

1.- Reuse evey Font object you can...
Someting like this:

for (row in rows) {
font = workbook.createFont()
//Do whatever with font
}


Have to be refactored to something like this:

font = workbook.createFont()
for (row in rows) {
//Do whatever with font
}


2.- Update to 3.5-FINAL version. 3.2-FINAL version is buggy and exhausts all Excel resources with anything you do.

NOTE: With OpenOffice everything worked ok.

No comments:

Post a Comment