Рекурсивный акроним словосочетания «PHP: Hypertext Preprocessor»
Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 17244 программиста и 1834 робота. Сейчас ищут 1692 программиста ...
Worksheet::setPaper
Вернуться к: Spreadsheet_Excel_Writer
Worksheet::setPaper
Worksheet::setPaper – Set the paper type. Ex. 1 = US Letter, 9 = A4
Synopsis
require_once "Spreadsheet/Excel/Writer.php";
void Worksheet::setPaper ( integer $size=0 )
Set the paper type. Ex. 1 = US Letter, 9 = A4
Parameter
-
integer $size - The type of paper size to use
Note
This function can not be called statically.
Example
Using setPaper()
<?php
require_once 'Spreadsheet/Excel/Writer.php';
// Creating a workbook
$workbook = new Spreadsheet_Excel_Writer();
// sending HTTP headers
$workbook->send('test.xls');
// Creating a worksheet
$worksheet =& $workbook->addWorksheet('My first worksheet');
//set paper size
$worksheet->setPaper(9);
// The actual data
$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);
// Let's send the file
$workbook->close();
?>
Вернуться к: Spreadsheet_Excel_Writer