JPivot is a JSP custom tag library that renders an OLAP table and let users perform typical OLAP navigations like slice and dice, drill down and roll up. It uses Mondrian as its OLAP Server. JPivot also supports XMLA datasource access.

How to run?

Download the jpivot-[version].zip and extract the jpivot.war file. Place the war file into tomcats webapp directory.

Make sure, Mondrian gets some memory for caching - this will improve speed significantly. For example, set the environment variable JAVA_OPTS=-Xms256m -Xmx512m to have 256 megs for caching and 512 megs for temporary peaks.

Start Tomcat and point your browser to http://localhost:8080/jpivot. You'll need JDK 1.4 and Tomcat 4.1.30, JPivot does not work with earlier versions (sorry).

There are some simple examples that run without a database, but you probably want to run the DB examples too. Download the MondrianFoodMart-Access.zip and set up an ODBC datasource called MondrianFoodMart that uses MS Access Database and points to MondrianFoodMart.mdb from the above download. JPivot examples are configured to use this setup.

Using JDBC driver

JPivot reads the connection parameters from JSPs containing the <jp:mondrianQuery ...> tag which contains the MDX query. This allows to run queries against different databases. The example JSPs live in /WEB-INF/queries and are configured for MS Access, the MySQL version is commented out. You will have to change these to run other databases.

Using J2EE DataSource

You may use a predefined JDBC DataSource to run your MDX queries.
        MDX goes here
Look at the tomcat documentation to see how to set up a datasource. Example follows:
    <Context path="/jpivot" docBase="C:\dev\jpivot\build\web" debug="0"
             reloadable="true" crossContext="true">
      <Resource auth="Container" name="jdbc/JPivotDS"
      <ResourceParams name="jdbc/JPivotDS">
In web.xml you have to reference the data source as follows:
      <description>DB Connection</description>

How to compile?

The distribution contains binary and source. The jpivot.war file contains in its /WEB-INF/lib directory all *.jar files that are needed to build. The simplest way to set up a build environment is to
  1. extract the jpivot.war file to some temp directory by renaming it to jpivot.zip
  2. from /WEB-INF/lib copy all *.jar files except jpivot.jar to the lib/ directory of the jpivot distribution (which already contains mondrian-src.jar
Now you should be able to build JPivot using ant. You will have to define the following ant properties in your build.properties (e.g. in your home directory):
Then ant should work. For running the tests you will have to set up the MondrianFoodMart database, either MS Access or MySQL (see build.xml).

How to use in another web application?

Unzip the war file. You will need the following files
  • /wcf/**
  • /jpivot/**
  • /WEB-INF/wcf/**
  • /WEB-INF/jpivot/**
  • /WEB-INF/lib/**
  • You will have to merge the entries from /WEB-INF/web.xml into your applications web.xml