Results 1 to 3 of 3
  1. #1
    rekha is offline Member
    Join Date
    Mar 2009
    Posts
    8
    Rep Power
    0

    Default Opening excel from struts

    hi,

    I have created a workbook and store all the values in a excel file from my struts class.After this i wish to open that excel file as a separate window. how to do that? Please help me.

  2. #2
    sureshreddy is offline Member
    Join Date
    Apr 2009
    Posts
    1
    Rep Power
    0

    Default

    Hi in your servlet or in your jsp code use these two lines of code and add POI.jar file to your class path
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition", "inline; filename="+report.xls);


    regards
    suresh

  3. #3
    ron87 is offline Member
    Join Date
    Mar 2009
    Posts
    52
    Rep Power
    0

    Default

    search for mime mappings in the xml file which will be present in tomcat installation directory/conf
    according to the mime type mapping set the content using response.contentType()
    and use apache POI api or jexcel api to interact with excel sheets

Similar Threads

  1. decorator.jsp problem building Struts Menu in JSP when Struts action is used
    By dkirvan in forum JavaServer Pages (JSP) and JSTL
    Replies: 3
    Last Post: 04-29-2010, 05:33 AM
  2. Opening in Java and .Net
    By techinvo in forum Jobs Offered
    Replies: 0
    Last Post: 03-22-2009, 07:24 AM
  3. Replies: 0
    Last Post: 06-21-2008, 10:53 AM
  4. Opening a workspace twice
    By javaplus in forum Eclipse
    Replies: 0
    Last Post: 01-08-2008, 09:56 AM
  5. Opening URLConnection
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-24-2007, 07:37 PM

Posting Permissions

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