How Do You Use Your Reports?

DZone 's Guide to

How Do You Use Your Reports?

· Java Zone ·
Free Resource

Following first part “How do you make your reports? “  I want to show what the benefits of using a centralized reporting server application are. Even today I hear that in some small or medium companies internal reports are generated by hand. People are writing their sql in their favorite development tool and then are getting the data and put in a excel file to pass to whom it may concern. I even heard a case when ‘the man’ who had to run a specific report had to be there to manual start it at noon. OMG!

So if you need to create some reports for your use or for customer use you know that making them is just the first step. You have  to use them wisely. You need a reporting server . So do we and we created NextReports Server, a web reporting server that helps automating production and delivery of business reports. It is a young application created with JackRabbit (implementation of the Content Repository for Java Technology API JCR, specified in JSR 170 and 283),  Spring and Wicket frameworks.

The main benefits for any reporting server can be summarized as follows :

We need all of our reports to be in one place no matter for whom, no matter the business, no matter the importance. Putting them together was the wright thing.

2. Management
A reporting server allows managing all your data sources, reports, charts, to group them in folders, to view specific information like parameters, ids, queries.

3. Scheduling
If you still run your reports by hand, you should ask yourself why. Scheduling is perhaps the most needed functionality in reporting. And you do not have to reinvent the wheel. There are very robust implementations out there. We choose Quartz which may configure cron-like jobs, making possible for complex scheduling formats.

4. Distribution
A very important issue is what you do with your reports. You may see the result on the server, you may automatically send the result or a link to result to some customers, you may automatically put it on someone other’s computer through FTP, SSH, Windows Share, WebDAV protocols.

5. History
You may need to know how the report looked a week or a month ago to compare data, to make analysis. Keeping your running history is your friend.

6. Versioning
Modifying some reports and charts happens very often, so you need to keep your previous versions. But there is more you can do. You can run any version, you can set any version as the default one. Because we used JackRabbit we had it out-of-the-box.

7. Monitor
You surely want to know which reports are running, how much time passed since they started, when will they run again, what parameters values were used. You also want to see if the report was generated correctly or if an error occurred and what was that error.  You may want to stop a running process if too much time passed. For all these you need a monitor.


8. Security
Because you have all reports together, you need security for all entities. If you are using Spring, then Spring Security must be your choice . For every entity you can define and set permissions like read, write, delete, execute, security for specific users or group of users.

9. Live Visualization
Looking at data in real time is very important in some business. You need charts, alarms, data tables. You may group them in dashboards making possible to look for an entire perspective of your business.  


10. Advanced analysis
Do you need some fancy stuff like drill down. You can do it on a reporting server

11. Web Services
You have the reports on the server, you can run them there, but you also want to be able to run them from your application. A web service offers you this possibility and allows you to connect to server over https using SSL. We used Jersey an open source JAX-RS (JSR 311) Reference Implementation for building RESTful Web services. You create your client very easy :

WebServiceClient client = new WebServiceClient();        
client.setPasswordEncoder(new Md5PasswordEncoder());

To run a report we provide a simple api.You have to know report’s id on the server (seen inside the information data) and to pass all the parameters values:

RunReportMetaData runReportMetaData = new RunReportMetaData();
// set your parameters values
Map<String, Object> parametersValues = new HashMap<String, Object>();
parametersValues.put("Id", 2);
try {
     String documentUrl = client.runReport(runReportMetaData);
} catch (WebServiceException e) {            
     // do whatever you need to do
12. Support for other engines
There are reporting solutions that require to have a server for every engine you may have. For us this was not a good approach because we also wanted our Jasper reports to be in the same place with Next reports. So a wrapper over Jasper engine was created. As a rule of thumb, if you need something different make sure to have that in mind and to allow your application to extend easily.

In a following  part “How do you configure your reporting platform?” I will write about customizations you may need to do in order to allow for fast response or to integrate with other applications.



Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}