This topic is locked

Reports with Jasper PHP

9/18/2021 6:42:03 PM
PHPRunner Tips and Tricks
fhumanes author

There are many developers who request to produce reports (documents and listings) in PDF format and one of the preferred tools to make all kinds of reports is Jasper Report (Community version).

The most "serious" problem with this solution is that it is required to deploy a Java application on our equipment and if you have hired a PHP hosting, you will not be able to deploy Java applications.

If you can deploy Java applications and require many types of reports, it evaluates this solution as it has a RESTFULL API, which you can from PHP (PHPRunner) request the report and obtain it to provide you with your reports to your PHP application (if you need more Information write me an email and I'll explain how you can do it. It is very simple and efficient).

For all those who like to have a 100% PHP solution, it has been told that there was a long time that there was a development https://github.com/quilhasoft/Jasperphp, it is not very developed but it works part of the definitions of the "Report " from Jasper.

This solution I do not like it a lot, you know that I think the reports must be passed to Excel format and not stay in PDF, but there are many colleagues who request me the preparation of PDF and I have been studying it and making this example that It can greatly facilitate the preparation of reports in PDF format.

I will not explain what Jasper Report's solution is, there is much written, explanatory videos, etc., so I will only indicate 2 features:

  • It has a "Jasper Studio" visual tool that allows us to design and test the reports and is free.
  • It has an application that allows us to execute these reports. In our case, this application will be replaced by JasperPHP

Objective

Design reports with Jasper Studio and execute these reports in our PHPRunner application. The output of these reports is exclusively PDF.

DEMO: http://fhumanes.com/jasper_php/

If you are interested, this topic is still reading the article on my portal. You will also have the sources for you to run it in your Windows