addTable() public method

public addTable ( ExcelAnt\Table\TableInterface $table, ExcelAnt\Coordinate\Coordinate $coordinate )
$table ExcelAnt\Table\TableInterface
$coordinate ExcelAnt\Coordinate\Coordinate
Beispiel #1
0
 /** {@inheritdoc} */
 public function create($path, array $firstRow, $sheetName = '')
 {
     $workbook = new Workbook();
     $sheet = new Sheet($workbook);
     $table = new Table();
     $table->setRow($firstRow);
     $sheet->addTable($table, new Coordinate(1, 1));
     $workbook->addSheet($sheet);
     $writerFactory = new WriterFactory();
     $writer = $writerFactory->createWriter(new Excel5($path));
     $phpExcel = $writer->convert($workbook);
     $writer->write($phpExcel);
 }