Return-Path: X-Original-To: apmail-poi-dev-archive@www.apache.org Delivered-To: apmail-poi-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9405CDA28 for ; Fri, 3 Aug 2012 16:31:03 +0000 (UTC) Received: (qmail 85259 invoked by uid 500); 3 Aug 2012 16:31:03 -0000 Delivered-To: apmail-poi-dev-archive@poi.apache.org Received: (qmail 85162 invoked by uid 500); 3 Aug 2012 16:31:02 -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 85144 invoked by uid 99); 3 Aug 2012 16:31:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Aug 2012 16:31:02 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.115] (HELO eir.zones.apache.org) (140.211.11.115) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Aug 2012 16:31:01 +0000 Received: by eir.zones.apache.org (Postfix, from userid 80) id F1C4B5912; Fri, 3 Aug 2012 16:30:40 +0000 (UTC) From: bugzilla@apache.org To: dev@poi.apache.org Subject: [Bug 53650] New: SXSSF can be made to output corrupt XLSX files Date: Fri, 03 Aug 2012 16:30:39 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: POI X-Bugzilla-Component: SXSSF X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: apache.org@davel.me.uk X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dev@poi.apache.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: priority bug_id assigned_to short_desc bug_severity classification op_sys reporter rep_platform bug_status version component product Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org https://issues.apache.org/bugzilla/show_bug.cgi?id=53650 Priority: P2 Bug ID: 53650 Assignee: dev@poi.apache.org Summary: SXSSF can be made to output corrupt XLSX files Severity: normal Classification: Unclassified OS: Linux Reporter: apache.org@davel.me.uk Hardware: PC Status: NEW Version: unspecified Component: SXSSF Product: POI Created attachment 29162 --> https://issues.apache.org/bugzilla/attachment.cgi?id=29162&action=edit Spreadsheet which SXSSF cannot process I am attempting to use SXSSF to add data to a template XLSX file. I have a XLSX file produced by Excel for Mac 2011 version 14.2.3, which when processed with the attached minimal Java produces a file which does not open in Excel, but does open in Open Office. Excel reports the file as broken and offer repair, which removes all the additions placed in by the Java code. I am using POI 3.8. XSSF is able to process the file correctly. Minimal Java below, package sheet2test; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.xssf.streaming.SXSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; /** * * @author davel */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { try { final Workbook wb = new SXSSFWorkbook(new XSSFWorkbook(new FileInputStream("template.xlsx"))); Sheet currentSheet = wb.getSheetAt(1); Row currentRow = currentSheet.createRow(1); Cell currentCell = currentRow.createCell(1); currentCell.setCellType(Cell.CELL_TYPE_STRING); currentCell.setCellValue("hello world!"); FileOutputStream out = new FileOutputStream("broken.xlsx"); wb.write(out); } catch (IOException e) { System.err.println("Could not write output file"); } } } Kind regards, Dave Lambley -- 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