How to give seperate file names for xls reports genetared usinf POI
amitava guha
Greenhorn
Joined: Jul 30, 2009
Posts: 7
posted
0
Hi
I am using apache POI to generate reports in excel format which will be displayed in Internet Explorer window.
I am creating the excel file in a folder and reading that from my action page and displaying it in IE using response.setContentType("application/vnd.ms-excel");
Because of this every time I generate a report the name of the file is shown as Report.do for all reports. How can I set the file name?
Any help will be appreciated.
Thanks
Amit
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35221
7
posted
0
Are you setting a Content-Disposition header? Something like:
I am getting a popup saying download file which has option to Open/Save/Cancel. If I save the file then it get saved with the report name [reportEntity.getReportName()] but if I click Open then it is opening in IE and then if I try to do save as, it shows "Copy of Reports.do" as file name.