Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

README.md

phpexcel

PHPExcel module for Kohana 3.3.x

Description

Kohana framework helper class to make spreadsheet creation easier

Instalation

Place the module in the modules/phpexcel.

Install library PHPExcel. In the application/vendor/ create a directory phpexcel. Download from official website (http://phpexcel.codeplex.com/) the latest version of the library PHPExcel, unzip and copy the entire contents of the directory classes/ in the application/vendor/.

In the application/bootstrap.php add module loading

Kohana::modules(array(
...
    'phpexcel'   => MODPATH.'phpexcel',
));

Usage

$ws = new Spreadsheet(array(
'author'       => 'Kohana-PHPExcel',
'title'	       => 'Report',
'subject'      => 'Subject',
'description'  => 'Description',
));

$ws->set_active_sheet(0);
$as = $ws->get_active_sheet();
$as->setTitle('Report');

$as->getDefaultStyle()->getFont()->setSize(9);

$as->getColumnDimension('A')->setWidth(7);
$as->getColumnDimension('B')->setWidth(40);
$as->getColumnDimension('C')->setWidth(12);
$as->getColumnDimension('D')->setWidth(10);

$sh = array(
1 => array('Day','User','Count','Price'),
2 => array(1, 'John', 5, 587),
3 => array(2, 'Den', 3, 981),
4 => array(3, 'Anny', 1, 214)
);

$ws->set_data($sh, false);
$ws->send(array('name'=>'report', 'format'=>'Excel5'));

About

Kohana framework helper class to make spreadsheet creation easier

Topics

Resources

Releases

No releases published

Packages

No packages published

Languages