-
I am trying to access the sheet view and especially the setFreezeRow method in order to freeze the first row of a sheet when generating an Excel file. I can initialize a SheetView object by $sheetView = new SheetView(); but I cannot find a method to attach this to the Spatie\SimpleExcel\SimpleExcelWriter object. I was expecting something like $sheet = $writer->getCurrentSheet() or similar. I am probably missing something very simple here. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It is mentioned in the Spatie package documentation at the very bottom: $writer->getWriter() And to freeze the top row: $sheetView = new SheetView(); with $writer being an instance of SimpleExcelWriter |
Beta Was this translation helpful? Give feedback.
It is mentioned in the Spatie package documentation at the very bottom:
$writer->getWriter()
And to freeze the top row:
$sheetView = new SheetView();
$sheetView->setFreezeRow(2);
$writer->getWriter()->getCurrentSheet()->setSheetView($sheetView);
with $writer being an instance of SimpleExcelWriter