I created https://bz.apache.org/bugzilla/show_bug.cgi?id=66661 and included an API call that seems to workaround the issue.
Can we continue any discussion about this in the bug tracker? On Tuesday 20 June 2023 at 23:00:22 IST, PJ Fanning <fannin...@yahoo.com.invalid> wrote: That was a GitHub PR - https://github.com/apache/poi/pull/269 It would be a pity to revert a PR that has test coverage to fix an issue that was untested. The PR 269 change has been in place for 4 releases. I think it would be better for someone to try to fix the new scenario instead of just reverting code that at least 1 user thinks was a good idea. On Tuesday 20 June 2023 at 22:43:40 IST, Dominik Stadler <dominik.stad...@gmx.at> wrote: Hi, thanks for the detailed report! A quick "git bisect" with your code points at the following change: https://svn.apache.org/viewvc?view=revision&revision=1894695 Maybe Fanning PJ still remembers some details about the change and if we can revert parts of it to restore this functionality. Thanks... Dominik. On Tue, Jun 20, 2023 at 11:40 AM <maniactwister....@s7t.de> wrote: > Hello, > > i have a problem with the setTotalsRowFunction / setCellFormula method > starting with poi version 5.2.0 and above. In previous versions > including 5.1.0 everything works fine. > > Excel complains about a broken worksheet and after repairing the > totalsrow is inside the table. I compared the resulting xml files and > noticed the following difference: > > diff --color -ur works/xl/worksheets/sheet1.xml > broken/xl/worksheets/sheet1.xml > --- works/xl/worksheets/sheet1.xml 2023-06-20 11:31:01.313017689 +0200 > +++ broken/xl/worksheets/sheet1.xml 2023-06-20 11:30:57.709657562 +0200 > @@ -81,10 +81,10 @@ > <v>4</v> > </c> > <c r="B6"> > - <f>SUBTOTAL(109,Table1[Heading2])</f> > + <f>SUBTOTAL(109,Sheet0!B2:B6)</f> > </c> > <c r="C6"> > - <f>SUBTOTAL(109,Table1[Heading3])</f> > + <f>SUBTOTAL(109,Sheet0!C2:C6)</f> > </c> > <c r="D6" t="s"> > <v>4</v> > > For some reason poi >= 5.2.0 rewrites the cell formula from table > columns to a normal range. > > > Under [1] i have pushed a simple test case to reproduce the issue - > including the resulting xlsx and the extracted and formated xml files. > (The test case is copied from this stackoverflow [2] question) > > Does someone have an idea how to solve this? > > [1] https://github.com/ManiacTwister/poi-table-bisect > [2] > > https://stackoverflow.com/questions/68783226/apache-poi-set-cell-format-that-include-the-result-of-table-total-row > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@poi.apache.org > For additional commands, e-mail: user-h...@poi.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@poi.apache.org For additional commands, e-mail: user-h...@poi.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@poi.apache.org For additional commands, e-mail: user-h...@poi.apache.org