shoes polo ralph lauren How to deploy Reports from development to production environment
This article is intended as a guide to define, within a large organization, how to develop, test and publish reports of JasperReports in different JasperReports Server environments (development, pre production, production).
Reviewing the material published by JasperSoft in this regard, we find the tutorial “Driving Reports from Development to Production Tutorial” at the following address:It details how to export and import reports using js export and js import in different environments. However, as we move forward in the tutorial we see that for the process to be successful appears some problems: we must hand edit some XML files and it is not treated properly the problem of creating and using datasources, both the development of the reports themselves and once installed on the JasperReports Server, this hinders the proper security and passwords management (reports developers must not know the passwords of preproduction and production environments, and these should not appear in any way in the ZIP file with the reports that are delivered to the Systems Department for deployment).
This post exposes how to circumvent these problems so that the transition from developmentto production environment is done in the most simple, effective and safe way.
Usually in a large organization there are three environments: development, preproduction and production, where developers (working in the Development Department) create reports from databases and test servers (those who passwords are known by developers). However, servers and preproduction and production databasesare controlled by the Systems Department (responsible of applications deployment) that manages the credentials for access to these environments because of security considerations. The developers only have access to pre production environment to execute test plans to verify that the reports are working properly, and in no case they have grants to access to production environment (since the pre production environment is a clone production environment and suitable for testing). The production environment is usually a cluster of servers (JasperReports Server) prepared to respond to a major workload. Application reports access external databases that can be Postgres, Oracle,
On the other hand, is very important for the organization to define a standardized way to create packages or lots of application reports specifying, among other things, how to organize the reports, subreports, resources and images in folders. This standardization will greatly facilitate the maintenance of application reports.
At this point we suggest adopt a similar structure to that defined by the open source tool JDeploy, that can be found in:JDeploy tool allows us to perform operations on a JasperReports Server from the command line (batch deploy reports,
create datasources, ).
JDeploy suggests grouping all application reports on a ZIP file according to the following structure:
Where reports and internationalization files are in the root directory. Specific application subreports are located in the subfolder “subreports”, and shared subreports, that are used by more than one report of the root folder, are located in “subinformescomp”. Specific images of each report are located in “imaxes”, the reports shared images are located in “imaxescomp” directory. The names of these directories are parameterized so that the tool allows us to change them according to our needs. During reports deployment, JDeploy clone in the server the ZIP folder structure, creating the necessary directories on the server.
That said, the steps to be followed in a typical process of development and deployment of reports are:
1. Development of reports: for this we use the familiar JasperSoft iReport tool. Reports should be developed using DataSources whose name should be consistent in all three environments (development, preproduction and production), although their definition is independent (access credentials, at pointed databases, etc). The folder structure where we keep the reports, pictures, resources, , should be the specified above.
2. Reports ZIP file creation: after develop the reports, we must repackage them into a ZIP file with the standard structure, which in practice boils down to compress the folder with the reports and give an appropriate name.
3. That’s all!.
As seen, although the reports deployment is very simple, nice software development practices advised that the reports must be deployed primarily in the development environment, where developers usually have permission to create datasources and deploy reports directly, and can test their reports before validate them. After this,
developers can request a publication on preproduction environment.
After creating the datasource we can deploy the batch reporting (ZIP file) using the deploy command of JDeploy. An example of using this command is:localhost:8081
Where the parameters used represent the following information:
The correct result of this operation will display the batch of reports in the specified location with the directory structure defined above. You can view the changes by using the list command or the JasperReports Server Management Console.