previousWorksheet::setSelection (Previous) (Next) Worksheet::thawPanesnext

View this page in Last updated: Sun, 21 Jun 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

Worksheet::freezePanes

Worksheet::freezePanes – ウィンドウ枠を固定する

Synopsis

require_once "Spreadsheet/Excel/Writer.php";

void Worksheet::freezePanes ( array $panes )

Description

ウィンドウ枠を固定します。このメソッドを使用すると、 ワークシート内の特定の領域を指定し、 それを "凍結" することが可能となります。 つまり、ワークシートをスクロールさせてもその領域は影響を受けず、 画面の中に残り続けるということです。 このメソッドは、Microsoft Excel のメニューコマンド ->ウィンドウ(W)->ウィンドウ枠の固定(F) と同じ機能を提供します。

Parameter

  • array $panes - 唯一のパラメータで、以下のような内容の配列となります。 0 => 縦方向の分割位置, 1 => 横方向の分割位置, 2 => 一番上に表示される行, 3 => 一番左に表示される列, 4 => アクティブなウィンドウ枠

Note

This function can not be called statically.

Example

freezePanes() の使用法

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

/* ... */

/* これは、ワークシートの最初の 6 行を凍結します */
$worksheet->freezePanes(array(60));

/* 最初のカラムを凍結するには、以下のようにします */
$worksheet->freezePanes(array(01));
?>

さらにスクロール領域を指定したい場合は、 次のような構文が使用可能です。

<?php
/* 最初の 6 行を凍結し、スクロール領域を 9 行目からはじめます */
$worksheet->freezePanes(array(6090));
?>
previousWorksheet::setSelection (Previous) (Next) Worksheet::thawPanesnext

Download Documentation Last updated: Sun, 21 Jun 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
Note by: iris.cdm@seznam.cz
Be aware of param syntax, or you may experience some strange excel rendering issues. I.e., you want to freeze everything from 4th row, the following syntax is correct:
$worksheet->freezePanes(4, 0, 4, 0); //fifth param is not neccessary

freezePanes accept this array parameter
@param 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 by: alexdesktop@example.com
$worksheet->freezePanes(array(6, 0));
will give notices about offsets 2 and 3.

Instead, use :

$worksheet->freezePanes(array(6, 0, 0, 0));

as specified here :
http://pear.php.net/bugs/bug.php?id=7315