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 2022/08/13 14:05:06 UTC

[Bug 66211] New: XSSFTable.updateHeaders will not work for Worksheets created using current Excel versions

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

            Bug ID: 66211
           Summary: XSSFTable.updateHeaders will not work for Worksheets
                    created using current Excel versions
           Product: POI
           Version: 5.2.2-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: axel.richter.privat@web.de
  Target Milestone: ---

See
https://svn.apache.org/viewvc/poi/tags/REL_5_2_2/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTable.java?view=markup#l778

if (row != null && row.getCTRow().validate()) will never be true when CTRow
looks like so:

<row r="4" spans="1:3" x14ac:dyDescent="0.25">

CTRow.validate() will return false because of the not known x14ac:dyDescent.

See also
https://stackoverflow.com/questions/55532006/renaming-headers-of-xssftable-with-apache-poi-leads-to-corrupt-xlsx-file/55539181#55539181
and
https://stackoverflow.com/questions/73339524/xssfworkbook-clonesheet-corrupts-workbook-if-sheet-contains-a-table

https://stackoverflow.com/questions/73339524/xssfworkbook-clonesheet-corrupts-workbook-if-sheet-contains-a-table
contains a fix for XSSFTable.updateHeaders

-- 
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 66211] XSSFTable.updateHeaders will not work for Worksheets created using current Excel versions

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

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

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

--- Comment #4 from Dominik Stadler <do...@gmx.at> ---
This caused a few regressions in the mass-regression-test, e.g. the file at
http://people.apache.org/~centic/poi_regression/reports/binaries.templates.cdn.office.net_support_templates_es-es_tf16410091_win32.xltx.xlsx
processed via XSSFFileHandler will fail now.

Do we need a more advanced validation-logic here?

-- 
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 66211] XSSFTable.updateHeaders will not work for Worksheets created using current Excel versions

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

PJ Fanning <fa...@yahoo.com> changed:

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

--- Comment #1 from PJ Fanning <fa...@yahoo.com> ---
Thanks Axel. I've added r1903390. Would you have the dummy_template.xlsx file
from
https://stackoverflow.com/questions/55532006/renaming-headers-of-xssftable-with-apache-poi-leads-to-corrupt-xlsx-file/55539181#55539181
? I'd like to try to add a test case.

-- 
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 66211] XSSFTable.updateHeaders will not work for Worksheets created using current Excel versions

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

--- Comment #6 from PJ Fanning <fa...@yahoo.com> ---
I tried this test but it won't fail.

```
    @Test
    void testRegression66211() throws Exception {
        File file = XSSFTestDataSamples.getSampleFile(
               
"binaries.templates.cdn.office.net_support_templates_es-es_tf16410091_win32.xltx.xlsx");
        try (
                FileInputStream fis = new FileInputStream(file);
                XSSFWorkbook workbook = new XSSFWorkbook(fis)
        ) {
            XSSFFormulaEvaluator formulaEvaluator =
workbook.getCreationHelper().createFormulaEvaluator();
            formulaEvaluator.evaluateAll();
            XSSFSheet newSheet0 = workbook.cloneSheet(0);
            XSSFSheet newSheet1 = workbook.cloneSheet(1);
            XSSFSheet newSheet2 = workbook.cloneSheet(2);
        }
    }
```

-- 
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 66211] XSSFTable.updateHeaders will not work for Worksheets created using current Excel versions

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

--- Comment #3 from PJ Fanning <fa...@yahoo.com> ---
added test case with r1903393

-- 
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 66211] XSSFTable.updateHeaders will not work for Worksheets created using current Excel versions

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

PJ Fanning <fa...@yahoo.com> 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 66211] XSSFTable.updateHeaders will not work for Worksheets created using current Excel versions

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

--- Comment #2 from Axel Richter <ax...@web.de> ---
Created attachment 38364
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=38364&action=edit
Sample file created using Excel 365

-- 
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 66211] XSSFTable.updateHeaders will not work for Worksheets created using current Excel versions

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

--- Comment #5 from PJ Fanning <fa...@yahoo.com> ---
This regression seems to happen with
o.a.p.xssf.usermodel.XSSFWorkbook.cloneSheet(XSSFWorkbook.java:710)

I think we've hit a few issues cloning sheets with charts.

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