Popularity
2.7
Growing
Activity
0.0
Stable
68
25
17

Description

ExcelAnt is an Excel manipulation library for PHP 5.4. It currently works on top of PHPExcel. If you want to add / use another library, feel free to fork and contribute !

Code Quality Rank: L5
Programming language: PHP
License: GNU General Public License v3.0 or later
Tags: Office     Excel    
Latest version: v1.0.2

ExcelAnt alternatives and similar libraries

Based on the "Office" category.
Alternatively, view ExcelAnt alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of ExcelAnt or a related project?

Add another 'Office' Library

README

       |     |
        \   /
         \_/
    __   /^\   __
   '  `. \_/ ,'  `
        \/ \/
   _,--./| |\.--._
_,'   _.-\_/-._   `._
     |   / \   |
     |  /   \  |
    /   |   |   \
  -'    \___/    `-

ExcelAnt

Build Status

ExcelAnt is an Excel manipulation library for PHP 5.4. It currently works on top of PHPExcel. If you want to add / use another library, feel free to fork and contribute !

Version

1.0.0

Installation

  1. Install composer : curl -s http://getcomposer.org/installer | php (more info at getcomposer.org)
  2. Create a composer.json file in your project root : (or add only the excelant line in your existing composer file)
  {
    "require": {
      "wisembly/excelant": "*",
    }
  }
  1. Install via composer : php composer.phar install

Use ExcelAnt

Create a simple Table :

use ExcelAnt\Adapter\PhpExcel\Workbook\Workbook,
    ExcelAnt\Adapter\PhpExcel\Sheet\Sheet,
    ExcelAnt\Adapter\PhpExcel\Writer\Writer,
    ExcelAnt\Table\Table,
    ExcelAnt\Coordinate\Coordinate;

Class Export
{
    public function createExport(array $users)
    {
        $workbook = new Workbook();
        $sheet = new Sheet($workbook);
        $table = new Table();

        foreach ($users as $user) {
            $table->setRow([
                $user->getName(),
                $user->getEmail(),
            ]);
        }

        $sheet->addTable($table, new Coordinate(1, 1));
        $workbook->addSheet($sheet);
    }
}

Now, to export your Workbook, you need to create a Writer :

use ExcelAnt\Adapter\PhpExcel\Writer\WriterFactory,
    ExcelAnt\Adapter\PhpExcel\Writer\PhpExcelWriter\Excel5;

$writer = (new WriterFactory())->createWriter(new Excel5('/path/to/myExport.xls'));

Convert your Worbook to create a PHPExcel object and export it :

$phpExcel = $writer->convert($workbook);
$writer->write($phpExcel);

Simple table

Documentation

Coming soon...

Contributing

ExcelAnt is an open source project. If you would like to contribute, fork the repository and submit a pull request.

Running ExcelAnt Tests