How many times is the method "wb.createCellStyle();" called in your code?

Make sure you create a style only once and use it as needed. 
You don't want to put this method call in a loop or in a method that is
called multiple time while generating the Excel.

Hope this helps.

Regards
Vasant






-----Original Message-----
From: Nidhi Tuli [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 30, 2006 1:19 PM
To: [email protected]
Subject: "To many different cell formats"

My excel has lot of data. It consists of 3 sheets and all three sheets
have 300 rows with 15 columns. And we need all the rows and cells to
have the borders so that its readable. So I used following code snippet
for each cell. 
 
 
HSSFCellStyle style = wb.createCellStyle();
                        
style.setBorderTop(HSSFCellStyle.BORDER_THIN);
style.setTopBorderColor(HSSFColor.BLACK.index);
style.setBorderBottom(HSSFCellStyle.BORDER_THIN);
style.setBottomBorderColor(HSSFColor.BLACK.index);
style.setBorderLeft(HSSFCellStyle.BORDER_THIN);
style.setLeftBorderColor(HSSFColor.BLACK.index);
style.setBorderRight(HSSFCellStyle.BORDER_THIN);
style.setRightBorderColor(HSSFColor.BLACK.index);
cell.setCellStyle(style);
 
When I create and format these cells POI does not complain anything. But
when I open the huge excel with that much formatting it complains "To
many different call formats". 
 
Any idea how to get ride of this?
 
Thanks in advance.
Nidhi
 
 


------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments, contains 
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New 
Jersey, USA 08889), and/or its affiliates (which may be known outside the 
United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as 
Banyu) that may be confidential, proprietary copyrighted and/or legally 
privileged. It is intended solely for the use of the individual or entity named 
on this message.  If you are not the intended recipient, and have received this 
message in error, please notify us immediately by reply e-mail and then delete 
it from your system.
------------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/

Reply via email to