protected function addSheet($name) { $sheet = new PHPExcel_Worksheet($this->excel, $name); $sheet->getSheetView()->setZoomScale(75); $this->excel->addSheet($sheet); $this->excel->setActiveSheetIndex($this->excel->getSheetCount() - 1); $this->sheet = $sheet; }
/** * Write PLV Record */ private function _writePageLayoutView() { $record = 0x88b; // Record identifier $length = 0x10; // Bytes to follow $rt = 0x88b; // 2 $grbitFrt = 0x0; // 2 $reserved = 0x0; // 8 $wScalvePLV = $this->_phpSheet->getSheetView()->getZoomScale(); // 2 // The options flags that comprise $grbit if ($this->_phpSheet->getSheetView()->getView() == PHPExcel_Worksheet_SheetView::SHEETVIEW_PAGE_LAYOUT) { $fPageLayoutView = 1; } else { $fPageLayoutView = 0; } $fRulerVisible = 0; $fWhitespaceHidden = 0; $grbit = $fPageLayoutView; // 2 $grbit |= $fRulerVisible << 1; $grbit |= $fWhitespaceHidden << 3; $header = pack("vv", $record, $length); $data = pack("vvVVvv", $rt, $grbitFrt, 0x0, 0x0, $wScalvePLV, $grbit); $this->_append($header . $data); }
if (($fmtRuns = $this->_sst[$index]['fmtRuns']) && !$this->_readDataOnly) { // then we should treat as rich text $richText = new PHPExcel_RichText(); $charPos = 0; $sstCount = count($this->_sst[$index]['fmtRuns']); for ($i = 0; $i <= $sstCount; ++$i) { if (isset($fmtRuns[$i])) { $text = PHPExcel_Shared_String::Substring($this->_sst[$index]['value'], $charPos, $fmtRuns[$i]['charPos'] - $charPos); $charPos = $fmtRuns[$i]['charPos']; } else { $text = PHPExcel_Shared_String::Substring($this->_sst[$index]['value'], $charPos, PHPExcel_Shared_String::CountCharacters($this->_sst[$index]['value'])); } if (PHPExcel_Shared_String::CountCharacters($text) > 0) { if ($i == 0) {
/** * Store the window zoom factor. This should be a reduced fraction but for * simplicity we will store all fractions with a numerator of 100. */ private function _writeZoom() { // If scale is 100 we don't need to write a record if ($this->_phpSheet->getSheetView()->getZoomScale() == 100) { return; } $record = 0xa0; // Record identifier $length = 0x4; // Bytes to follow $header = pack("vv", $record, $length); $data = pack("vv", $this->_phpSheet->getSheetView()->getZoomScale(), 100); $this->_append($header . $data); }