i'm using v1.3.1 of phpspreadsheet.
i'm building an excel file (download) and everything's working fine. The only problem a have is to define the setPrintArea... It always returning me standards PrintArea into excel. Basicly, i build the excels lines and after define the printArea... I tried doing before too with no success.
$spreadsheet = IOFactory::load("template.xlsx");
$worksheet = $spreadsheet->getActiveSheet();
foreach ($rows AS $k => $v ) {
$worksheet->getCell('F' . ($k + 3))->setValue($v);
$worksheet->getCell('G' . ($k + 3))->setValue($v);
}
$worksheet->getPageSetup()->setPrintArea('A1:AG58');
...
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="' . $filename . '"');
header('Cache-Control: max-age=0');
$writer = IOFactory::createWriter($spreadsheet, 'Xls');
$writer->save('php://output'); //-- force download version
There's well 58 lines in the area but i cant get the set the area to the 'AG' cell... Basicly, i want to print all my excel in one page instead to 8.
Thx !