posted 12 years ago
I am using struts2-jasperreports-plugin-2.2.3.1 and I'm having a problem getting a correct filename to display when clicking "save as". The default filename that is displayed when the dialog first appears is the name of the action. I have the following in my struts.xml file:
<global-results>
<result name="pdf" type="jasper">
<param name="location">/reports/${jasperRpt}</param>
<param name="dataSource">jasperRptData</param>
<param name="format">PDF</param>
<param name="reportParameters">jasperRptParams</param>
<param name="documentName">jasperRptFileName</param>
</result>
<result name="xls" type="jasper">
<param name="location">/reports/${jasperRpt}</param>
<param name="dataSource">jasperRptData</param>
<param name="format">XLS</param>
<param name="documentName">jasperRptFileName</param>
<param name="reportParameters">jasperRptParams</param>
</result>
</global-results>
Following the API javadoc, when the output response stream is written, Content-disposition was set with "inline;filename=jasperRptFilename.pdf", which should result in jasperRptFilename.pdf appearing as the default name when the save dialog appears. Rather, the name of the action is shown. I've included an attachment, which shows the name of the action, generateStandardReport.pdf, as the default display name.
Also, "Struts Problem Report" appears as the tab title for the report. I turned the log4j information level to DEBUG, and didn't see one Exception in the log file, so I don't know where that is coming from, and if it's involved in the issue at hand. I've also included an attachment showing that as well.
Any assistance will be GREATLY appreciated. By the way, I'm using jasperreports-4.1.3, along with it's associated dependent jars.
report_data_display.JPG
report_save_dialog.JPG