SilverStray
Programmer
I am trying to save data I extracted from a bean to Excel. The bean is an ArrayList and I displayed its content on my page. I also have a button, which I hope, when clicked, will save the data to Excel. I tried to put the following function called by this button, but I don't think I'm getting it right because the Save to Excel popup window went on even before I clicked the button.
function download(){
<%@ page contentType = "application/vnd.ms-excel" %>
<% response.setContentType("application/vnd.ms-excel"
; %>
<% response.setHeader("Content-disposition","attachment;filename=_filename.xls"
; %>
window.document.form1.submit();
}
What is the proper way for me to get on with is? I hope you can help me.
Thanks in advance!
-joni
function download(){
<%@ page contentType = "application/vnd.ms-excel" %>
<% response.setContentType("application/vnd.ms-excel"
<% response.setHeader("Content-disposition","attachment;filename=_filename.xls"
window.document.form1.submit();
}
What is the proper way for me to get on with is? I hope you can help me.
Thanks in advance!
-joni