2017 © Pedro Peláez
 

symfony-bundle excel-bundle

Symfony Bundle to read or write Excel file (including pdf, xlsx, odt), using phpoffice/phpspreadsheet library (replacement of phpoffice/phpexcel, abandonned)

image

onurb/excel-bundle

Symfony Bundle to read or write Excel file (including pdf, xlsx, odt), using phpoffice/phpspreadsheet library (replacement of phpoffice/phpexcel, abandonned)

  • Wednesday, March 28, 2018
  • by nono1971
  • Repository
  • 1 Watchers
  • 1 Stars
  • 570 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 126 % Grown

The README.md

Symfony Excel bundle

Build Status Scrutinizer Code Quality Code Coverage License Latest Stable Version Total Downloads, (*1)

Installation

1 Add to composer.json to the require key, (*2)

``` shell composer require onurb/excel-bundle, (*3)


or manually in composer.json ```json ..., "require": { ..., "onurb/excel-bundle": "~1.0" }, ...

2 Symfony 3 : Register the bundle in app/AppKernel.php ``` php $bundles = array( // ... new \Onurb\Bundle\ExcelBundle\OnurbExcelBundle(), );, (*4)


Symfony 4 : With symfony flex, bundle should be already automatically registered : ``` php // config/bundles.php return [ // ... Onurb\Bundle\ExcelBundle\OnurbExcelBundle::class => ['all' => true], ]; ``` ## Usage #### Create a spreadsheet ``` php $spreadsheet = $this->get('phpspreadsheet')->createSpreadsheet();

Create a spreadsheet from an existing file

``` php $spreadsheet = $this->get('phpspreadsheet')->createSpreadsheet('file.xlsx');, (*5)


#### Create a Excel5 and write to a file given the object: ```php $writer = $this->get('phpspreadsheet')->createWriter($spreadsheet, 'Xls'); $writer->save('file.xls');

Create a Excel 2007 and create a StreamedResponse:

$writer = $this->get('phpspreadsheet')->createWriter($spreadsheet, 'Xlsx');
$response = $this->get('phpspreadsheet')->createStreamedResponse($writer);

Create a Excel file with an image:

$writer = $this->get('phpspreadsheet')->createSpreadSheet();
$writer->setActiveSheetIndex(0);
$activesheet = $writer->getActiveSheet();
$drawingobject = $this->get('phpspreadsheet')->createSpreadsheetWorksheetDrawing();
$drawingobject->setPath('/path/to/image')
    ->setName('Image name')
    ->setDescription('Image description')
    ->setHeight(60)
    ->setOffsetY(20)
    ->setCoordinates('A1')
    ->setWorksheet($activesheet);

Create reader

$reader = $this->get('phpspreadsheet')->createReader('Xlsx');

Supported file types

Types are case sensitive. Supported types are: * Xlsx: Excel 2007 * Xls: Excel 5 * Xml: Excel 2003 XML * Slk: Symbolic Link (SYLK) * Ods: Libre Office (ODS) * Csv: CSV * Html: HTML, (*6)

Optional libraries can be installed for writing:

  • Tcpdf
  • Mpdf
  • Dompdf

to install these libraries :, (*7)

composer require tecnick.com/tcpdf
composer require mpdf/mpdf
composer require dompdf/dompdf

liuggio/Excelbundle portability

For users already using liuggio/ExcelBundle wanting to migrate to phpspreadsheet, the bundle should be directly compatible : old phpexcel file types are maintained, a compatibility factory has been added, and the phpexcel service is also redeclared., (*8)

More

See also the official PhpSpreadsheet documentation., (*9)

The Versions

28/03 2018

dev-master

9999999-dev

Symfony Bundle to read or write Excel file (including pdf, xlsx, odt), using phpoffice/phpspreadsheet library (replacement of phpoffice/phpexcel, abandonned)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giulio De Donato
by Bruno Heron

excel xls bundle symfony spreadsheet xlsx phpexcel

28/03 2018

1.0.0

1.0.0.0

Symfony Bundle to read or write Excel file (including pdf, xlsx, odt), using phpoffice/phpspreadsheet library (replacement of phpoffice/phpexcel, abandonned)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giulio De Donato
by Bruno Heron

excel xls bundle symfony spreadsheet xlsx phpexcel