views:

55

answers:

1

So I have been making some reports and using displaytag to output these reports in html, csv, excel, pdf, etc. They are paginated, and take a simple object graph... and output excellent results everytime, with very little code.

However, I need to use displaytag or its equivalent outside of a jsp. So that a user can schedule a report to run, and that report is stored in a db, or emailed for later viewing. I have looked at jasper-based reporting solutions, but making a jasper jrxml file is just a nightmare. I know there are gui tools to help, but I'm content with the simple output of displaytable, so I'm happy to give up that control for ease of implementation.

Really, if I could take the display:table config out of the jsp I would, so please keep that in mind when proposing a solution.

btw, java solutions would be my cup of tea.

A: 

Why do you need to take it out of the JSP? It's doing a perfectly good job there of formatting your data.

You could write some code which makes a web request to your reporting JSP. It then streams the output to disk, or what ever it is you want to do. The simplest way would be to use the URL and HttpURLConnection classes to make the request.

Then simply schedule this new code, without having to make any changes to your JSP.

A_M
clearly I do not want to take displaytag out of the jsp, that'd be crazy. However, I want to use a displaytag-like configuration syntax to emit a report with no dependency on jsp, so that a quartz scheduler can call a domain object. I have though about calling into the jsp in the way you mention, however, with the authentication requirements it might be a pain.
Nathan Feger
If you need to manage a session, why not use something like HttpUnit to log on and make the necessary requests. It's a pretty simple API.
A_M