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. Advertising

  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. Advertising

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. Replies:
    1
    Views:
    1,886
    Alvin Bruney [MVP]
    May 10, 2004
  2. Luis Esteban Valencia
    Replies:
    1
    Views:
    1,379
    Carl Prothman [MVP]
    Jan 12, 2005
  3. DigitalUncle
    Replies:
    0
    Views:
    899
    DigitalUncle
    Nov 2, 2004
  4. Replies:
    6
    Views:
    3,100
  5. Doogie
    Replies:
    1
    Views:
    448
    sloan
    Nov 19, 2008
Loading...

Share This Page