20060322 Wednesday March 22, 2006

Using JasperReports with AppFuse and Spring MVC JasperReports LogoIt's been over a year since Gilberto wrote a message to the mailing list about how to use JasperReports with AppFuse's Spring MVC flavor. Now he's created a tutorial for how to use JasperReports in AppFuse. Thanks Gilberto!

I've seen a fair amount of howtos for Spring MVC + JasperReports. I've even written one myself as part of Chapter 6.5 in Spring Live. However, I haven't seen many articles detailing how to integrate JasperReports with other Java web frameworks. Are they out there and I'm just not seeing them? It'd be great if we could show how to integrate JasperReports with all the web frameworks that AppFuse supports. Posted in Java at Mar 22 2006, 07:46:58 AM MST 6 Comments

Comments:

If the framework is Struts, perhaps it would be best to prepare the report in the action and then pass it on to a servlet to generate the response through a stream (as struts Actions must end up with a mapping unlike SpringMVC, I haven't used it but that's my understanding). Then again, I'm having fears that having concurrent accesses you'd might end up with some problems, for instance certain report output types could be handled in a streaming fashion but for excel I belive you need to create the file first so I don't know if there might be some file overwriting issues (and I'd ask the same question on recompiling the reports always in the Action or not). This is an interesting discussion. Although jasperreports is an Open Source project, it's discussion list is very very unresponsive and underfrequented. My impression is that the developers tend to divert users to the JasperSoft Technical Support.

Posted by Srgjan Srepfler on March 22, 2006 at 11:48 AM MST #

The WebWork book, and also the WebWork wiki I believe, have some pretty good info on this. WebWork ships with a "jasper" result type even.

Posted by Patrick Lightbody on March 22, 2006 at 03:17 PM MST #

Srgjan, the way to do it in a Struts action is to write the generated report out to the response and return <code>null<code> from the action's <code>execute()</code> method (rather than a mapping). Theres a DownloadAction available to make this easier. More info on the Struts Wiki.

Posted by Niall on March 22, 2006 at 04:00 PM MST #

If we need excel reports only and all the data for excel report are already in Java it can be easier to use something like jXLS http://jxls.sourceforge.net

Posted by leonate on March 22, 2006 at 11:54 PM MST #

Hey, Matt. I'm actually helping on the wicket/JR integration support. It's "complete" and working fine though the examples are a little out of date now. The CVS repo is at http://cvs.sourceforge.net/viewcvs.py/wicket-stuff/wicket-contrib-jasperreports/. I'm planning on blogging about it soon, too.

Posted by Justin Lee on March 23, 2006 at 03:26 PM MST #

I am working with spring+hibernate+jsf and trying to integrate jsf with jasper reports with a clever way, does anyone know such a article?

Posted by Murat HAZER on March 27, 2006 at 07:20 AM MST #

Post a Comment:
  • HTML Syntax: Allowed
Click me to subscribe
Matt Raible is a Web Architect who enjoys developing applications with open source technologies. Contact me for rates.
« January 2009
SunMonTueWedThuFriSat
    
1
2
3
5
6
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
       
Today

Recent Entries

Tag Cloud