mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-10-08 12:56:39 +00:00
Final Touch-up
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||
use PhpOffice\PhpSpreadsheet\Writer\Html as HtmlWriter;
|
||||
|
||||
require __DIR__ . '/../Header.php';
|
||||
|
||||
$inputFileName = 'TableFormat.xlsx';
|
||||
$inputFilePath = __DIR__ . '/../templates/' . $inputFileName;
|
||||
|
||||
$codePath = $helper->isCli() ? ('samples/templates/' . $inputFileName) : ('<code>' . 'samples/templates/' . $inputFileName . '</code>');
|
||||
$helper->log('Read ' . $codePath);
|
||||
$reader = IOFactory::createReader('Xlsx');
|
||||
$reader->setReadDataOnly(false);
|
||||
$spreadsheet = $reader->load($inputFilePath);
|
||||
$helper->log('Enable table formatting output');
|
||||
$helper->log('Enable conditional formatting output');
|
||||
|
||||
function writerCallback(HtmlWriter $writer): void
|
||||
{
|
||||
$writer->setPreCalculateFormulas(true);
|
||||
$writer->setTableFormats(true);
|
||||
$writer->setConditionalFormatting(true);
|
||||
}
|
||||
|
||||
// Save
|
||||
$helper->write($spreadsheet, __FILE__, ['Html'], false, writerCallback: writerCallback(...));
|
||||
Reference in New Issue
Block a user