Open ItprojektRepo opened 2 months ago
Update.
First cell has to have a value in it. I had cell A1 empty and then it occured. If I put random valu in there then everything works.
So problem is instead in hasRows function `private function hasRows(): bool { $startCell = 'A1'; if ($this->exportable instanceof WithCustomStartCell) { $startCell = $this->exportable->startCell(); }
return $this->worksheet->cellExists($startCell);
}
`
@ItprojektRepo is it resolved on your end?
@ItprojektRepo is it resolved on your end?
I filled A1 cell with a static value for it to work. If I leave it blank then it overwrites first 1000 rows. And looking at this logic it will always overwrite every 1000 rows if I would have a blank value in column A.
So I simply made changes so my code would work, but the bug still exists.
Replacing blank data with non blank data, such as "-", can solve the problem
I don't see an easy other way to check if we are inserting in the first row, or if we are appending. If someone has a better way of doing this, please create a PR :)
Is the bug applicable and reproducable to the latest version of the package and hasn't it been reported before?
What version of Laravel Excel are you using?
3.1.55
What version of Laravel are you using?
11.10.0
What version of PHP are you using?
8.2.7
Describe your issue
FromArray export has only 1000 rows and only last data is present. Found that problem is in Sheet.php -> appendRows function It chunks 1000 and every time starts from cell A1. Meaning it overwrites existing data instead of appending
`public function appendRows($rows, $sheetExport) { if (method_exists($sheetExport, 'prepareRows')) { $rows = $sheetExport->prepareRows($rows); }
In here changing ->chunk(1000) to ->chunk(10000) prints all data
Reproducing: Export array that has more than 1000 rows. Using FromArray.
Currently using Concerns FromArray, WithTitle, WithCustomValueBinder
How can the issue be reproduced?
Reproducing: Export array that has more than 1000 rows. Using FromArray.
Currently using Concerns FromArray, WithTitle, WithCustomValueBinder
What should be the expected behaviour?
First rows are overwritten by rows that are over 1000