Return-Path: Delivered-To: apmail-poi-dev-archive@www.apache.org Received: (qmail 50834 invoked from network); 17 Sep 2009 00:33:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Sep 2009 00:33:47 -0000 Received: (qmail 27453 invoked by uid 500); 17 Sep 2009 00:33:47 -0000 Delivered-To: apmail-poi-dev-archive@poi.apache.org Received: (qmail 27391 invoked by uid 500); 17 Sep 2009 00:33:47 -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 27371 invoked by uid 99); 17 Sep 2009 00:33:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Sep 2009 00:33:47 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Sep 2009 00:33:43 +0000 Received: by brutus.apache.org (Postfix, from userid 33) id 07B85234C1E9; Wed, 16 Sep 2009 17:33:21 -0700 (PDT) From: bugzilla@apache.org To: dev@poi.apache.org Subject: DO NOT REPLY [Bug 47855] New: java.lang.RuntimeException: Shared Formula Conversion: Coding Error X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: POI X-Bugzilla-Component: HSSF X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kevinrmckee@hotmail.com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dev@poi.apache.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Wed, 16 Sep 2009 17:33:21 -0700 (PDT) X-Virus-Checked: Checked by ClamAV on apache.org https://issues.apache.org/bugzilla/show_bug.cgi?id=47855 Summary: java.lang.RuntimeException: Shared Formula Conversion: Coding Error Product: POI Version: unspecified Platform: PC OS/Version: Windows Vista Status: NEW Severity: normal Priority: P2 Component: HSSF AssignedTo: dev@poi.apache.org ReportedBy: kevinrmckee@hotmail.com CC: kevinrmckee@hotmail.com Depends on: 47747 +++ This bug was initially created as a clone of Bug #47747 +++ since nobody in the community will respond to my comments in bug 47747, perhaps a new bug entry will warrant a reply? Created an attachment (id=24176) --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24176) This zip contains the original and processed spreadsheets. I have tried version 3.5, 3.6 and 3.7. When trying to run the following code to go through a spreadsheet and update the formula values, I get several errors (java.lang.RuntimeException: Shared Formula Conversion: Coding Error). When I open the newly created spreadsheet, several cells have #REF issues. I will attach the original and processed spreadsheets. public static void RecalculateFormulas(String filename) throws FileNotFoundException, IOException { try{ FileInputStream fis = new FileInputStream(filename); FileOutputStream out = new FileOutputStream(filename.replaceAll(".xls","temp.xls")); HSSFWorkbook wb = new HSSFWorkbook(fis); //or new XSSFWorkbook("/somepath/test.xls") FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator(); for(int sheetNum = 0; sheetNum < wb.getNumberOfSheets(); sheetNum++) { org.apache.poi.ss.usermodel.Sheet sheet = wb.getSheetAt(sheetNum); for(org.apache.poi.ss.usermodel.Row r : sheet) { for(org.apache.poi.ss.usermodel.Cell c : r) { if(c.getCellType() == org.apache.poi.ss.usermodel.Cell.CELL_TYPE_FORMULA) { try{evaluator.evaluateFormulaCell(c);} catch(Exception e) {System.out.println(e.toString());} } } } } wb.write(out); out.close(); } catch(Exception e) {System.out.println(e.toString()); } } -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org For additional commands, e-mail: dev-help@poi.apache.org