Return-Path: Mailing-List: contact poi-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list poi-dev@jakarta.apache.org Received: (qmail 16806 invoked from network); 25 Mar 2003 10:40:44 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 25 Mar 2003 10:40:44 -0000 Received: (qmail 25833 invoked by uid 50); 25 Mar 2003 10:42:42 -0000 Date: 25 Mar 2003 10:42:42 -0000 Message-ID: <20030325104242.25832.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: poi-dev@jakarta.apache.org Cc: Subject: DO NOT REPLY [Bug 18311] New: - Writing Formula to Excel workbook - mutliple paste formula X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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://nagoya.apache.org/bugzilla/show_bug.cgi?id=18311 Writing Formula to Excel workbook - mutliple paste formula Summary: Writing Formula to Excel workbook - mutliple paste formula Product: POI Version: unspecified Platform: PC OS/Version: Windows XP Status: NEW Severity: Normal Priority: Other Component: HSSF AssignedTo: poi-dev@jakarta.apache.org ReportedBy: gaughana@ebrd.com I think this bug is related to 15223 but I am logging it again because I think I have a bit more detail. This appears to be one of those obscure bugs that only appears under certain circumstances. I am reading an existing Excel workbook (excel.xls), amending some values (omitted from the test case) and writing out the resultant workbook (poi.xls). In Excel creating the original workbook, I have entered two rows of numbers. I have also defined a summation row. I declare a formula for a cell, copy it then :- 1) paste it individually to any number of subsequent cells across a row the workbook is written out correctly 2) paste it simultaneously to up to 5 subsequent cells in the row the workbook is written out correctly 3) paste it simultaneously to more than 5 subsequent cells in the row the original formula cell is OK but the others have #REF! error and when the workbook is opened in Excel you get the error "File error: data may have been lost." Test Case --------- String filename = "Excel.xls" ; FileInputStream fis = new FileInputStream( filename ); POIFSFileSystem fs = new POIFSFileSystem( fis ); HSSFWorkbook wb = new HSSFWorkbook( fs ); FileOutputStream fos = new FileOutputStream( "Poi.xls" ); wb.write( fos ); fos.close(); Environment ----------- POI : jakarta-poi-1.11.0-dev-20030324.jar Java : 1.4.1 b21 Excel : 2002 SP-2 OS : XP 5.1.2600