Jasper Reports integration with Liferay

Liferay has one portlet which supports Jasper Reports , but that is not free. It is available only for EE edition people.

Luckily we have one portlet which is free and is based on Jasper reports

http://code.google.com/p/aperte-reports/

I have used it on Tomcat based liferay installation.

Some of the steps and things you need to do

* You need PostgreSQL database , it doenst not work with MySQL. The Postgre SQL based database if used to store internal details which are required for this portlet to work. So dont worry if your liferay install is MySQL or any other it can be used freely.

* Install Postgre and create one database which can be used by aperte-reports portlet

Configure JDBC datasource in tomcat

* In your tomcat context , (generally inside ROOT.xml ) add the following information

<Resource name="jdbc/aperte-reports" auth="Container"

    type="javax.sql.DataSource" driverClassName="org.postgresql.Driver" url="jdbc:postgresql://localhost:5432/aperteDb" username="postgres" password="root" maxActive="20" maxIdle="10" maxWait="-1"/>

aperteDb is database which i created in Postgre for this portlet

* Download the war file of aperte-reports portlet and deploy it

* Download extra jars from

http://jdbc.postgresql.org/download/postgresql-9.1-901.jdbc4.jar

to tomcat lib/ext folder

* Download Vaadin jar from its website

Also download 3 jars of

Vaadin add-ons:

  1. MaskedTextField v0.1.1
  2. ActiveLink v1.0
  3. CKEditor wrapper for Vaadin v1.0

Restart the tomcat and after your portlet deployment is done , you can go to Aperte Reports manager to import jmxml file of ireports into Liferay to create reports and charts

4 comments:

  1. Thanks for your pioneering work. However, I run into problem(s) when I follow your direction.

    I notice that I have:

    jdbc/aperte-reports
    javax.sql.DataSource
    Container

    in tomcat-6.0.32/webapps/aperte-reports-ui-2.2/WEB-INF/web.xml

    I also have:

    in tomcat-6.0.32/conf/Catalina/localhost/ROOT.xml (the only thing in this file)

    but when I add the report Portlets, the following error messages appear:
    Cannot create JDBC driver of class '' for connect URL 'null'
    java.lang.NullPointerException
    at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507)
    at com.liferay.portal.action.LayoutAction.includeLayoutConten02:37:24,050 ERROR [PortletServlet:97] javax.portlet.PortletException: java.lang.ExceptionInInitializerError
    javax.portlet.PortletException: java.lang.ExceptionInInitializerError

    Where did make the mistake?

    ReplyDelete
  2. @spencerhuang

    The error suggests that portlet is not able to connect to database which is required for him to store its data.

    Check your jdbc/aperte-reports settings and make sure postgre database is up.

    ReplyDelete
  3. Hi,
    Aperte Reports v.2.2.2 is available!

    Version 2 of Aperte Reports brings many fixes and improvements, including:
    reworked user interface
    better error reporting and handling
    support for Apache Tomcat and JBoss AS
    support for common RDBMS: MySQL, PostgreSQL, Oracle, Hypersonic

    Also, product documentation has been updated, allowing new users to quickly start using Aperte Reports.

    For mor information please go to Google code project site -->
    http://code.google.com/p/aperte-reports

    ReplyDelete
  4. What modifications do I need to do if I am using MySql?
    Here is what I put in my tomcat/conf/CATALINA/localhost/ROOT.xml




    Do I need to make any other changes anywhere?
    In the step where you mentioned --

    Download extra jars from

    http://jdbc.postgresql.org/download/postgresql-9.1-901.jdbc4.jar

    to tomcat lib/ext folder



    What jar should I download for mysql?
    And for Vaadin, in which folder should I put the jars?

    Thanks in advance!

    ReplyDelete

Please share your views and comments below.

Thank You.