I'm trying to export an array as XLS file using PHP and symfony as shown by the code below. Once the XLS file created, I can only get the last row of the array, and it's displayed in the first line of my file. It seems that the "lignes" variable is not incremented. I can't figure out what's wrong, can anyone help with that?
foreach ($adresses as $ad ){
$phpExcelObject->setActiveSheetIndex(0)->setCellValue('A' . $lignes, $ad->getId());
$phpExcelObject->setActiveSheetIndex(0)->setCellValue('E' . $lignes, $ad->getTypeVoie());
$phpExcelObject->setActiveSheetIndex(0)->setCellValue('F' . $lignes, $ad->getVoie());
$phpExcelObject->setActiveSheetIndex(0)->setCellValue('G' . $lignes, $ad->getTypeQuartier());
$phpExcelObject->setActiveSheetIndex(0)->setCellValue('H' . $lignes, $ad->getQuartier());
$phpExcelObject->setActiveSheetIndex(0)->setCellValue('I' . $lignes, $ad->getCodePostale());
$phpExcelObject->setActiveSheetIndex(0)->setCellValue('K' . $lignes, $ad->getPays());
$phpExcelObject->setActiveSheetIndex(0)->setCellValue('J' . $lignes, $ad->getVille());
$lignes++;
}
$writer = $this->get('phpexcel')->createWriter($phpExcelObject, 'Excel2007');
$writer->save($fichier->getWebPathOut() );