yiireport Extension for export Spreadsheet and PDF from scratch or templates using PHPExcel and PHPReport Libraries.

YiiReport

  1. Requirements
  2. Installation
  3. Usage
  4. Notes
  5. Example
  6. Resources

Yii extension for export Spreadsheet and PDF from scratch or templates using PHPExcel and PHPReport Libraries.

This library needs YiiExcel extension for work.

Requirements

  • Yii 1.1 or above.
  • PHPExcel 1.7.8
  • YiiExcel extension.
  • Optional: TcPDF, DomPDF or mPDF library.

Installation

  1. Download and install YiiExcel extension.
  2. Download a PDF library, like mPDF and copy to protected/vendors directory
  3. Download and Unzip YiiReport, then copy yiireport directory to protected/extensions.
  4. Edit yiireport.php config file if you need. Here you set the PDF library to use, the path for that library and the template path.
  5. Add YiiReport to imports:
...
'import'=>array(
    ...
    'application.vendors.phpexcel.PHPExcel',
    'ext.yiireport.*',
    ...
),

Usage

$r = new YiiReport(array('template'=> someTemplate.xls));
$r->load(array(...));
echo $r->render(format, name);

Notes

  • Inside yiireport.php config file, you must use alias path format.
  • The output format options are: 'excel5' for xls, 'excel2007' for xlsx, 'html' and 'pdf'.
  • PHPReport class have lites modifications over the original PHPReport class by Vernes Å iljegović.

Example

  1. Copy students.xls file from examples/templates to views/reports
  2. Copy actionExcel() method from SiteController.php example file to your own SiteController

Resources

3 1
26 followers
2 367 downloads
Yii Version: 1.1
License: GPL-2.0
Category: Others
Developed by: Yeye
Created on: Jan 25, 2013
Last updated: 11 years ago

Downloads

show all

Related Extensions