previousWorksheet::protect (Previous) (Next) Worksheet::setSelectionnext

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

Worksheet::setColumn

Worksheet::setColumn – Définit la taille d'une colonne ou d'un intervalle de colonnes

Synopsis

require_once "Spreadsheet/Excel/Writer.php";

void Worksheet::setColumn ( integer $firstcol , integer $lastcol , float $width , mixed $format=0 , integer $hidden=0 )

Description

Définit la taille d'une colonne ou d'un intervalle de colonnes.

Parameter

  • 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

Note

This function can not be called statically.

Example

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 1floor(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();
?>
previousWorksheet::protect (Previous) (Next) Worksheet::setSelectionnext

Download Documentation Last updated: Sun, 18 Oct 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
Note by: Brandon Bergren
It seems that the column width unit is "one character" in the "normal font."
See
http://support.microsoft.com/kb/214123