SetCellValueByColumnAndRow( $column, $line, html_entity_decode(strip_tags($col_name)) );*/ $column++; } $line++; } Export::arrayToXls($list, $filename); return true; } /** * Exports the complete report as a DOCX file. * * @param array $data The table data * * @return bool */ public function exportCompleteReportDOC($data) { $filename = 'gradebook_results_'.api_get_local_time().'.docx'; $doc = new \PhpOffice\PhpWord\PhpWord(); $section = $doc->addSection(['orientation' => 'landscape']); $table = $section->addTable(); $table->addRow(); for ($i = 0; $i < count($data[0]); $i++) { $table->addCell(1750)->addText(strip_tags($data[0][$i])); } foreach ($data[1] as $dataLine) { $table->addRow(); for ($i = 0; $i < count($dataLine); $i++) { $table->addCell(1750)->addText(strip_tags($dataLine[$i])); } } $file = api_get_path(SYS_ARCHIVE_PATH).api_replace_dangerous_char($filename); $doc->save($file, 'Word2007'); DocumentManager::file_send_for_download($file, true, $filename); return true; } }