void Worksheet::setPaper (
integer $size=0
)
用紙の種類を設定します。例えば「1 = US Letter」、「9 = A4」です。
integer $size
-
使用する用紙サイズの種類。
This function can not be called statically.
setPaper() の使用法
<?php
require_once 'Spreadsheet/Excel/Writer.php';
// ワークブックを作成します
$workbook = new Spreadsheet_Excel_Writer();
// HTTP ヘッダを送信します
$workbook->send('test.xls');
// ワークシートを作成します
$worksheet =& $workbook->addWorksheet('My first worksheet');
// 用紙サイズを設定します
$worksheet->setPaper(9);
// データを設定します
$worksheet->write(0, 0, 'Name');
$worksheet->write(0, 1, 'Age');
$worksheet->write(1, 0, 'John Smith');
$worksheet->write(1, 1, 30);
$worksheet->write(2, 0, 'Johann Schmidt');
$worksheet->write(2, 1, 31);
$worksheet->write(3, 0, 'Juan Herrera');
$worksheet->write(3, 1, 32);
// ファイルを送信します
$workbook->close();
?>