ExcelAnt - Simple yet powerful Excel manipulation library for PHP 5.4+

Related tags

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

#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

Comments
  • Tags? Releases?

    Tags? Releases?

    This bundle looks very promising and I'll definitely give it a try, but what worries me is that there are no tags or roadmap where I could find info on when a stable release will be ready? Or is dev-master already stable?

    opened by ioleo 3
  • Any way to set autoSize with ExcelAnt?

    Any way to set autoSize with ExcelAnt?

    In PHPExcel, I can use:

          $sheet->getColumnDimension($cell->getColumn())->setAutoSize(true);
    

    Is it possible to set autoSize with ExcelAnt instead of doing it with PHPExcel after the conversion?

    opened by nebulousGirl 1
  • Any working example ?

    Any working example ?

    Hello everyone,

    Does anyone has a working example with this bundle ? I'm trying to save an Excel file but file is empty. I'm following basic example given but it seems that something is missing in the end to save the data generated into the Excel file. I'm not trying something crazy, just repeat the exemple.

        $path = __DIR__.'/../../../../web/uploads/temp';
        $file = 'myfile.xls'
        $workbook = new Workbook();
        $sheet = new Sheet($workbook);
        $table = new Table();
    
        $table->setRow(['eee', 'aaa']);
    
        $sheet->addTable($table, new Coordinate(1, 1));
        $workbook->addSheet($sheet);
    
        $writer = (new WriterFactory())->createWriter(new Excel5($path.$title));
    
        $phpExcel = $writer->convert($workbook);
    
        $writer->write($phpExcel);
    

    Could anyone help ?

    opened by soulghard 1
  • Fixed composer.json

    Fixed composer.json

    Installation via composer (as it is described in README) currently fails due to the fact that "phpoffice/phpexcel": "dev-develop" has stability dev now and composer rquires stability stable by default

    opened by arodiss 1
  • How to deserialize a Table Object?

    How to deserialize a Table Object?

    I am trying to deserialize a Table object and I do not get how to do it. Is this right? $exceltable=$serializer->deserialize( $table , 'ExcelAnt\Table\Table' ,'json'); I get the following error:

    You must define a type for ExcelAnt\Table\Table::$table

    How can I define this type?

    opened by Marcelsj 2
Parse and retrieve data from old format Excel XLS files. MS Excel 97 workbooks PHP reader.

SimpleXLS class 0.9.15 Parse and retrieve data from old Excel .XLS files. MS Excel 97-2003 workbooks PHP reader. PHP BIFF reader. No additional extens

Sergey Shuchkin 160 Jan 6, 2023
Merge Excel Files to single excel file per columns

Merge Excel Files to single excel file per columns

Max Base 3 Apr 26, 2021
PhpSpreadsheet - a library written in pure PHP and offers a set of classes that allow you to read and write various spreadsheet file formats such as Excel and LibreOffice Calc

PhpSpreadsheet PhpSpreadsheet is a library written in pure PHP and offers a set of classes that allow you to read and write various spreadsheet file f

PHPOffice 11.8k Dec 31, 2022
an excel export/import tool for laravel based on php-xlswriter

Laravel-xlswriter 一款基于xlswriter的laravel扩展包 php-xlswriter是一款高性能的excel读写扩展,laravel-xlswriter基于该扩展做了封装,旨在提供一个便于使用的xlswriter的laravel工具包。 目前laravel-xlswrit

lysice 54 Dec 3, 2022
Simplexcel.php - Easily read / parse / convert / write between Microsoft Excel XML / CSV / TSV / HTML / JSON / etc spreadsheet tabular file formats

Simple Excel Easily parse / convert / write between Microsoft Excel XML / CSV / TSV / HTML / JSON / etc formats For further deatails see the GitHuib P

Faisal Salman 550 Dec 27, 2022
CSV data manipulation made easy in PHP

CSV Csv is a simple library to ease CSV parsing, writing and filtering in PHP. The goal of the library is to be powerful while remaining lightweight,

The League of Extraordinary Packages 3k Jan 1, 2023
🚀 Supercharged Excel exports and imports in Laravel

Supercharged Excel exports and imports A simple, but elegant Laravel wrapper around PhpSpreadsheet exports and imports. Quickstart · Documentation · V

Maatwebsite 11.2k Jan 4, 2023
🦉 Fast Excel import/export for Laravel

Fast Excel import/export for Laravel, thanks to Spout. See benchmarks below. Quick start Install via composer: composer require rap2hpoutre/fast-excel

Raphaël Huchet 1.7k Jan 8, 2023
Laravel Excel Export & Import example

Laravel Excel Export & Import example It's pretty easy to export to Excel and import from Excel, with great Laravel Excel package. This package superc

Syed Arsalan Ahmed 1 Oct 26, 2021
Data import to excel without any package

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Dilshodbek 2 May 30, 2022
You can convert any table to CSV/EXCEL file.

Convert MySQL to EXCEL You can convert any table to CSV/EXCEL file by this code. In this repository I've used Link1 and Link2 . Simply edit config.php

Arsalan 1 Dec 25, 2021
PHPExcelFormatter is class to make getting data from Excel documents simpler.

PHPExcelFormatter PHPExcelFormatter is class to make getting data from Excel documents simpler. Read columns what you really need Set column names for

Rene Korss 4 Apr 28, 2022
A pure PHP library for reading and writing spreadsheet files

PhpSpreadsheet PhpSpreadsheet is a library written in pure PHP and offers a set of classes that allow you to read and write various spreadsheet file f

PHPOffice 11.8k Jan 8, 2023
A pure PHP library for reading and writing word processing documents

Master: Develop: PHPWord is a library written in pure PHP that provides a set of classes to write to and read from different document file formats. Th

PHPOffice 6.5k Jan 7, 2023
A pure PHP library for reading and writing presentations documents

Branch Master : Branch Develop : PHPPresentation is a library written in pure PHP that provides a set of classes to write to different presentation fi

PHPOffice 1.2k Jan 2, 2023
A pure PHP library for reading and writing project management files

PHPProject PHPProject is a library written in pure PHP that provides a set of classes to write to different project management file formats, i.e. Micr

PHPOffice 192 Dec 17, 2022
🚀 PHP Extension for creating and reader XLSX files.

Why use xlswriter Please refer to the image below. PHPExcel has been unable to work properly for memory reasons at 40,000 and 100000 points, but it ca

viest 1.9k Jan 4, 2023
Simple yet powerful Excel manipulation library for PHP 5.4+

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

Wisembly 68 Sep 20, 2022
Parse and retrieve data from old format Excel XLS files. MS Excel 97 workbooks PHP reader.

SimpleXLS class 0.9.15 Parse and retrieve data from old Excel .XLS files. MS Excel 97-2003 workbooks PHP reader. PHP BIFF reader. No additional extens

Sergey Shuchkin 160 Jan 6, 2023
Merge Excel Files to single excel file per columns

Merge Excel Files to single excel file per columns

Max Base 3 Apr 26, 2021