Results 1 to 4 of 4

Thread: JSP To EXCEL

  1. #1
    sureshsri1981 is offline Member
    Join Date
    Jul 2007
    Posts
    3
    Rep Power
    0

    Smile JSP To EXCEL

    hi all,

    how to convert JSP page to Excel file using JSP or Java Script. please help me

    by

    Suresh

  2. #2
    tommy is offline Member
    Join Date
    Jul 2007
    Posts
    41
    Rep Power
    0

    Default

    try this
    Java Code:
    <&#37;
    String mimeType = "application/vnd.ms-excel";
    response.setContentType(mimeType);
    %>

  3. #3
    sureshsri1981 is offline Member
    Join Date
    Jul 2007
    Posts
    3
    Rep Power
    0

    Default thanks

    hi all,

    Thanks

    by

    Suresh

  4. #4
    delishen is offline Member
    Join Date
    Sep 2009
    Posts
    1
    Rep Power
    0

    Default

    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

  1. jsp excel
    By lak in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 03-29-2008, 11:53 AM
  2. export to excel
    By diana glz in forum Advanced Java
    Replies: 0
    Last Post: 03-14-2008, 12:01 AM
  3. export to excel
    By diana glz in forum New To Java
    Replies: 0
    Last Post: 03-13-2008, 10:26 PM
  4. Javascript into Excel
    By gdj100 in forum Advanced Java
    Replies: 0
    Last Post: 03-12-2008, 12:03 PM
  5. ms excel
    By cool_gal in forum New To Java
    Replies: 9
    Last Post: 07-20-2007, 04:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •