Worksheet::freezePanes

Worksheet::freezePanes – Set panes and mark them as frozen.

Synopsis

require_once "Spreadsheet/Excel/Writer.php";

void Worksheet::freezePanes ( array $panes )

Description

Set panes and mark them as frozen. One can use this method to mark certain regions in the worksheet so that they are "frozen" in the sense that when scrolling through the worksheet these regions are not affected by the scrolling and remain where they are on the screen. This is the same functionality as provided by Microsoft Excel through the Window->Freeze Panes menu command.

Parameter

  • array $panes - This is the only parameter received and is composed of the following: 0 => Vertical split position, 1 => Horizontal split position 2 => Top row visible 3 => Leftmost column visible 4 => Active pane

Note

This function can not be called statically.

Example

Using freezePanes()

<?php
$worksheet 
=& $workbook->addWorksheet("Some Worksheet");

/* ... */

/* This freezes the first six rows of the worksheet: */
$worksheet->freezePanes(array(60));

/* To freeze the first column, one must use the following syntax: */
$worksheet->freezePanes(array(01));
?>

If one needs to further specify the scrolling region, the following syntax can be used:

<?php
/* Freeze the first six rows and start the scrollable region at row nine: */
$worksheet->freezePanes(array(6090));
?>