You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [x] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)
What is the expected behavior?
When deleting a row (single or multiple), "SUM" formula doesn't update correctly if remains only one row.
What is the current behavior?
For example: I have a row with a SUM formula of type SUM(C6:C11).
Now, I need to delete rows between C7 and C11 included. I expect the SUM formula updated to SUM(C6) or SUM(C6:C6). But in this case, the formula update to SUM(C6:C7) that raise a recursive formula error
What are the steps to reproduce?
<?phprequire__DIR__ . '/vendor/autoload.php';
// Create new Spreadsheet object$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$spreadsheet->getActiveSheet()->removeRow(6, 4);
Which versions of PhpSpreadsheet and PHP are affected?
latest
Possible solution:
I've do some tests on my pc, and I ended up that, in case of row deletion, the calculation does with insertRowBefore with a new row of type A . row rowsToDelete is not working correctly.
Maybe, a way to solve this is to do that:
This is:
What is the expected behavior?
When deleting a row (single or multiple), "SUM" formula doesn't update correctly if remains only one row.
What is the current behavior?
For example: I have a row with a SUM formula of type SUM(C6:C11).
Now, I need to delete rows between C7 and C11 included. I expect the SUM formula updated to SUM(C6) or SUM(C6:C6). But in this case, the formula update to SUM(C6:C7) that raise a recursive formula error
What are the steps to reproduce?
Which versions of PhpSpreadsheet and PHP are affected?
latest
Possible solution:
I've do some tests on my pc, and I ended up that, in case of row deletion, the calculation does with insertRowBefore with a new row of type A . row rowsToDelete is not working correctly.
Maybe, a way to solve this is to do that:
ReferenceHelper.php
and then use, in the method, $pBeforeDelete instead of $pBefore when calling updateFormulaReferences
The text was updated successfully, but these errors were encountered: