-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Description
This is:
- [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?
No blank page is created.
42-16 rows.
Highest row should be 26.
What is the current behavior?
When the last part of excel is deleted, unwanted rows remain in the printed area, making a blank page.
Highest row is 34.
What are the steps to reproduce?
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
removeRow();
my code
<?php
public function testExcel()
{
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Xlsx');
$excel = $this->_getTemplateExcel($reader, 'D:\Users\aung.zaw.htet\Desktop\dump\Template.xlsx');
$sheet = $excel->getSheetByName('Sheet1');
$sheet->removeRow(35, 8);
$sheet->removeRow(27, 8);
error_log(print_r($sheet->getHighestRow(), true ), 3, 'D:/Users/aung.zaw.htet/Desktop/dump/HighestRow.txt');
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($excel, 'Xlsx');
$writer->save('D:\Users\aung.zaw.htet\Desktop\dump\OutputFile.xlsx');
}
If this is an issue with reading a specific spreadsheet file, then it may be appropriate to provide a sample file that demonstrates the problem; but please keep it as small as possible, and sanitize any confidential information before uploading.
What features do you think are causing the issue
- Reader
- Writer
- Styles
- Data Validations
- Formula Calulations
- Charts
- AutoFilter
- Form Elements
Does an issue affect all spreadsheet file formats? If not, which formats are affected?
Which versions of PhpSpreadsheet and PHP are affected?
"phpoffice/phpspreadsheet": "^1.23", PHP 7.4.29
OutputFile.xlsx
[Template.xlsx](https://github.com/PHPOffice/PhpSpreadsheet/files/8990645/Template.xlsx
HighestRow.txt