void Worksheet::setColumn (
integer $firstcol
,
integer $lastcol
,
float $width
,
mixed $format=0
,
integer $hidden=0
)
Définit la taille d'une colonne ou d'un intervalle de colonnes.
integer $firstcol - Première colonne de l'intervalle
integer $lastcol - Dernière colonne de l'intervalle
float $width - Taille à définir
mixed $format - Le format XF optionnel à appliquer aux colonnes
integer $hidden - L'attribut optionnel permettant de cacher
This function can not be called statically.
Exemple avec setColumn()
<?php
require_once 'Spreadsheet/Excel/Writer.php';
$workbook = new Spreadsheet_Excel_Writer();
$worksheet =& $workbook->addWorksheet();
$radius = 20;
$worksheet->setColumn(0,$radius*2,1);
// Face
for ($i = 0; $i < 360; $i++)
{
$worksheet->write(floor(sin((2*pi()*$i)/360)*$radius) + $radius + 1, floor(cos((2*pi()*$i)/360)*$radius) + $radius + 1, "x");
}
// Yeux (peut-être l'utilisation d'un format à la place ?)
$worksheet->writeURL(floor($radius*0.8), floor($radius*0.8), "0");
$worksheet->writeURL(floor($radius*0.8), floor($radius*1.2), "0");
// Sourire
for ($i = 65; $i < 115; $i++)
{
$worksheet->write(floor(sin((2*pi()*$i)/360)*$radius*1.3) + floor($radius*0.2), floor(cos((2*pi()*$i)/360)*$radius*1.3) + $radius + 1, "x");
}
// On cache la grille pour qu'elle ne gâche pas notre art Excel ;)
$worksheet->hideGridLines();
$workbook->send('face.xls');
$workbook->close();
?>