Return-Path: Delivered-To: apmail-poi-dev-archive@www.apache.org Received: (qmail 77583 invoked from network); 10 Aug 2007 15:28:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Aug 2007 15:28:44 -0000 Received: (qmail 50424 invoked by uid 500); 10 Aug 2007 15:28:42 -0000 Delivered-To: apmail-poi-dev-archive@poi.apache.org Received: (qmail 50408 invoked by uid 500); 10 Aug 2007 15:28:42 -0000 Mailing-List: contact dev-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "POI Developers List" Delivered-To: mailing list dev@poi.apache.org Received: (qmail 50399 invoked by uid 99); 10 Aug 2007 15:28:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Aug 2007 08:28:41 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Aug 2007 15:28:42 +0000 Received: by brutus.apache.org (Postfix, from userid 33) id 91A0E714159; Fri, 10 Aug 2007 08:28:22 -0700 (PDT) From: bugzilla@apache.org To: dev@poi.apache.org Subject: DO NOT REPLY [Bug 43088] New: - Excel file can't be loaded if comments exceed a size of 4111 characters Message-ID: X-Bugzilla-Reason: AssignedTo Date: Fri, 10 Aug 2007 08:28:22 -0700 (PDT) X-Virus-Checked: Checked by ClamAV on apache.org DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG� RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND� INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=43088 Summary: Excel file can't be loaded if comments exceed a size of 4111 characters Product: POI Version: 3.0 Platform: PC OS/Version: Windows XP Status: NEW Severity: normal Priority: P2 Component: HSSF AssignedTo: dev@poi.apache.org ReportedBy: jan.dostert@sap.com Hi, this bug seems to be similar to bug 42920 (Excel Comments). When attaching comments to a cell with poi-3.0.1-FINAL-20070705.jar and the comments exceed a size of 4111 characters, the file can't be loaded by Excel any more (I tried Excel 2003 and Excel 2007). There are no problems in saving the file. However, when opening the file with Excel, I get the error message "Excel found unreadable content in foo.xls". Attached a small test case which reproduces the problem. The created excel file works fine if the comment size is up to 4111 characters. But with a comment size of 4112 characters, the excel file can't be loaded any more. import java.io.FileOutputStream; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFClientAnchor; import org.apache.poi.hssf.usermodel.HSSFComment; import org.apache.poi.hssf.usermodel.HSSFPatriarch; import org.apache.poi.hssf.usermodel.HSSFRichTextString; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; public class Comments { public static void main(String args[]) throws Exception { HSSFWorkbook workBook = new HSSFWorkbook(); HSSFSheet sheet = workBook.createSheet(); HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); HSSFRow row = sheet.createRow(0); HSSFCell cell = row.createCell((short)0); // works with 4111 // broken with 4112 int size = 4112; StringBuffer toolTip = new StringBuffer(size); for (int i = 0; i < size; i++) { toolTip.append("."); } HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 0, 0, (short)0, 0, (short)1, 1); HSSFComment comment = patriarch.createComment(anchor); comment.setString(new HSSFRichTextString(toolTip.toString())); cell.setCellComment(comment); workBook.write(new FileOutputStream("foo.xls")); } } Regards, Jan -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org For additional commands, e-mail: dev-help@poi.apache.org