You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2019/02/07 10:01:48 UTC

[Bug 63152] New: Too many identical CellStyles cause .xls to be incorrectly rendered in Office 365

https://bz.apache.org/bugzilla/show_bug.cgi?id=63152

            Bug ID: 63152
           Summary: Too many identical CellStyles cause .xls to be
                    incorrectly rendered in Office 365
           Product: POI
           Version: 4.0.0-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
          Assignee: dev@poi.apache.org
          Reporter: anthonyv.be@outlook.com
  Target Milestone: ---

Created attachment 36429
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36429&action=edit
A test case to reproduce the issue

Please find a reproducer in attachment.
This is with Java 11 and POI 4.0.1.

When I create too many identical CellStyle instances, Office 365 only applies
the first X of them. For example, the reproducer creates the same CellStyle for
44 Cells. However, in Office 365, only the first 43 have the CellStyle applied.
Note that LibreOffice 6.1.4.2 renders this correctly. I don't have older
versions of Office available, to see how they render the file.

In the reproducer there are 2 workarounds/hacks I found:
1) apply HSSFOptimiser.optimiseCellStyles(wb); before saving the Workbook
2) make each CellStyle different by creating a new Font for each:
style.setFont(wb.createFont());

What I would like, is that POI throws an Exception at some point (I propose
some kind of IOException upon Workbook.write), when there are too many
identical CellStyles. The exception message could then explain that Office 365
won't properly render the file, and that it's best to properly manage
CellStyles by creating "logical CellStyles", but that a quick workaround is to
invoke HSSFOptimiser.optimiseCellStyles just before saving the file.

-- 
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


[Bug 63152] Too many identical CellStyles cause .xls to be incorrectly rendered in Office 365

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63152

blackbear.coleman@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |blackbear.coleman@gmail.com

-- 
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


[Bug 63152] Too many identical CellStyles cause .xls to be incorrectly rendered in Office 365

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63152

--- Comment #1 from blackbear.coleman@gmail.com ---
Created attachment 36766
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36766&action=edit
Another test case with style changes and SXSSF

An example which shows that even if the style changes, they are not rendered
properly for HSSFWorksheet and confirmation that they are rendered properly for
SXSSFWorksheet.

-- 
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


[Bug 63152] Too many identical CellStyles cause .xls to be incorrectly rendered in Office 365

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63152

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

-- 
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