rdpascua/reporter
Reporter
An elegant wrapper for JasperStarter using Laravel
Installation
composer require rdpascua/reporter
Usage
Loading a report and streaming it to the browser
use Rdpascua\Reporter\Facades\Reporter;
// Stream the report to the browser
Reporter::load('path/to/jasper/file.jasper')->stream('document.pdf');
Passing parameters
Reporter::load('path/to/jasper/file.jasper', [
'param1' => 'value1',
'param2' => 'value2',
])
->stream('document.pdf');
Saving the report to a file
Reporter::load('path/to/jasper/file.jasper', [
'param1' => 'value1',
'param2' => 'value2',
])
->save('document.pdf');
Generate a report using a database connection
Reporter::load('path/to/jasper/file.jasper')->withDataSource('pgsql')->save('document.pdf');
Compiling a jrxml file
Reporter::load('path/to/jasper/file.jrxml')->compile('path/to/jasper/file.jasper');
TODO: Compiling multiple jrxml files
Reporter::load([
'path/to/jasper/file1.jrxml',
'path/to/jasper/file2.jrxml',
'path/to/jasper/file3.jrxml',
])->compile();
// Generates the following files
// path/to/jasper/file1.jasper
// path/to/jasper/file2.jasper
// path/to/jasper/file3.jasper
TODO
- Compiling multiple jrxml files
- Add support for jdbc connections
- Add support for csv
- Add support for xml
- Add support for json
Related Packages
rcrowe/laravel-sentry
Tasty intergration of Laravel & Sentry for sweet reporting of your logs
2,757
15
ekmungai/eloquent-ifrs
Eloquent Double Entry Accounting with focus on IFRS Compliant Reporting
66,977
366