on 10-04-2005 4:04 PM
I am using HSSF api to download an excel file. But the end users are not able to save the file. Some of them do not get the popup file download window so that they can choose to open or save. Is there a setting in the browser which shows up the window? The users may have different versions of excel on their pcs.
How to show the excel application menu 'file' so that users can save this file?
Any help would be appreciated.
Hi rao,
Are you setting the content disposition like following.
HttpServletResponse res = request.getServletResponse(true);
try {
res.setContentType("application/vnd.ms-excel");
res.setHeader("Content-disposition", "inline; filename=test.xls");
} catch (Exception e) {
e.printStackTrace();
}
Message was edited by: Prakash Singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Prakash,
I have followed your weblog and set the content dispostion.
HttpServletResponse res = request.getServletResponse(true);
try {
res.setContentType("application/vnd.ms-excel");
res.setHeader("Content-disposition", "inline; filename=report.xls");
wb.write(res.getOutputStream());
} catch (Exception e) {
e.printStackTrace();
}
When I test this on my pc, I get file download window and I can choose 'open' or'save'. I also have tested this on some of my collegues PCs successfully. But the some of the end users are not getting this window.
when the same is file is downloaded by running an asp page the enire MSExcel application with standard tool bar and menus(file edit etc..) is showing up.
Why is it not poosible to get the same result using HSSF api?
It has nothing to do with HSSF api. The user can disable the popup and unchecking the box that shows up whenever you open a document via IE. You need to ask your users to enable dialog box by performing the following steps.
1. Clcik Start->Settings->Control Panel->Folder Options
2. Select the tab file types and scroll all the way down to XLS file types
3. Select the XLS and click on Advanced button
4. Select the <b>Confirm open after download</b>.
PS: Please don't forget to reward points for helpful answer or problem resolved.
regards,
prakash
Prakash,
Thanks for the help. Now the users get a popup
window and they can open or save the file. When they choose 'save' and download the file can they get another popup window with options 'open', 'openfolder','cancel'?
I remember doing this lot of times when I download some file. Any Idea where the settings are !
How do I reward points?
Regards
Rao
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.