3 namespace Galerie\Export;
5 use Custom\Export\AbstractWorkbook;
8 class GalerieWorkbook extends AbstractWorkbook
12 * Nom du fichier utilisé pour l'export.
16 protected function nomFichier()
18 return 'export_galerie.xls';
25 * Méthode d'écriture des données dans la feuille courante.
29 protected function writeData()
31 $this->ecrireCaseCourante("Nom", 'titre_string');
32 $this->ecrireCaseCourante("Description", 'titre_string');
33 $this->ecrireCaseCourante("Propriétaire", 'titre_string');
34 $this->ecrireCaseCourante("Photos", 'titre_string');
36 foreach($this->datas as $d) {
37 $this->ecrireCaseCourante($d->name, 'case_string');
38 $this->ecrireCaseCourante($d->description, 'case_string');
39 $this->ecrireCaseCourante($d->username, 'case_string');
40 $this->ecrireCaseCourante($d->nb, 'case_chiffre');
49 * Mise en forme après écriture.
53 protected function postFormats()
55 $this->current_worksheet->setColumn(0, 0, '10');
56 $this->current_worksheet->setColumn(1, 1, '40');
57 $this->current_worksheet->setColumn(2, 2, '10');
58 $this->current_worksheet->setColumn(3, 3, '5');
60 $this->current_worksheet->setRow(0, 50);
61 $c = count($this->datas);
62 for($i=1;$i<=$c;$i++) {
63 $this->current_worksheet->setRow($i, 30);
66 $this->current_worksheet->setLandscape();
67 $this->current_worksheet->hideGridLines();