This repository was archived by the owner on May 26, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 642
Style not present when editing existing spreadsheet #855
Copy link
Copy link
Open
Description
I followed the example here on editing an existing sheet. The main thing I noticed is it is not including the styles I included in the sheet. I have multiple jobs that each are responsible for creating a sheet. After the first job is run, each subsequent job will pick up the same XLSX output file, first recreate each sheet (using the method in the link above) then create a new blank sheet to do it's own work.
I use the StyleBuilder to create bold, background color, etc. but it only ever shows up on the last sheet. Looking at the code block below, the $row object has a style property, but it does not show up in the output.
if (isset($reader)) {
foreach ($reader->getSheetIterator() as $sheetIndex => $sheet) {
if ($sheetIndex > 0) {
$writer->addNewSheetAndMakeItCurrent();
}
$newSheet = $writer->getCurrentSheet();
$newSheet->setName($sheet->getName());
foreach ($sheet->getRowIterator() as $rowIndex => $row) {
$writer->addRow($row); // this $row object has style present, but it is not displayed in the file
}
}
$reader->close();
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels