I didn't give JR integration much thought myself before.
I think JasperReports is able to produce more than PDF, right? As in
case it produces HTML/ XML/ Image, you would probably want to be able to
include in your page just like say an image. However, the trouble starts
when it is a PDF, as you can't just include that in your page. I am
thinking of two different options here:
1) JR gets its own 'Page' hierarchy. A JR is a special kind of page you
can redirect to, and easily set reporting parameters on. There can be
nothing around it (and as far as I am concerned it shouldn't be in the
session), so you should do any integration yourself, e.g. by working
with frames (or just be happy that it takes your whole browser window);
2) I am not sure if it can be done, but I see libraries like Dojo just
add new IFrames instances to the browser window on the fly. Maybe we
could use such a technique to include PDFs in pages just like we do with
other components now.
Eelco
Philip A. Chapman wrote:
Eelco,
I would certainly be interested in sharing the code. I've spent most of
the time since our first correspondence coding some other stuff in the
project; so I haven't actually worked on this JasperReport classes until
today. The JasperReportResourceStream is at
http://pcsw.us/misc/JasperReportResourceStream.java. It's not as
generic as we would want, but you'll get the idea.
I don't think subclassing page would work. My thought is that using the
IResourceStream, it can produce html, pdf, xls, or even xml output;
rather than just html.
I'm not sure how the subclass of ResourceStreamLocator would work,
except maybe for me, it would take a URL something like:
http://mywebapp/report?oid=?¶m1name=param1value¶m2name=param2value...
Again this isn't exactly generic. I am keeping the reports serialized
and stored in large objects in a postgreSQL database. I think a more
generic method would probably have the reports loaded from the classpath
or an external URL.
I have not written any code for the ResourceStreamLocator yet. I was
pretty much polling for opinions on whether this is a good idea. I'm
still trying to get comfortable with wicket and wasn't sure if this was
how others that are more familiar with it would approach the problem.
Thanks,
Eelco Hillenius wrote:
How would you use it? Could you give us example code of how you would
plan to use it (like, would you use it instead of a Page, or include it
somehow)? And would you be interested in sharing your code?
Thanks,
Eelco
Philip A. Chapman wrote:
I have created a IResourceStream that will provide the JasperReport
output. I am thinking that I should create a ResourceStreamLocator that
will return the new ResourceStream and override the
Application.getResourceStreamLocator(). Is this the right way to do it?
I don't yet have a good grasp of ResourceStreamLocator. It's a good
bit to wade through.
Thanks,
Eelco Hillenius wrote:
I haven't yet. It's been on my wish list for a long time. Shouldn't be
too hard probably... maybe you could take a look at how resources are
handled.
Eelco
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user