
Once you have created report on the report studio. You are going to need to deploy your report into the server or application. In this post, I will show how to deploy deploy the report into Jasper report server by using Jasper Report Studio.Deploying reports by using is very easy. But before I could deploy the reports, I need to create datasource in the server. JasperReport Server provide many facilities to reports from Jasper Report Studio by connecting direct from the studio to the server. In this post, I will demonstate how to create JNDI datasource, JDBC datasoure, Web service and Custom Java Bean Datasource. Once creating datasource, I will deploy reports by using created datasources.
Table of Contents
- Connect Report Studio to Remote Report Server
- Create and deploy report with JDBC datasource
- Create and deploy report with JNDI datasource
- Reference
For my environment, i have set up 2 Server for database server and Report server as below
For Database Server
- OS - FreeBSD 12
- Database - PostgreSQL 12
For Report Server
- OS - Ubuntu 20.10 LTS
- OpenJDK 8
- Wildfly Application Server 10.0.10
- Jasper Report Server 6.8
1.Connect Report Studio to Remote Report Server
First, I need to connect my report studio to the report server. To connect report studio to remote report server,just follow below.
-
Go to Repository Explorer > Servers, Right click > Create JasperReport Servers connection.
-
Input server connection parameters and test the connection and finished.
Now, we are ready to create the report and deploy into the server
2.Create and deploy report with JDBC datasource
I'll start with create report on Jasper Report Studio. But first, I need to create JDBC Connection in the report studio as following
-
Repository Explorer > Create Data Adapter > Database JDBC Connection
-
Input connection information such as server name/ip, port, database's name, username and password.
-
Then click finsih.
Once finishing create datasource, I create report by using created datasource as below
After creating the report, I will deploy the report to the server. To deploy the report to the server, I need to create datasource and queries in the server as below.
-
Create JDBC datasource, go to jasperserver > login > go to repository > Datasource
Right Click at datasource > Add resource > Datasource. In Type select JDBC and input all required connection information and test the connection.
-
Next is creating queries, to crete queries, just create queries fold. Right click at the queries folder, select add resource and select query
Now, it is time to deploy reports to the server as below.
-
First, go to publish report to the server
-
Connect to the remote server, select deploy folder
-
Select Datasource and Query from repository.
After Finish you can see the report is deployed in the server as below.
3.Create JNDI datasource
To create JNDI Datasource, You need to create JNDI datasource at the application server side. so, first I need to log in to Wildfly management page to create jndi datasource.
-
Create JNDI datasource at the server side. Login into the management page > configuration > subsystems > datasources > NON-XA > add datasource
-
Input select JDBC driver and fill out required connection information
Once finished creating JNDI datasource, then you just only deploy developed report into the jasper server by using created JNDI datasource. JDBC and JNDI is two simple basic datasource, you need to use for developing and deploying report into jasper report server.Most of the steps are conducted through GUI, so it is very easy.
No comments:
Post a Comment