PHP_XLSXWriter
PHP_XLSXWriter copied to clipboard
Show hide grid line code modifications
/* custom code to hide or show grid line */
protected $showGridLines;/*custom code to hide or show grid line */
public function __construct()
{
if(!ini_get('date.timezone'))
{
//using date functions can kick out warning if this isn't set
date_default_timezone_set('UTC');
}
$this->addCellStyle($number_format='GENERAL', $style_string=null);
$this->addCellStyle($number_format='GENERAL', $style_string=null);
$this->addCellStyle($number_format='GENERAL', $style_string=null);
$this->addCellStyle($number_format='GENERAL', $style_string=null);
$this->setShowGridLines('true');/*custom code to hide or show grid line */
}
/*Added by on 29042019 custom code to hide or show grid line */
public function setShowGridLines($show=true) { $this->showGridLines=$show; }
public function getShowGridLines() { return $this->showGridLines; }
/*Added by on 29042019 custom code to hide or show grid line */
protected function initializeSheet($sheet_name, $col_widths=array(), $auto_filter=false, $freeze_rows=false, $freeze_columns=false ){
.
.
.
.
$sheet->file_writer->write( '<sheetView colorId="64" defaultGridColor="true" rightToLeft="false" showFormulas="false" showGridLines="'.$this->getShowGridLines().'" showOutlineSymbols="true" showRowColHeaders="true" showZeros="true" tabSelected="' . $tabselected . '" topLeftCell="A1" view="normal" windowProtection="false" workbookViewId="0" zoomScale="100" zoomScaleNormal="100" zoomScalePageLayoutView="100">');
.
.
.
.
}
Usage : $writer = new XLSXWriter(); $writer->setShowGridLines('false');