aspose file tools*
The moose likes JSP and the fly likes Error while downloading .xlsm excel sheet through a popup window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Error while downloading .xlsm excel sheet through a popup window" Watch "Error while downloading .xlsm excel sheet through a popup window" New topic
Author

Error while downloading .xlsm excel sheet through a popup window

sanjeev damera
Greenhorn

Joined: Oct 25, 2012
Posts: 1
We have to provide a download option to an .xlsm (macros enabled) excel sheet by creating the popup window. While downloading the excel sheet, it is throwing the below error.

" Excel cannot open the file "null.xlsm" because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file"


In the code we are providing a link in a plugin & passing 2 parameters to that link. After clicking it invokes a JSP file which will in turn invoke a java class file & passes those 2 parameters. We are inserting the data into macros excel sheet in the Java class file and we are calling that class file through the JSP Page.

The JSP code in the body is as follows:

<%
String projectName = request.getParameter("ProjectName");
String fixVersion= request.getParameter("FixVersion");
FinalExtraction fe = new FinalExtraction();
fe.getIssuesFromProject(projectName,fixVersion);
%>

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61187
    
  66

A JSP is a poor technology choice. You should be using a servlet. Please read this article to find out why JSP is a poor choice for serving binary content.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
 
subject: Error while downloading .xlsm excel sheet through a popup window