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 2017/05/10 22:24:14 UTC

[Bug 61085] New: StylesTable doesn't include table styles

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

            Bug ID: 61085
           Summary: StylesTable doesn't include table styles
           Product: POI
           Version: 3.17-dev
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: gwoolsey@apache.org
  Target Milestone: ---

The OOXML styles.xml includes a <tableStyles> collection defining custom styles
for data tables and pivot tables.  The StylesTable class should know about
them.

Further, it should know about the built-in styles defined in the OOXML spec
Annex G.

The XML definitions of these can be found here:

http://www.ecma-international.org/news/TC45_current_work/OfficeOpenXML-SpreadsheetMLStyles.zip

These are not in the same format as styles.xml, unfortunately, but recognizable
as similar.

Table styles are referenced by name, not index as other style elements, but
refer to <dxf> elements in the same collection as other types of styles, like
conditional formatting rules, by the same indexes.

It is quite possible, even likely that a single workbook will have <dxf>
elements for both conditional formats and tables, and possibly even share some
between them if they are identical in definition (don't have proof of this, but
the spec indicates it could happen).

StylesTable should have name based getter functionality, and the new TableStyle
or whatever class should know about the list of possible style dxfs.  These are
referenced by type name, and have a well-defined application hierarchy in the
spec.

The resulting API should make it easy to navigate table styles by name, and
then the styles of an element by both type and cell within a table, finding the
ordered set of styles to process for a given cell given its table position and
the table style configuration (boolean properties for things like whether or
not to use alternating row styles).

-- 
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 61085] StylesTable doesn't include table styles

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

Greg Woolsey <gw...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

-- 
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 61085] StylesTable doesn't include table styles

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

--- Comment #2 from Greg Woolsey <gw...@apache.org> ---
Huh.  Unit test was failing, it turns out the canonical presetTableStyles.xml
from ECMA has a typo - a trailing space in a name attribute, making string
comparisons fail.

Correcting the value in the copy that will end up in POI.

-- 
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 61085] StylesTable doesn't include table styles

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

--- Comment #3 from Greg Woolsey <gw...@apache.org> ---
Wow.  So the standards document uses 1 based indexing for dxfId in the
<tableStyleElement> element, but Excel uses 0 based indexing.  Built-in style
parsing needs to be different than custom/user style parsing.

-- 
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 61085] StylesTable doesn't include table styles

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

Greg Woolsey <gw...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement

-- 
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 61085] StylesTable doesn't include table styles

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

--- Comment #1 from Greg Woolsey <gw...@apache.org> ---
My plan here is to implement built-in table/pivot styles loosely following the
pattern used for PresetGeometries:

* include the XML as a resource in the build/source control
* parse it and initialize definition objects lazily in a static/singleton

I'm adding some interfaces to the ss package, and implementing classes to
simplify access to the underlying structures, which are a bit convoluted (of
course), and share some similarities to things like conditional formatting rule
style definitions - both use <dxf> objects in the same <dxfs> collection to
define style info.  

My client app will want to generate style info for both and possibly combine
them, i.e. when a cell in a table is also conditionally formatted, so a common
API for similar/same structures will be helpful.

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