What is the best approach to use JasperReports?
Here we are talking about three main products: JasperReports: which is just a library to generate reports and fill it iReport: which is GUI tool to develop templates used by the above library JasperServer: which is full application with web interface for managing reports with users permissions and other features,
documentation is really not that good, i want to use the best of the above products to integrate JasperReports with my application (Spring/Hibernate), so please advice what is the best approach to do this,
1- design reports using iReport using embedded sql generation, and make it as a separate project from mine, I tried to use Hibernate or Spring within iReport but also I faced a lot of problems and no clear documentation for this part
2- attach it with my project, to use same Hibernate configuration, already created entities
3- try to use JasperServer which seems to be complicated, and then expose reports as webservices
or any other better, guaranteed approach, i know it's dependant on the way my project is dealing, but i've shortage in time, so it depends on the approach having better documentations or tutorials.
You can write your own Jasper framework in a module or subproject. You can maintain report definitions separately from queries and feed them with data produced by your code.
This way all data and handling stays in your project where it's easier to track or edit (e.g. when you only need to change an aspect of the query, add a filter or rewrite it for better performance). Also, this way you can use report data for something else (e.g. add CSV or XML output).
See http://en.wikipedia.org/wiki/JasperReports for the "What is" part of your question.
I faced the same problems when considering to use Jasper-reports in my application, I ended up given it up completely.
Anyway, take a look at this post for more information about different report frameworks for Java. Generating Reports - What works for you?
I wholeheartedly recommend that you take a look at BIRT http://www.eclipse.org/birt/phoenix/
I've used it with both Spring and Hibernate, and have no complain so far.
I can't comment on the other two approaches, but we are using Jasperserver and that seems to be more appropriate if you want to actually use a portal with which people will access their reports. With this, you create reports in ireport and publish them to the portal. People log in to the portal to access their reports. I don't think you'd use Jasperserver if you were simply embedding it in your application.
I've started using JasperServer-pro recently and tbh I quite like it. As far as I know there seem to be plenty of options in the way of integrating it with existing apps :-
1 -Deploy as standalone server, and use the WebService API to call into to generate and return your reports (these have to be predefined, either through iReport or JasperServer's own AdHoc Report Editor.
2- Deploy as standalone server, and do URL calls through a kicked-off browser to pull up reports (again predefined)
3 - (Pro-only) - Download the WAR BIN installer and rebrand it.
4 - Download the source code for JasperServer and build it from ground up
5 - Download the source code / JasperReports jars and borrow the parts you want to use in your source code.
For JasperReports can you buy documentation. You'll get a book and sample code that can help a lot. I just looked at the website (it's been some time ago I worked with JasperRepors, currently no reporting to do), they have a professional design application as well now: http://www.jaspersoft.com/jasperreports-professional.