My entire carrier is linked to Java. I have been working in Java for 15 years and I still love it. I currently develop NextReports application My Personal Blog My NextReports Blog NextReports Site Mihai has posted 34 posts at DZone. You can read more from them at their website. View Full User Profile

How Do You Use Your Reports?

04.12.2011
| 4792 views |
  • submit to reddit

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 :

1.Centralization
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.

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.  

Dashboard

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.setServer("http://localhost:8081/nextserver/api");               
client.setUsername("guest");
client.setPassword("pass");
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();
runReportMetaData.setReportId("3cb331e0-5ed9-4e03-b11c-b7f4bb8b6a4c");
runReportMetaData.setFormat(RunReportMetaData.HTML_FORMAT);
// set your parameters values
Map<String, Object> parametersValues = new HashMap<String, Object>();
parametersValues.put("Id", 2);
runReportMetaData.setParametersValues(parametersValues);
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.

Links

Published at DZone with permission of its author, Mihai Dinca - Panaitescu.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Dave Jarvis replied on Thu, 2011/04/14 - 3:25am

Looks similar to the Report Integration Framework:

http://www.whitemagicsoftware.com/software/java/rif/

 Which is documented in chapter 15 of Indispensable:

http://www.whitemagicsoftware.com/books/indispensable/

 

Mihai Dinca - P... replied on Thu, 2011/04/14 - 4:36am in response to: Dave Jarvis

As far as I see, Report Integration Framework is just an api, not a reporting server.

zel branco replied on Thu, 2011/04/14 - 9:06am

We use business objects to do similar stuff.. But such kind of stuff are license traps. As cons - unlike API's(like jfreechart etc) - this kind of stuff - forces you to run on "server"(instead of multiple boxes ) requiring lots of licenses(for simple stuff) Also the "webservice api"(just like BO SDK) typically tends to be slow or not flexible enough to easily integerate on your webservers. So in short while "server based reporting" is nice - there is acute need for good API(better then jfreechart/jasper reports) for report/chart generation in Java.

christy jones replied on Fri, 2011/04/15 - 1:57am

As if you are in a web hosting business you know how to deal servers well and it is helpful in other businesses,  you need to keep track of all the things you are doing. server based reporting helps you to manage your business plans you dos and don't list, customer record and everything else related to your business.

christy jones replied on Fri, 2011/04/15 - 2:02am

As being in a web hosting business I have to deal with servers and I maintain that server based reporting which is really helpful n secure. It is also important for other businesses as you have to keep track of each and every happening. so server based reporting is great!

Dave Jarvis replied on Thu, 2011/04/21 - 3:03am in response to: Mihai Dinca - Panaitescu

Yes, Mihai.

The point of the Report Integration Framework is to decouple the underlying reporting tool from the application that is offering reporting services -- for both web apps and server applications.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.