Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set Excel sheet title with PHP Spout library

Tags:

php

spout

I am exporting Excel work book with more than 1 sheet using PHP Spout library.

How do I set the title for each sheet? By default it is giving sheet1 sheet2 etc.

And I need to provide hyperlink from sheet2 cells to sheet1 cells. How do I set hyperlinks using Spout?

like image 466
Chandra Sekar Avatar asked Oct 28 '25 03:10

Chandra Sekar


1 Answers

To set the title, you can do this:

$sheet = $writer->getCurrentSheet();
$sheet->setName('My custom name');

For hyperlinks, it's not possible to reference another sheet unfortunately

like image 114
Adrien Avatar answered Oct 29 '25 19:10

Adrien