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 B339718593 for ; Tue, 16 Jun 2015 19:46:17 +0000 (UTC) Received: (qmail 20376 invoked by uid 500); 16 Jun 2015 19:46:17 -0000 Delivered-To: apmail-poi-dev-archive@poi.apache.org Received: (qmail 20334 invoked by uid 500); 16 Jun 2015 19:46:17 -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 20323 invoked by uid 99); 16 Jun 2015 19:46:17 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Jun 2015 19:46:17 +0000 Received: from asf-bz1-us-mid.priv.apache.org (nat1-us-mid.apache.org [23.253.172.122]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPS id 4D4271A04B1 for ; Tue, 16 Jun 2015 19:46:17 +0000 (UTC) Received: by asf-bz1-us-mid.priv.apache.org (ASF Mail Server at asf-bz1-us-mid.priv.apache.org, from userid 33) id 5956060B1C; Tue, 16 Jun 2015 19:46:16 +0000 (UTC) From: bugzilla@apache.org To: dev@poi.apache.org Subject: [Bug 58043] New: POI will not allow negative rotation of text using XSSF but does work for HSSF Date: Tue, 16 Jun 2015 19:46:15 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: POI X-Bugzilla-Component: XSSF X-Bugzilla-Version: 3.12-FINAL X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: mwilber@utilinc.com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dev@poi.apache.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bz.apache.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 https://bz.apache.org/bugzilla/show_bug.cgi?id=58043 Bug ID: 58043 Summary: POI will not allow negative rotation of text using XSSF but does work for HSSF Product: POI Version: 3.12-FINAL Hardware: PC Status: NEW Severity: major Priority: P2 Component: XSSF Assignee: dev@poi.apache.org Reporter: mwilber@utilinc.com Created attachment 32828 --> https://bz.apache.org/bugzilla/attachment.cgi?id=32828&action=edit Demonstrates inability to rotate text -90 degrees using XSSF I need to rotate text within a cell by -90 degrees. This feature works for a HSSF xls spreadsheet with POI. But it does not work for a XSSF xlsx spreadsheet with POI. The text remains at 0 degrees rotation. Attached is sample code that demonstrates the successful rotation using HSSF and the unsuccessful rotation using XSSF. Please correct this. Marty import java.io.FileOutputStream; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; public class TestExcel { private void createXls() { try { Workbook workbook = new HSSFWorkbook(); FileOutputStream fileOut = new FileOutputStream("c:/rotated.xls"); Sheet sheet1 = workbook.createSheet(); Row row1 = sheet1.createRow((short) 0); Cell cell1 = row1.createCell(0); cell1.setCellValue("Successful rotated text."); CellStyle style = workbook.createCellStyle(); style.setRotation((short) -90); cell1.setCellStyle(style); workbook.write(fileOut); fileOut.close(); } catch (Exception e) { e.printStackTrace(); } } private void createXlsx() { try { Workbook workbook = new XSSFWorkbook(); FileOutputStream fileOut = new FileOutputStream("c:/rotated.xlsx"); Sheet sheet1 = workbook.createSheet(); Row row1 = sheet1.createRow((short) 0); Cell cell1 = row1.createCell(0); cell1.setCellValue("Unsuccessful rotated text."); CellStyle style = workbook.createCellStyle(); style.setRotation((short) -90); cell1.setCellStyle(style); workbook.write(fileOut); fileOut.close(); } catch (Exception e) { e.printStackTrace(); } } public static void main(String[] args) throws Exception { TestExcel testExcel = new TestExcel(); testExcel.createXls(); testExcel.createXlsx(); } } -- 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