Setting filename for JIRA Excel report
Normally, when you click the Excel View in your report, you get a file named ConfigureReport!excelView.jspa
.
But what if you want a more user-friendly name that is recognized as an Excel file?
All you need to do is to set a proper response header, in this case content-disposition
.
Just use the following code in your report’s generateReportExcel()
method:
We use it in an abstract parent of our reports and just call super.generateReportExcel(...)
from child classes.
Btw. the content-disposition
format used above might not work in all browsers. If you need to support older browsers, use the filename
value twice, once with and once without the asterisk:
The above way of setting the value has been posted in the article Download non-english filenames by Rob Mueller.
Comments