Vendor/phpspreadsheet/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php
private function writeSheetViews(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet)
    {
        // sheetViews
        $objWriter->startElement('sheetViews');

        // Sheet selected?
        $sheetSelected = false;
        if ($this->getParentWriter()->getSpreadsheet()->getIndex($pSheet) == $this->getParentWriter()->getSpreadsheet()->getActiveSheetIndex()) {
            $sheetSelected = true;
        }

        // sheetView
        $objWriter->startElement('sheetView');
        $objWriter->writeAttribute('tabSelected', $sheetSelected ? '1' : '0');
        $objWriter->writeAttribute('workbookViewId', '0');

        // Zoom scales
        if ($pSheet->getSheetView()->getZoomScale() != 100) {
            $objWriter->writeAttribute('zoomScale', $pSheet->getSheetView()->getZoomScale());
        }
        if ($pSheet->getSheetView()->getZoomScaleNormal() != 100) {
            $objWriter->writeAttribute('zoomScaleNormal', $pSheet->getSheetView()->getZoomScaleNormal());
        }

        // View Layout Type
        if ($pSheet->getSheetView()->getView() !== SheetView::SHEETVIEW_NORMAL) {
            $objWriter->writeAttribute('view', $pSheet->getSheetView()->getView());
        }

        // Gridlines
        if ($pSheet->getShowGridlines()) {
            $objWriter->writeAttribute('showGridLines', 'true');
        } else {
            $objWriter->writeAttribute('showGridLines', 'false');
        }

        // Row and column headers
        if ($pSheet->getShowRowColHeaders()) {
            $objWriter->writeAttribute('showRowColHeaders', '1');
        } else {
            $objWriter->writeAttribute('showRowColHeaders', '0');
        }

        // Right-to-left
        if ($pSheet->getRightToLeft()) {
            $objWriter->writeAttribute('rightToLeft', 'true');
        }

        $activeCell = $pSheet->getActiveCell();

        // Pane
        $pane = '';
        if ($pSheet->getFreezePane()) {
            list($xSplit, $ySplit) = Coordinate::coordinateFromString($pSheet->getFreezePane());
            $xSplit = Coordinate::columnIndexFromString($xSplit);
            --$xSplit;
            --$ySplit;

            $topLeftCell = $pSheet->getTopLeftCell();
            $activeCell = $topLeftCell;

            // pane
            $pane = 'topRight';
            $objWriter->startElement('pane');
            if ($xSplit > 0) {
                $objWriter->writeAttribute('xSplit', $xSplit);
            }
            if ($ySplit > 0) {
                $objWriter->writeAttribute('ySplit', $ySplit);
                $pane = ($xSplit > 0) ? 'bottomRight' : 'bottomLeft';
            }
            $objWriter->writeAttribute('topLeftCell', $topLeftCell);
            $objWriter->writeAttribute('activePane', $pane);
            $objWriter->writeAttribute('state', 'frozen');
            $objWriter->endElement();

            if (($xSplit > 0) && ($ySplit > 0)) {
                //    Write additional selections if more than two panes (ie both an X and a Y split)
                $objWriter->startElement('selection');
                $objWriter->writeAttribute('pane', 'topRight');
                $objWriter->endElement();
                $objWriter->startElement('selection');
                $objWriter->writeAttribute('pane', 'bottomLeft');
                $objWriter->endElement();
            }
        }

        // Selection
        // Only need to write selection element if we have a split pane
        // We cheat a little by over-riding the active cell selection, setting it to the split cell
        $objWriter->startElement('selection');
        if ($pane != '') {
            $objWriter->writeAttribute('pane', $pane);
        }
        $objWriter->writeAttribute('activeCell', $activeCell);
        $objWriter->writeAttribute('sqref', $activeCell);
        $objWriter->endElement();

        $objWriter->endElement();

        $objWriter->endElement();
    }
private function writeSheetViews(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet)
    {
        // sheetViews
        $objWriter->startElement('sheetViews');

        // Sheet selected?
        $sheetSelected = false;
        if ($this->getParentWriter()->getSpreadsheet()->getIndex($pSheet) == $this->getParentWriter()->getSpreadsheet()->getActiveSheetIndex()) {
            $sheetSelected = true;
        }

        // sheetView
        $objWriter->startElement('sheetView');
        $objWriter->writeAttribute('tabSelected', $sheetSelected ? '1' : '0');
        $objWriter->writeAttribute('workbookViewId', '0');

        // Zoom scales
        if ($pSheet->getSheetView()->getZoomScale() != 100) {
            $objWriter->writeAttribute('zoomScale', $pSheet->getSheetView()->getZoomScale());
        }
        if ($pSheet->getSheetView()->getZoomScaleNormal() != 100) {
            $objWriter->writeAttribute('zoomScaleNormal', $pSheet->getSheetView()->getZoomScaleNormal());
        }

        // View Layout Type
        if ($pSheet->getSheetView()->getView() !== SheetView::SHEETVIEW_NORMAL) {
            $objWriter->writeAttribute('view', $pSheet->getSheetView()->getView());
        }

        // Gridlines
        if ($pSheet->getShowGridlines()) {
            $objWriter->writeAttribute('showGridLines', 'true');
        } else {
            $objWriter->writeAttribute('showGridLines', 'false');
        }

        // Row and column headers
        if ($pSheet->getShowRowColHeaders()) {
            $objWriter->writeAttribute('showRowColHeaders', '1');
        } else {
            $objWriter->writeAttribute('showRowColHeaders', '0');
        }

        // Right-to-left
        if ($pSheet->getRightToLeft()) {
            $objWriter->writeAttribute('rightToLeft', 'true');
        }

        $activeCell = $pSheet->getActiveCell();

        // Pane
        $pane = '';
        if ($pSheet->getFreezePane()) {
            list($xSplit, $ySplit) = Coordinate::coordinateFromString($pSheet->getFreezePane());
            $xSplit = Coordinate::columnIndexFromString($xSplit);
            --$xSplit;
            --$ySplit;

            $topLeftCell = $pSheet->getTopLeftCell();
            $activeCell = $topLeftCell;

            // pane
            $pane = 'topRight';
            $objWriter->startElement('pane');
            if ($xSplit > 0) {
                $objWriter->writeAttribute('xSplit', $xSplit);
            }
            if ($ySplit > 0) {
                $objWriter->writeAttribute('ySplit', $ySplit);
                $pane = ($xSplit > 0) ? 'bottomRight' : 'bottomLeft';
            }
            $objWriter->writeAttribute('topLeftCell', $topLeftCell);
            $objWriter->writeAttribute('activePane', $pane);
            $objWriter->writeAttribute('state', 'frozen');
            $objWriter->endElement();

            if (($xSplit > 0) && ($ySplit > 0)) {
                //    Write additional selections if more than two panes (ie both an X and a Y split)
                $objWriter->startElement('selection');
                $objWriter->writeAttribute('pane', 'topRight');
                $objWriter->endElement();
                $objWriter->startElement('selection');
                $objWriter->writeAttribute('pane', 'bottomLeft');
                $objWriter->endElement();
            }
        }

        // Selection
        // Only need to write selection element if we have a split pane
        // We cheat a little by over-riding the active cell selection, setting it to the split cell
        $objWriter->startElement('selection');
        if ($pane != '') {
            $objWriter->writeAttribute('pane', $pane);
        }
        $objWriter->writeAttribute('activeCell', $activeCell);
        $objWriter->writeAttribute('sqref', $activeCell);
        $objWriter->endElement();

        $objWriter->endElement();

        $objWriter->endElement();
    }
private function writeSheetViews ( XMLWriter $ objWriter , PhpspreadsheetWorksheet $ pSheet ) { // sheetViews $ objWriter -> startElement ( 'sheetViews' ) ; // Sheet selected? $ sheetSelected = false ; if ( $ this -> getParentWriter ( ) -> getSpreadsheet ( ) -> getIndex ( $ pSheet ) == $ this -> getParentWriter ( ) -> getSpreadsheet ( ) -> getActiveSheetIndex ( ) ) { $ sheetSelected = true ; } // sheetView $ objWriter -> startElement ( 'sheetView' ) ; $ objWriter -> writeAttribute ( 'tabSelected' , $ sheetSelected ? '1' : '0' ) ; $ objWriter -> writeAttribute ( 'workbookViewId' , '0' ) ; // Zoom scales if ( $ pSheet -> getSheetView ( ) -> getZoomScale ( ) != 100 ) { $ objWriter -> writeAttribute ( 'zoomScale' , $ pSheet -> getSheetView ( ) -> getZoomScale ( ) ) ; } if ( $ pSheet -> getSheetView ( ) -> getZoomScaleNormal ( ) != 100 ) { $ objWriter -> writeAttribute ( 'zoomScaleNormal' , $ pSheet -> getSheetView ( ) -> getZoomScaleNormal ( ) ) ; } // View Layout Type if ( $ pSheet -> getSheetView ( ) -> getView ( ) !== SheetView :: SHEETVIEW_NORMAL ) { $ objWriter -> writeAttribute ( 'view' , $ pSheet -> getSheetView ( ) -> getView ( ) ) ; } // Gridlines if ( $ pSheet -> getShowGridlines ( ) ) { $ objWriter -> writeAttribute ( 'showGridLines' , 'true' ) ; } else { $ objWriter -> writeAttribute ( 'showGridLines' , 'false' ) ; } // Row and column headers if ( $ pSheet -> getShowRowColHeaders ( ) ) { $ objWriter -> writeAttribute ( 'showRowColHeaders' , '1' ) ; } else { $ objWriter -> writeAttribute ( 'showRowColHeaders' , '0' ) ; } // Right-to-left if ( $ pSheet -> getRightToLeft ( ) ) { $ objWriter -> writeAttribute ( 'rightToLeft' , 'true' ) ; } $ activeCell = $ pSheet -> getActiveCell ( ) ; // Pane $ pane = '' ; if ( $ pSheet -> getFreezePane ( ) ) { list ( $ xSplit , $ ySplit ) = Coordinate :: coordinateFromString ( $ pSheet -> getFreezePane ( ) ) ; $ xSplit = Coordinate :: columnIndexFromString ( $ xSplit ) ; -- $ xSplit ; -- $ ySplit ; $ topLeftCell = $ pSheet -> getTopLeftCell ( ) ; $ activeCell = $ topLeftCell ; // pane $ pane = 'topRight' ; $ objWriter -> startElement ( 'pane' ) ; if ( $ xSplit > 0 ) { $ objWriter -> writeAttribute ( 'xSplit' , $ xSplit ) ; } if ( $ ySplit > 0 ) { $ objWriter -> writeAttribute ( 'ySplit' , $ ySplit ) ; $ pane = ( $ xSplit > 0 ) ? 'bottomRight' : 'bottomLeft' ; } $ objWriter -> writeAttribute ( 'topLeftCell' , $ topLeftCell ) ; $ objWriter -> writeAttribute ( 'activePane' , $ pane ) ; $ objWriter -> writeAttribute ( 'state' , 'frozen' ) ; $ objWriter -> endElement ( ) ; if ( ( $ xSplit > 0 ) && ( $ ySplit > 0 ) ) { //    Write additional selections if more than two panes (ie both an X and a Y split) $ objWriter -> startElement ( 'selection' ) ; $ objWriter -> writeAttribute ( 'pane' , 'topRight' ) ; $ objWriter -> endElement ( ) ; $ objWriter -> startElement ( 'selection' ) ; $ objWriter -> writeAttribute ( 'pane' , 'bottomLeft' ) ; $ objWriter -> endElement ( ) ; } } // Selection // Only need to write selection element if we have a split pane // We cheat a little by over-riding the active cell selection, setting it to the split cell $ objWriter -> startElement ( 'selection' ) ; if ( $ pane != '' ) { $ objWriter -> writeAttribute ( 'pane' , $ pane ) ; } $ objWriter -> writeAttribute ( 'activeCell' , $ activeCell ) ; $ objWriter -> writeAttribute ( 'sqref' , $ activeCell ) ; $ objWriter -> endElement ( ) ; $ objWriter -> endElement ( ) ; $ objWriter -> endElement ( ) ; }
Write SheetViews.

@param XMLWriter $objWriter XML Writer
@param PhpspreadsheetWorksheet $pSheet Worksheet

@throws WriterException
Write SheetViews .