IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

Introduction à PHPExcel

Date de publication : 05/02/2009 , Date de mise à jour : 14/07/2010


Vite dit
7.1. Fusion de cellules
7.2. Largeur de colonne
7.3. Hauteur de ligne
7.4. Taille de la page
7.5. Orientation de la page
7.6. Freeze Pane


Vite dit


7.1. Fusion de cellules


 //on fusionne les cellules de A1 à  D1
        $sheet->mergeCells('A1:D1');
                

7.2. Largeur de colonne


 $sheet->getColumnDimension('A')->setWidth(28);
                

7.3. Hauteur de ligne


$sheet->getRowDimension('2')->setRowHeight(70);
                

7.4. 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


7.5. 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'

7.6. Freeze Pane

Pour geler une celule

            //mettre la cellule en paramètres.
            $sheet->freezePane('A2');            
            
 

Valid XHTML 1.0 TransitionalValid CSS!

Ce document est issu de http://www.developpez.com et reste la propriété exclusive de son auteur. La copie, modification et/ou distribution par quelque moyen que ce soit est soumise à  l'obtention préalable de l'autorisation de l'auteur.