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
Multiple sheets can't work.
Actually the code can't support multiple sheets.
In the encode method, sheetIndex is never increased.
Adding this will fix it:
if ($sheetIndex > 0) {
$spreadsheet->createSheet($sheetIndex);
}
$spreadsheet->setActiveSheetIndex($sheetIndex);
$sheetIndex++;