Hi all,
I'm working an a small application that uses Spring (2.0.3) and JasperReports. I configured everything (as
described in reference) and everything worked ... except for charts in HTML format online reports (so snd to
response immediately). I configured JasperReports ImageServlet and added the IMAGED_URI as exporter parameter
to my views (all JasperReportsMultiFormatView).
I started some debugging and noticed that the JasperPrint (the filled report) was not available for the
ImageServlet from the session, so I started digging but could not find any piece of code that actually places
the JasperPrint on the session.
Therefore I tried an extremely blunt hack: I extended the JasperReportsMultiFormatView and did an overwrite of
the renderMergedOutputModel method of its superclass AbstractJasperReportsView. I threw out all references to
private members (subReports stuff and response header population) and added the following as a last statement
(right after the renderReport call),
request.getSession().setAttribute(ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE, filledReport);
And now I'm receiving the chart-images.
Am I correct in assuming Spring never puts the filled report in the session, or did I overlook something? And
if I'm correct, are you going to introduce functionality for putting it on the session for html chart reports?
If not, do you have any pointers on how I can fix this properly for my app?
Thanks in advance,
Erwin Brinkhuis
|