Win a copy of Java Challengers this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Error while downloading .xlsm excel sheet through a popup window

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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);
%>

 
Sheriff
Posts: 67528
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic