Long Live Open Source Software !!

If you make some web applications with PHP, sometimes you don’t know how to create a good report. Maybe you’ll create another application written in VB combined with Crystal Report like i did in my previous project.:mrgreen:.But now there is an alternative to create a good report in PHP. “How will you do that?”, you’ll say that to me after read this introduction.

I will use JasperReport here to create my report. “Hey, JasperReport is based on Java, how can you use that in you PHP application?”. Don’t worry guys, there is a good tool outside there so you can use JasperReport in your PHP Application. That tool is called PHP/Java Bridge. PHP/Java Bridge allow you to use any Java class in your PHP Application. And with this bridge, you can create a report from php application with JasperReport. I will show you how to install and setup PHP/Java Bridge and JasperReport in your linux system now. Actually this tutorial is based on this post by Richard Johnson. And i make the tutorial for linux and with newer iReport.

  1. Install and download php and java into your system.
  2. Download the latest iReport software from here, and install it. Please download the software, not the netbeans plugin.
  3. Copy all files from [iReport home]/ireport/modules/ext/ to JAVA_HOME/jre/lib/ext/
  4. Download the latest version of the PHP/Java Bridge with source from here and extract it.
  5. Unzip the src.zip file (should be included in the download) and copy the contents of the “java” directory to your PHP application.
  6. Find JavaBridge.war and place it in some directory.
  7. Run the bridge with java -jar JavaBridge.war TestInstallation, FYI, i stop this bridge using pkill.:mrgreen:
  8. Here is Richard Johnson sample application and his sample report created by iReport so you can try your installation.

C’mon try it yourself and give any comment about this tutorial below.

Reblog this post [with Zemanta]
Be Sociable, Share!

Maybe you like this post too :