JasperReports Server with JDBC Driver

This article explains how to use Treasure Data with JasperReports Server by leveraging our JDBC driver. By combining Treasure Data with JasperSoft, you can process terabytes of data on the cloud, while continuing to use your existing JasperSoft instances.

Table of Contents

Prerequisites

Untitled-3
Don't have time to setup JasperSoft + Treasure Data? Leverage our Setup Consultation Service.

Download JasperReports Server

You can download JasperReports Server from the link below. Version 4.7.0 was used for this article.

Download the Treasure Data JDBC Driver

You can download the driver itself from the link below. The driver is still in beta; any feedback is appreciated.

Untitled-3
This driver only works with Treasure Data. It does not run on other environments, such as your local Hadoop/Hive cluster.

Add Treasure Data as Data Source

Let’s add Treasure Data as Jasper’s data source. Please follow the procedure below.

Step 1: Copy JDBC Driver Jar to Jasperserver Application

First, copy the Treasure Data JDBC driver to the JasperReports Server’s jasperserver application before starting JasperReports Server.

$ cp td-jdbc-VERSION.jar \
  <jasper-server-install>/apache-tomcat/webapps/jasperserver/WEB-INF/lib/

Step 2: Start JasperReports Server

Start JasperReports Server as shown below.

$ cd <jasper-server-install>
$ ./ctlscript.sh start

Step 3: Log in to JasperReport Server as Administrator

Administrators log in through the standard login page using the following default credentials:

  • Community edition: username jasperadmin and password jasperadmin
  • Commercial edition: username superuser and password superuser

Step 4: Create a New Data Source

Select View > Repository. Right-click Data Sources and select Add Resource > Data Source from the context menu.

Step 5: Configure your JDBC Connection

Configure your JDBC parameters as shown below. When asked for your user name and password, please use your Treasure Data credentials (your user name is the email address you used to register on Treasure Data). Select Test Connection and then Submit. The data source is now registered on your JasperReports Server.

Register Reports in JasperReports Server

The rest of the process is identical to how you would create and run reports with a JDBC source.

Step 1: Register a New Query

Select View > Repository. Right-click Input data Types and select Add Resource > Query from the context menu.

Step 2: Name the Query

Name the query as shown below, then hit the Next button.

Step 3: Link a Data Source to the Query

Please select the sample Treasure Data data source that you registered as shown below, then hit the Next button.

Step 4: Define the Query

Please define the query as shown below, then hit the Save button. The query will be registered in JasperReports Server.

The query above is introduced in the JasperSoft iReport with JDBC Driver article.

Step5: Register a New Report

Select View > Repository. Right-click Input data Types and select Add Resource > JasperReport from the context menu.

Step 6: Set Up the Report

First, set up the report as shown in the figure below. Then, upload your JRXML file (the JasperSoft iReport with JDBC Driver article explains how to create this file).

Step 7: Link a Data Source to the Report

Select the sample Treasure Data data source that you registered as shown below.

Step 8: Locate Query

Select the query that you registered as shown below, then hit the Submit button. The report will be registered in JasperReports Server.

Run Reports in JasperReports Server

Select View > Repository. When you select Input data Types, you will see your registered report. Right-click it and select Run from the context menu.


Last modified: Jul 07 2016 19:00:56 UTC

If this article is incorrect or outdated, or omits critical information, please let us know. For all other issues, please see our support channels.