views:

419

answers:

5

I'm looking for a lightweight java reporting engine to be embedded in an applet application.

My first option was Jasper Reports, but the jar is over 2Mb, a little too heavy (and too bloated) for my needs. I don't know if there is modular jasper distribution, with funcionalities split in several jars (like html rendering, pdf, excel, compilation, runtime, etc).

I need to preview the report using Swing and print it. PDF export is a plus.

+1  A: 

If you can find no better solution, it should be possible to create a stripped down JAR file for Jasper Reports. The GenJar tool is supposed to be able to build a JAR file based on its static dependencies.

A long time ago, I used to use Zelix's "Classmaster" obfuscation tool which gave you the option of stripping out classes that were not used. I think it might even have stripped unused methods, though my memory is a bit hazy. (I used it on a closed source product ... that has since disappeared down an IP "blackhole".)

EDIT: another option is ProGuard, which does obfuscation and stripping like Classmaster, except that it is open source. (Sadly, they seem to have misconfigured their SF website link. But the link above works.)

Of course, if Jasper Reports uses Class.forName() you would need to identify all the relevant classes add them as "root" dependencies for the stripping tool that you use. In addition, you would need to look at the Jasper Reports license to make sure that you are allowed to "distribute" a stripped JAR file.

Stephen C
Jasper does load classes dynamically, you'll need to figure out the dependencies.
sventech
+3  A: 

Jasper Reports does include a jar with basic funcionality to preview and print reports. It's packaged as jasperreports-x.x.x-applet.jar, with around 350k.

tuler
+1  A: 

Why is 2Mb too big for a server-side library? Docmosis has a jar size under 500k, but requires OpenOffice on the server, so it is smaller in one way and bigger in another. Java won't load the 2Mb Jasper into memory unless you use all the features/classes.

jowierun
I'm not using it on the server-side, but on the client-side. The applet loads the .jasper stream from the server and a swing viewer presents it to the user.
tuler
Sorry, I didn't read the description well enough. Reporting systems generally assume that the client will be light-on and call back to the server for the hard work. I'm not aware of anything [powerful] that would do what you want.
jowierun
+3  A: 

I know this is a bit late, but with your requirements it seems like a perfect fit would be the reporting solution the company I work for puts out: i-net Crystal-Clear.

  • Lightweight and simple viewer (similar to a PDF viewer)
  • Can export into a bunch of different formats including PDF
  • Supports any JDBC data source, or also manual setting of data
  • Can run Crystal Reports templates
  • Comes with a free visual report designer

Check it out and tell us what you think.

Epaga
A: 

See NextReports Engine with around 300k. NextReports Designer is FREE to use.

decebal