Creating a new PHPExcel Object.
$this->PHPExcel = new PHPExcel();
A new sheet can be added to the excel file using:
$this->activeSheet = $this->PHPExcel->createSheet();
and the sheet title can be set or renamed using:
$this->activeSheet->setTitle($title);
Getting the active sheet:
`$this->activeSheet = $this->PHPExcel->getActiveSheet();'
Setting the active sheet:
$sheetIndex = 2;
$this->PHPExcel->setActiveSheetIndex($sheetIndex)
Setting the width of a specific column.
$this->activeSheet
->getColumnDimension($colString)
->setWidth($width);
Setting the default column width/row height for an entire sheet.
$this->activeSheet
->getDefaultColumnDimension()
->setWidth($width);
$this->activeSheet
->getDefaultRowDimension()
->setRowHeight($height);
Setting default styles for the active sheet
$this->activeSheet
->getDefaultStyle()
->applyFromArray($this->defaultStyle);