Coder Social home page Coder Social logo

kohana-phpexcel's Introduction

phpexcel

PHPExcel module for Kohana 3.0.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'));

kohana-phpexcel's People

Contributors

dshovchko avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.