I am getting the result set in servlet and then forwarding to the JSP page where I put all data from resultset to table and then getting output to excel file. in the top of my JSP page I have
response.setContentType("application/vnd.ms-excel;");
filename="Report";
filename+=".xls";
response.addHeader("Content-Disposition","attachment; filename="+filename);
The problem is it is downloading data in excel sheet but default as web page so whenever i download the data i have to manually change the save as type to Excel workbook. and also when i download to excel it is warning me that file is not in XLS format whether you want to open it not.
Is there any way I can do like whenever I download the data in excel it will say Excel workbook in save as type?