Vite dit▲
Fusion de cellules▲
//on fusionne les cellules de A1 à D1
$sheet
->
mergeCells('
A1:D1
'
);
Largeur de colonne▲
$sheet
->
getColumnDimension('
A
'
)->
setWidth(28
);
Hauteur de ligne▲
$sheet
->
getRowDimension('
2
'
)->
setRowHeight(70
);
Taille de la page▲
$sheet
->
getPageSetup()->
setPaperSize(PHPExcel_Worksheet_PageSetup::
PAPERSIZE_A4);
Les formats possibles sont :
Type |
Constante |
Valeur |
---|---|---|
Letter paper (8.5 in. by 11 in.) |
PAPERSIZE_LETTER |
1 |
Letter small paper (8.5 in. by 11 in.) |
PAPERSIZE_LETTER_SMALL |
2 |
Tabloid paper (11 in. by 17 in.) |
PAPERSIZE_TABLOID |
3 |
Ledger paper (17 in. by 11 in.) |
PAPERSIZE_LEDGER |
4 |
Legal paper (8.5 in. by 14 in.) |
PAPERSIZE_LEGAL |
5 |
Statement paper (5.5 in. by 8.5 in.) |
PAPERSIZE_STATEMENT |
6 |
Executive paper (7.25 in. by 10.5 in.) |
PAPERSIZE_EXECUTIVE |
7 |
A3 paper (297 mm by 420 mm) |
PAPERSIZE_A3 |
8 |
A4 paper (210 mm by 297 mm) |
PAPERSIZE_A4 |
9 |
A4 small paper (210 mm by 297 mm) |
PAPERSIZE_A4_SMALL |
10 |
A5 paper (148 mm by 210 mm) |
PAPERSIZE_A5 |
11 |
B4 paper (250 mm by 353 mm) |
PAPERSIZE_B4 |
12 |
B5 paper (176 mm by 250 mm) |
PAPERSIZE_B5 |
13 |
Folio paper (8.5 in. by 13 in.) |
PAPERSIZE_FOLIO |
14 |
Quarto paper (215 mm by 275 mm) |
PAPERSIZE_QUARTO |
15 |
Standard paper (10 in. by 14 in.) |
PAPERSIZE_STANDARD_1 |
16 |
Standard paper (11 in. by 17 in.) |
PAPERSIZE_STANDARD_2 |
17 |
Note paper (8.5 in. by 11 in.) |
PAPERSIZE_NOTE |
18 |
Envelope (3.875 in. by 8.875 in.) |
PAPERSIZE_NO9_ENVELOPE |
19 |
Envelope (4.125 in. by 9.5 in.) |
PAPERSIZE_NO10_ENVELOPE |
20 |
Envelope (4.5 in. by 10.375 in.) |
PAPERSIZE_NO11_ENVELOPE |
21 |
Envelope (4.75 in. by 11 in.) |
PAPERSIZE_NO12_ENVELOPE |
22 |
Envelope (5 in. by 11.5 in.) |
PAPERSIZE_NO14_ENVELOPE |
23 |
C paper (17 in. by 22 in.) |
PAPERSIZE_C |
24 |
Etc.. |
Vour retrouverez l'ensemble des formats dans le fichier PHPExcel_Worksheet_PageSetup.php.
Orientation de la page▲
$sheet
->
getPageSetup()->
setOrientation(PHPExcel_Worksheet_PageSetup::
ORIENTATION_LANDSCAPE);
Les orientations possibles sont :
Constante |
Valeur |
---|---|
ORIENTATION_DEFAULT |
'default' |
ORIENTATION_LANDSCAPE |
'landscape' |
ORIENTATION_PORTRAIT |
'portrait' |
Freeze Pane▲
Pour geler une cellule
//mettre la cellule en paramètres.
$sheet
->
freezePane('
A2
'
);