fml/phpsimpleexcel

PHPSimpleExcel is a library basing on oliverschwarz/php-excel

v1.0.2 2016-03-23 14:19 UTC

This package is not auto-updated.

Last update: 2024-05-01 09:04:03 UTC


README

PHPSimpleExcel is a library basing on oliverschwarz/php-excel. This implementation allow to you to controlling current row by startRow() method, which returns Row object.

Instalation

FunkyMonkeyLabs\PHPSimpleExcel is available on packagist.org (composer), so you can simply add:

    "require": {
        "fml/phpsimpleexcel" : "v1.0.0"
    }

Usage

<?php

require_once __DIR__.'/vendor/autoload.php';

$excel = new FML\PhpSimpleExcel\PhpSimpleExcel();
$excel->addNamedStyle('idFormat', array(
        "NumberFormat" => array(
            "ss:Format" => "##00"
        )
    ));
$excel->addRow(array(
        "id", "Column1", "Column2"
    ));

foreach(range(0,11) as $id) {
    $excel
        ->startRow()
        ->addCell($id, 'Number', 'idFormat')
        ->addCell('value'.$id)
        ->addCell('value2'.$id)
        ->end();
}
echo $excel->generateXML('excel');