2017 © Pedro Peláez
 

project xlsxwriter

image

damienlagae/xlsxwriter

  • Saturday, March 31, 2018
  • by damienlagae
  • Repository
  • 1 Watchers
  • 0 Stars
  • 755 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 8 Versions
  • 31 % Grown

The README.md

PHP_XLSXWriter

This library is designed to be lightweight, and have relatively low memory usage., (*1)

It is designed to output an Excel spreadsheet in with (Office 2007+) xlsx format, with just basic features supported: * supports PHP 5.2.1+ * takes UTF-8 encoded input * multiple worksheets * supports currency/date/numeric cell formatting, simple formulas, (*2)

Give this library a try, if you find yourself running out of memory writing spreadsheets with PHPExcel., (*3)

Simple PHP CLI example:, (*4)

$data = array(
    array('year','month','amount'),
    array('2003','1','220'),
    array('2003','2','153.5'),
);

$writer = new XLSXWriter();
$writer->writeSheet($data);
$writer->writeToFile('output.xlsx');

Multiple Sheets:, (*5)

$data1 = array(  
     array('5','3'),
     array('1','6'),
);
$data2 = array(  
     array('2','7','9'),
     array('4','8','0'),
);

$writer = new XLSXWriter();
$writer->setAuthor('Doc Author');
$writer->writeSheet($data1,'Sheet1');
$writer->writeSheet($data2,'Sheet2');
echo $writer->writeToString();

Simple/Advanced Cell Formats:, (*6)

//simple formats: date, datetime, integer, dollar, euro, string
$header = array(
  'created'=>'date',
  'product_id'=>'integer',
  'quantity'=>'#,##0',
  'amount'=>'dollar',
  'description'=>'string',
  'tax'=>'[$$-1009]#,##0.00;[RED]-[$$-1009]#,##0.00',
);
$data = array(
    array('2015-01-01',873,1,'44.00','misc','=D2*0.05'),
    array('2015-01-12',324,2,'88.00','none','=D3*0.05'),
);

$writer = new XLSXWriter();
$writer->writeSheet($data,'Sheet1', $header);
$writer->writeToFile('example.xlsx');

Load test with 50000 rows: (runs fast, with low memory usage), (*7)

include_once("xlsxwriter.class.php");
$header = array('c1'=>'string','c2'=>'string','c3'=>'string','c4'=>'string');
$writer = new XLSXWriter();
$writer->writeSheetHeader('Sheet1', $header );//optional
for($i=0; $i<50000; $i++)
{
    $writer->writeSheetRow('Sheet1', array(rand()%10000,rand()%10000,rand()%10000,rand()%10000) );
}
$writer->writeToFile('output.xlsx');
echo '#'.floor((memory_get_peak_usage())/1024/1024)."MB"."\n";

The Versions

31/03 2018

0.10

0.10.0.0

  Sources   Download

31/03 2018

0.11

0.11.0.0

  Sources   Download

27/02 2017

dev-master

9999999-dev https://github.com/mk-j/PHP_XLSXWriter

PHP Library to write XLSX files

  Sources   Download

MIT

The Requires

 

The Development Requires

php library excel xls xlsx

27/02 2017

1.0.x-dev

1.0.9999999.9999999-dev https://github.com/damienlagae/PHP_XLSXWriter

PHP Library to write XLSX files

  Sources   Download

MIT

The Requires

 

The Development Requires

php library excel xls xlsx

27/02 2017

1.0

1.0.0.0 https://github.com/damienlagae/PHP_XLSXWriter

PHP Library to write XLSX files

  Sources   Download

MIT

The Requires

 

The Development Requires

php library excel xls xlsx

28/07 2015

0.22

0.22.0.0 https://github.com/mk-j/PHP_XLSXWriter

PHP Library to write XLSX files

  Sources   Download

MIT

The Development Requires

php library excel xls xlsx

18/11 2014

0.21

0.21.0.0 https://github.com/mk-j/PHP_XLSXWriter

PHP Library to write XLSX files

  Sources   Download

MIT

The Development Requires

php library excel xls xlsx

23/10 2014

0.20

0.20.0.0 https://github.com/mk-j/PHP_XLSXWriter

PHP Library to write XLSX files

  Sources   Download

MIT

php library excel xls xlsx