I have got my Excel reader to work but there is an annoying problem where I can only find information on how to apply a border to a range of cells, which is useless for my application.
Users upload Excel sheets that can be viewed later on. So the cell range method won't work since the range changes.
Is there not a default parameter to set all cell styles etc?
Here is what I have:
require_once ROOT . '/libs/PHPExcel/IOFactory.php';
$excel = PHPExcel_IOFactory::load('../public_html/uploads/' . $filename);
PHPExcel_Shared_Font::setAutoSizeMethod(PHPExcel_Shared_Font::AUTOSIZE_METHOD_EXACT);
$writer = PHPExcel_IOFactory::createWriter($excel, 'HTML');
$writer->setUseInlineCSS(true);
$styleArray = array(
'borders' => array(
'allborders' => array(
'style' => PHPExcel_Style_Border::BORDER_THIN
)
)
);
$excel->getActiveSheet()->getStyle('A1:B1')->applyFromArray($styleArray);
unset($styleArray);
$writer->save('uploads/excel-sheet.html');
header('Location: ' . WROOT . 'uploads/excel-sheet.html');