开发者

How should I architect JasperReports with a PHP front+backend system

开发者 https://www.devze.com 2022-12-23 09:38 出处:网络
Our system is written completely in PHP. For various business reasons (which are a given) I need to build the reports of the system using JasperReports.

Our system is written completely in PHP.

For various business reasons (which are a given) I need to build the reports of the system using JasperReports.

What architecture should I use? Should I put the Jasper as a stand alone server (if possible) and let the php query against it, should I ha开发者_JAVA技巧ve it generate the reports with a cron, and then let the PHP scoop up the files and send them to the web client/browser...


JasperServer seems to be the best option, having:

Comprehensive Web Services, Java, and HTTP APIs, as well as support for Web Services from non-Java environments such as .NET (C#), C++, and PHP

Another option is to implement something like that yourself, with only the functionality you need. Make a separate java web-app that generates the reports, using either web-services or REST to communicate with it.


If you like to keep things simple and "free", then i recommend:

  • Build your own small Java webapp.
  • Use DynamicJasper to build customized reports.
  • Expose a web service from the Java app, and call it from your PHP.
  • Java app will reply with a PDF file.


You can use the php java extension and compile and generate the report right from php. Example code and instructions: here.

0

精彩评论

暂无评论...
验证码 换一张
取 消