Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
SJ SJ is offline
external usenet poster
 
Posts: 22
Default Getting maximum number of fonts have been exceeded error

Hi Team,

I am using HSSfWorkbook to create work books using POI API. It has been
working fine. But whenever the date is more and when I try to upload XL sheet
it is giving "
Maximum number of fonts have been exceeded error "

Any pointers in this regard are appreciated.
Thanks in Advance
SJ
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Getting maximum number of fonts have been exceeded error

We get a similar message in one of our applications. I suspect that is is
due to a memory leak on the PC. It may or not be your application but
something else running on the PC. My solution is to reboot the PC before i
do any operations that may take a lot of memory or that has crashed
previously when I ran the application. Also when you run your macro close
all the unecessary apllications on the PC.

"SJ" wrote:

Hi Team,

I am using HSSfWorkbook to create work books using POI API. It has been
working fine. But whenever the date is more and when I try to upload XL sheet
it is giving "
Maximum number of fonts have been exceeded error "

Any pointers in this regard are appreciated.
Thanks in Advance
SJ

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Maximum number of fonts exceeded in HSSFWorkBook

Hi Guys ,
Following errorMessage has been arised for me also .
and from apache Site , i have fixed that error too .
I would like to share this information with you .

Wrong :

for (int i = 0; i < 10000; i++) {
Row row = sheet.createRow(i);
Cell cell = row.createCell((short) 0);
CellStyle style = workbook.createCellStyle();
Font font = workbook.createFont();
font.setBoldweight(Font.BOLDWEIGHT_BOLD);
style.setFont(font);
cell.setCellStyle(style);
}

Correct:

CellStyle style = workbook.createCellStyle();
Font font = workbook.createFont();
font.setBoldweight(Font.BOLDWEIGHT_BOLD);
style.setFont(font);
for (int i = 0; i < 10000; i++) {
Row row = sheet.createRow(i);
Cell cell = row.createCell((short) 0);
cell.setCellStyle(style);
}

Note : LOC of creating fonts is inside the loop , because when you are writing the records to the row. there is no need of keeping the font creation in loop , better move it outside the loop and try it . Sure popup message will not come in case of
large datas populated in the worksheet .
kindly let me know if any .

refURL : http://poi.apache.org/spreadsheet/quick-guide.html



Joe wrote:

We get a similar message in one of our applications.
28-Oct-08

We get a similar message in one of our applications. I suspect that is is
due to a memory leak on the PC. It may or not be your application but
something else running on the PC. My solution is to reboot the PC before i
do any operations that may take a lot of memory or that has crashed
previously when I ran the application. Also when you run your macro close
all the unecessary apllications on the PC.

"SJ" wrote:

Previous Posts In This Thread:

On Monday, October 27, 2008 5:42 PM
S wrote:

Getting maximum number of fonts have been exceeded error
Hi Team,

I am using HSSfWorkbook to create work books using POI API. It has been
working fine. But whenever the date is more and when I try to upload XL sheet
it is giving "
Maximum number of fonts have been exceeded error "

Any pointers in this regard are appreciated.
Thanks in Advance
SJ

On Tuesday, October 28, 2008 6:31 AM
Joe wrote:

We get a similar message in one of our applications.
We get a similar message in one of our applications. I suspect that is is
due to a memory leak on the PC. It may or not be your application but
something else running on the PC. My solution is to reboot the PC before i
do any operations that may take a lot of memory or that has crashed
previously when I ran the application. Also when you run your macro close
all the unecessary apllications on the PC.

"SJ" wrote:

EggHeadCafe - Software Developer Portal of Choice
Host Winforms App in IE from your web server
http://www.eggheadcafe.com/tutorials...p-in-ie-f.aspx
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Maximum number of fonts exceeded in HSSFWorkBook

Thanks so much for the tip!
Was going mad trying to solve the issue, and your tip sorted it!

On Monday, October 27, 2008 5:42 PM S wrote:


Hi Team,

I am using HSSfWorkbook to create work books using POI API. It has been
working fine. But whenever the date is more and when I try to upload XL sheet
it is giving "
Maximum number of fonts have been exceeded error "

Any pointers in this regard are appreciated.
Thanks in Advance
SJ



On Tuesday, October 28, 2008 6:31 AM Joe wrote:


We get a similar message in one of our applications. I suspect that is is
due to a memory leak on the PC. It may or not be your application but
something else running on the PC. My solution is to reboot the PC before i
do any operations that may take a lot of memory or that has crashed
previously when I ran the application. Also when you run your macro close
all the unecessary apllications on the PC.

"SJ" wrote:



On Monday, November 09, 2009 10:21 PM senthil kumar A wrote:


Hi Guys ,

Following errorMessage has been arised for me also .

and from apache Site , i have fixed that error too .

I would like to share this information with you .



Wrong :



for (int i = 0; i < 10000; i++) {

Row row = sheet.createRow(i);

Cell cell = row.createCell((short) 0);

CellStyle style = workbook.createCellStyle();

Font font = workbook.createFont();

font.setBoldweight(Font.BOLDWEIGHT_BOLD);

style.setFont(font);

cell.setCellStyle(style);

}



Correct:



CellStyle style = workbook.createCellStyle();

Font font = workbook.createFont();

font.setBoldweight(Font.BOLDWEIGHT_BOLD);

style.setFont(font);

for (int i = 0; i < 10000; i++) {

Row row = sheet.createRow(i);

Cell cell = row.createCell((short) 0);

cell.setCellStyle(style);

}



Note : LOC of creating fonts is inside the loop , because when you are writing the records to the row. there is no need of keeping the font creation in loop , better move it outside the loop and try it . Sure popup message will not come in case of

large datas populated in the worksheet .

kindly let me know if any .



refURL : http://poi.apache.org/spreadsheet/quick-guide.html




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exceeded number of worksheets limit imranmalikuk Excel Discussion (Misc queries) 0 November 14th 10 04:22 PM
...maximum number of fonts exceeded... ? Christopher Excel Discussion (Misc queries) 1 December 22nd 06 02:34 PM
Exceeded font space error message thirtywinter Excel Discussion (Misc queries) 0 September 22nd 06 11:35 AM
Number of IF statements exceeded... gardenhead Excel Worksheet Functions 7 July 17th 06 10:04 PM
maximum number of fonts exceeded Jeremy Bertomeu Excel Programming 1 May 3rd 05 09:23 AM


All times are GMT +1. The time now is 06:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"