tags:

views:

102

answers:

4

I am building a j2ee web application with a MySQL db. I need to whip up some reports, and slice and dice the data in various ways. Is it best to tackle each report requirement, write the code to serve up the data? Or, is there a framework I should look into?

+5  A: 

Take a look at JasperReports (http://www.jasperforge.org). You can integrate it into your Java app or use it as a stand-alone reporting application along the same lines as Crystal Reports.

Brian Showalter
+1  A: 

recommend ireport, a sub-project in JasperReports

http://jasperforge.org/plugins/project/project_home.php?projectname=ireport

liya
+2  A: 

It's hard to give a precise answer as you didn't give many details so I'd just suggest to have a look at JasperReport (and iReport), Eclipse Birt or Pentaho Report.

This thread will give you some information on the differences between them. Or Google a bit.

Pascal Thivent
i'm trying to understand the difference between writing code to display data, vs. using something like iReport.Because i've never used reporting services, what is the difference between getting some requirements, writing code to get and display the data, vs. using a reporting service like iReport?
bmw0128
The iReport tool lets you use a graphical designer to lay out a report and get it the way you want it. Then you can either import the .jrxml file into a JasperReports server and run it there, or you can plug it into your own Java code and run it stand-alone. It is far easier and faster to use this method than to, for example, hard-code a report using just the iText library.
Brian Showalter
Basically, a reporting service will provide a designer to create a reporting template and an API to feed the template with data and generate the reports (in various format). Without such a service, well, you have to do everything manually.
Pascal Thivent
thx, good explanation. another question, since i want to keep my users in the web application, and have the application give serve up various reports, can i have the user click on a certain type of report they want, then have my java code use the reporting service? right now, my mind is thinking that a reporting service is necessarily a tool that a user would use, in addition to my website (something i want to avoid), am i clear enough with this question?
bmw0128
Using a reporting service is "internal" stuff, it's **your** java code that uses it, it's transparent to the user.
Pascal Thivent
ok, final two questions, after researching, are these steps accurate:1. use iReport to design a report, sort of make a template visually2. in my java code, referencing an iReport template, fill it with data and print it.3. java code controls where the report is placed in the directory structure of the web application, so that the report may be linked to--is that the big picture?
bmw0128
Yes, that's the idea.
Brian Showalter
+1  A: 

You might also want to look at Docmosis since you can do a lot of the work in the templates which are just doc or odf documents. You can't do everything in Docmosis but typical report stuff can be done faster little code.

jowierun