I am using the jasper plugin that comes with
Struts 2.2.3. The loading and display of my jasper report is fine. The problem is I only see the name of an action as the title and not the name I set in struts.xml. Here is the relevant code from that file:
<result name="xls" type="jasper">
<param name="location">/reports/${jasperRpt}</param>
<param name="dataSource">jasperRptData</param>
<param name="format">XLS</param>
<param name="reportParameters">jasperRptParams</param>
<param name="documentName">jasperRptFileName</param>
</result>
The relevant javadoc says that by using the documentName parameter, it would end up setting a ContentDisposition attribute on the response object with
inline;filename="<action.getJasperRptFileName()>.<format>"
However, when I execute the code, the fileName is not being set.
I continued to search and tried another solution, to no avail:
<result name="xls" type="jasper">
<param name="location">/reports/${jasperRpt}</param>
<param name="dataSource">jasperRptData</param>
<param name="format">XLS</param>
<param name="reportParameters">jasperRptParams</param>
<param name="contentType">application/application/vnd.ms-excel</param>
<param name="contentDisposition">filename="${jasperRptFileName}.xls"</param>
</result>
No matter what I attempt, only the action is displayed as the title? Any clues as to what I'm doing wrong or how to fix it?
Thanks