Laravel-excel: Default sheet

Created on 10 Feb 2015  路  4Comments  路  Source: Maatwebsite/Laravel-Excel

Hi there!

That's very handy addon for Laravel! I am trying to figure out is there a way to set default opened sheet for xlsx file (it always opens last created sheet)?

Most helpful comment

Actually this seems to work when setting after adding all the sheets:

$excel->setActiveSheetIndex(0);

Seems like the index is being set internally when rendering here - https://github.com/Maatwebsite/Laravel-Excel/blob/2.1/src/Maatwebsite/Excel/Writers/LaravelExcelWriter.php#L486

All 4 comments

Glad you like the package.

Don't think there is, sorry.

still no way for this? any way for it to open the first sheet instead?

These questions should be asked at the parent package PHPExcel. These core functionalities are not something we can add.

Actually this seems to work when setting after adding all the sheets:

$excel->setActiveSheetIndex(0);

Seems like the index is being set internally when rendering here - https://github.com/Maatwebsite/Laravel-Excel/blob/2.1/src/Maatwebsite/Excel/Writers/LaravelExcelWriter.php#L486

Was this page helpful?
0 / 5 - 0 ratings