Results 1 to 4 of 4
Thread: JSP To EXCEL
- 07-30-2007, 02:55 PM #1
Member
- Join Date
- Jul 2007
- Posts
- 3
- Rep Power
- 0
- 07-31-2007, 01:58 PM #2
Member
- Join Date
- Jul 2007
- Posts
- 41
- Rep Power
- 0
try this
Java Code:<% String mimeType = "application/vnd.ms-excel"; response.setContentType(mimeType); %>
- 07-31-2007, 03:57 PM #3
Member
- Join Date
- Jul 2007
- Posts
- 3
- Rep Power
- 0
thanks
hi all,
Thanks
by
Suresh
- 09-24-2009, 10:12 PM #4
Member
- Join Date
- Sep 2009
- Posts
- 1
- Rep Power
- 0
Tommy,
That works for excel before 2007. For MS office 2007, I did the same thing, but always give me a warning message about the extension error through I can open it with excel 2007. I tried to add the mime-type to my tomcat configuration file, but still could not export to .xlsx file. Help would be appreciated!
<mime-mapping>
<extension>xlsx</extension>
<mime-type>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</mime-type>
</mime-mapping>
In my jsp file:
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setHeader("Content-Disposition", "attachment; filename=\""+ myfile.xlsx+"\"");
I won't be able to open myfile.xlsx. However, if i save the file, and rename to myfile.xls, then I will be able to open it with excel 2007. It appears that the format is still in excel 2003/earlier version, not in 2007 formant.
Similar Threads
-
jsp excel
By lak in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 03-29-2008, 10:53 AM -
export to excel
By diana glz in forum Advanced JavaReplies: 0Last Post: 03-13-2008, 11:01 PM -
export to excel
By diana glz in forum New To JavaReplies: 0Last Post: 03-13-2008, 09:26 PM -
Javascript into Excel
By gdj100 in forum Advanced JavaReplies: 0Last Post: 03-12-2008, 11:03 AM -
ms excel
By cool_gal in forum New To JavaReplies: 9Last Post: 07-20-2007, 03:54 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks