laravellaravel-4phpexcel

Append Rows to existing Excel document using Laravel-Excel


I have an existing Excel document, to which I want to append some data using Laravel-Excel. The package has nice documentation but unfortunately there is no full example showing how to do that, but only partial demonstration of manipulating rows.

What I am attempting to do is:

  1. open the existing document
  2. get the first sheet, append new
  3. close the document

The code:

Excel::load($path . '/exported.xls', function($reader){
                    $sheet = $reader->getActiveSheet();
                    // Manipulate third row
                    $sheet->row(3, array(
                            'test1', 'test2'
                        ));
                });

Which results in

Call to undefined method PHPExcel_Worksheet::row()

Has anyone succeeded appending data with this package?


Solution

  • Right now it is not possible to edit an Excel file like I intended to. Source: package creator.