Problem in exporting HTML contents to EXCEL page using JSP

Discussion in 'Java' started by SMuthaiyan@inautix.com, Jun 7, 2005.

  1. Guest

    Hi,

    I am trying to create a EXCEL sheet in a jsp program.
    Say the jsp program is CallExcel.jsp

    I am using response.setContentType("application/vnd.ms-excel");
    to make the content type as excel.

    The link which calls the CallExcel.jsp is like
    http://<ip.address>:8080/<root folder>/CallExcel.jsp?&obj=<value> Where
    obj is the parameter being passed to the jsp page.
    When I try the link it is trying to open a file with the name
    CallExcel.jsp?&obj=<value> and not as CallExcel.xls
    We are having EXCEL 2002 in our machine. And I am not able to open the
    file. I don't know what is the problem.
    Waiting for the response.

    Thanks
     
    , Jun 7, 2005
    #1
    1. Advertisements

  2. Rivky Guest

    try setting this as well

    response.setHeader("Content-disposition","attachment;
    filename=CallExcel.xls" );
    or
    res.setHeader("Content-disposition","inline; filename=CallExcel.xls");

    depending on wether you want excel to launch(attachemnt) or you want
    the excel sheet result within the browser (inline)
     
    Rivky, Jun 8, 2005
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ravindra
    Replies:
    0
    Views:
    855
    Ravindra
    Dec 14, 2005
  2. Replies:
    1
    Views:
    2,141
    Alvin Bruney [MVP]
    May 10, 2004
  3. Luis Esteban Valencia
    Replies:
    1
    Views:
    1,605
    Carl Prothman [MVP]
    Jan 12, 2005
  4. DigitalUncle
    Replies:
    0
    Views:
    1,255
    DigitalUncle
    Nov 2, 2004
  5. Replies:
    6
    Views:
    3,773
  6. Gobi
    Replies:
    8
    Views:
    17,000
    mbalhoot
    May 18, 2011
  7. Doogie
    Replies:
    1
    Views:
    677
    sloan
    Nov 19, 2008
  8. Dan
    Replies:
    2
    Views:
    990
Loading...