Download the PHP package stesa/phpjasper without Composer
On this page you can find all versions of the php package stesa/phpjasper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download stesa/phpjasper
More information about stesa/phpjasper
Files in stesa/phpjasper
Package phpjasper
Short Description A Laravel package for generating reports with JasperReports using the latest version of JasperStarter
License MIT
Informations about the package phpjasper
PHPJasper
A Laravel package for generating reports with JasperReports using the latest version of JasperStarter. Generate beautiful PDF, Excel, CSV, HTML, and other format reports from your Laravel application with ease.
Features
- Latest JasperReports: Uses JasperReports 7.0.3 via custom JasperStarter build
- Multiple Output Formats: PDF, Excel (XLS/XLSX), CSV, HTML, XML, and more
- Database Support: MySQL and PostgreSQL out of the box
- Fluent API: Intuitive, Laravel-style chainable methods
- Barcode Support: Full support for barcodes including Code128, Code39, QR codes, etc.
- JSON Output: Structured error handling and detailed logging
- Easy Integration: Automatic service provider discovery, facade support
- Comprehensive: Report compilation, execution, and parameter listing
Requirements
- PHP 8.0 or higher
- Laravel 9.0, 10.0, 11.0, or 12.0
- Java Runtime Environment (JRE) 24 or higher
Installation
1. Install via Composer
2. Publish Configuration (Optional)
This will create config/phpjasper.php for customization.
3. Publish Example Templates (Optional)
4. Verify Java Installation
Make sure Java is installed and accessible:
You should see Java 24 or higher.
Quick Start
Basic Usage
Using in Controller
API Reference
Compile
Compile a JRXML template to JASPER format:
Parameters:
$inputFile(string): Path to .jrxml file$outputFile(string, optional): Output path for .jasper file
Example:
Process
Generate a report from a JASPER or JRXML file:
Parameters:
$inputFile(string): Path to .jasper or .jrxml file$outputFile(string): Output file path (without extension)$options(array): Report options
Options:
Example:
List Parameters
List all parameters in a JASPER report:
Example:
Multiple Output Formats
Generate reports in multiple formats simultaneously:
Database Connections
Using Default Laravel Database
Using PostgreSQL
Report Parameters
Pass parameters to your reports:
In your JRXML, reference parameters like:
Configuration
The package can be configured via config/phpjasper.php:
Environment Variables
Add to your .env file:
Using Multiple Java Versions
If you have multiple Java versions installed, you can specify which one to use:
Via Configuration:
Via Environment Variable:
Programmatically:
Supported Formats
- PDF - Portable Document Format
- XLSX - Microsoft Excel 2007+
- XLS - Microsoft Excel (Legacy)
- CSV - Comma-separated values
- HTML - HTML format
- XML - XML format
- JRPRINT - JasperReports print format
Check supported formats:
Barcode Support
This package includes full barcode support through Barcode4J integration:
Supported Barcode Types:
- Code128
- Code39
- EAN-13, EAN-8
- UPC-A, UPC-E
- Codabar
- PDF417
- DataMatrix
- QR Code
Example JRXML Barcode Component:
Directory Structure
Recommended directory structure for reports:
Create directories:
Error Handling
The package throws exceptions with detailed error messages:
Advanced Usage
Get Command Without Executing
Custom JAR Path
Using Dependency Injection
Troubleshooting
Java Not Found
Error: java: command not found
Solution: Install Java JRE 24 or higher and ensure it's in your system PATH.
JAR File Not Found
Error: JasperStarter JAR not found
Solution: The JAR file should be automatically included in the vendor directory. If missing, check your composer installation or manually specify the path in config.
Database Connection Failed
Error: Database connection error
Solution:
- Verify database credentials
- Ensure database server is running
- Check firewall settings
- Verify database driver (mysql/postgresql)
Compilation Errors
Error: Unable to load report
Solution:
- Validate XML syntax in JRXML file
- Ensure JRXML uses UTF-8 encoding
- Check JasperReports version compatibility (should be 7.0.3 or lower)
- Use JasperSoft Studio 6.20.x or earlier to create templates
Creating Reports
Using JasperSoft Studio
- Download JasperSoft Studio 6.20.x or earlier
- Create a new report or open existing .jrxml template
- Design your report with fields, parameters, and formatting
- Save the .jrxml file to your templates directory
- Use PHPJasper to compile and generate reports
Report Design Tips
- Use parameters for dynamic values:
$P{parameter_name} - Use fields for database columns:
$F{column_name} - Use variables for calculations:
$V{variable_name} - Store images in the resources directory
- Test reports in JasperSoft Studio before using in Laravel
Performance Tips
- Pre-compile templates: Compile .jrxml to .jasper during deployment
- Use queued jobs: For large reports, use Laravel queues to avoid timeouts
- Clean up old reports: Regularly delete old files from output directory
- Cache compiled reports: Store compiled .jasper files for reuse
- Optimize queries: Ensure database queries in reports are optimized
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Credits
- Steven Samoy - Package creator
- JasperStarter - Based on custom build: ssamoy/jasperstarter
- JasperReports - Powered by JasperReports 7.0.3
- PHPJasper - Inspired by PHPJasper/phpjasper
License
This package is open-sourced software licensed under the MIT license.
Support
If you encounter any issues or have questions:
- Create an issue on GitHub
- Check existing issues for solutions
- Review the JasperStarter documentation
Changelog
See CHANGELOG.md for version history and changes.
All versions of phpjasper with dependencies
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
illuminate/console Version ^9.0|^10.0|^11.0|^12.0