dev-master
9999999-dev https://github.com/linkorb/birt-rendererRender BIRT reports from PHP
MIT
The Requires
reporting business intelligence birt
Wallogit.com
2017 © Pedro Peláez
Render BIRT reports from PHP
Render BIRT .rptdesign files from your PHP application., (*1)
You can use the BIRT Designer to create reports, and save them as .rptdesign files.
Then you can generate the reports from your PHP application and present them to your end user., (*2)
The reports can be generated in HTML, PDF, DOC, XLS, PPT and Postscript., (*3)
This library is a clean wrapper around the genReport.sh shell-script which is part of the BIRT Runtime.
This means that you'll need to have the BIRT Runtime installed (see below)., (*4)
You'll need to have a recent version of the BIRT Runtime extracted somewhere on your computer/server., (*5)
You can download it here: http://download.eclipse.org/birt/downloads/, (*6)
Make sure you download the BIRT Runtime, and not the All-in-One or other options., (*7)
After downloading the file (birt-runtime-4_4_1-20140916.zip at the time of this writing), simply extract the zip file somewhere on your disk., (*8)
You'll need to remember the pathname, as you'll need to when instantiating a new Renderer in your code., (*9)
use BirtRenderer\Renderer;
use BirtRenderer\Report;
use BirtRenderer\Parameter;
// Instantiate a report, by filename
$report = new Report();
$report->loadFilename('/home/yourname/example.rptdesign');
// Instantiate the Renderer
$renderer = new Renderer();
// Set the BIRT_HOME environment variable (important)
$renderer->setBirtHome('/home/yourname/birt-runtime-4_4_1');
// Create a list of report-parameters (key/value)
$parameters = array();
$parameters[] = new Parameter('Color', 'Red');
$parameters[] = new Parameter('Size', 'XL');
// Render the report, with supplied parameters to $outputfilename
$outputfilename = '/home/yourname/out.pdf';
$renderer->render($report, $parameters, $outputfilename);
This library includes an example console command to invoke the library. You can use it like this:, (*10)
export BIRT_HOME=/home/yourname/birt-runtime-4_4_1 ./bin/birt-renderer report:render --parameter Color=Red --parameter Size=XL myreport.rptdesign output.pdf
Based on the file-extension of the output file it will automatically detect the format., (*11)
MIT (see LICENSE.md), (*12)

Check out our other projects at linkorb.com/engineering., (*13)
Btw, we're hiring!, (*14)
Render BIRT reports from PHP
MIT
reporting business intelligence birt