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

            Bug ID: 59853
           Summary: XSSFSheet PivotTable support doesn't support
                    Structured Reference (table) sources
           Product: POI
           Version: 3.15-dev
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: greg.wool...@gmail.com

The current helper methods to create a PivotTable in XSSFSheet have quite a bit
of useful logic, dealing with setting up the proper CT* objects and references
to
However, these only handle pivot tables based on AreaReferences.  Excel allows
PivotTables based on defined names and tables.

These are stored in a different field than the area reference, in
CTWorksheetSource.

Areas go in the "ref" attribute, as "A1:D10" style values.

Named Ranges and Table names go instead in the "name" attribute.  As far as I
can tell, they overload this field, and you have to check names and tables to
find the match, similar to how tables and ranges are both listed in Excel in
the Manage Names dialog.

How exactly to do this in POI is the question, and probably merits some
discussion. I'm willing to do the work and submit a patch, of course, but the
solution should have some level of agreement first to avoid unnecessary churn.

We could augment the current methods with similar ones that take a String name,
or add new objects that represent a named range or table.

Then we can refactor the XSSFSheet code a bit to isolate the CTWorksheetSource
element creation and avoid duplicating the rest of the setup logic.

Another option could be to just expose XSSFSheet.createPivotTable(), which
hooks up a new one to the sheet properly.  Callers would likely then want to
call XSSFPivotTable.setDefaultPivotTableDefinition() themselves to avoid
problems with incomplete definitions.

I may find other gaps/improvements for XSSFPivotTable as I move into my next
phase of investigation :)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to