Open the excel in new page while exporting

Discussion in 'ASP .Net Web Controls' started by chandra82_tech@yahoo.com, Aug 21, 2006.

  1. Guest

    Hi,

    I have implemented export to excel functionality, which actually
    exports the contents of HTML table to a excel sheet and asks for user
    input on whether to open or save or cancel. The issue is when the user
    clicks on "Open", the excel is opened in the same window where it is
    being called or initiated, can i make it open in a new window?
    Right now this how my code looks,
    Context.Response.Clear();
    //for displaying the open save dialogue box.
    Context.Response.AddHeader("content-disposition",
    "inline;filename=ExportContents");
    Context.Response.Charset = "";
    //set the target file type as excel.
    Context.Response.ContentType = "application/vnd.ms-excel";

    and i'm using a StringBuilder class to get all the information from my
    HTML table and exporting to the excel by the following code,
    //write to the excel sheet
    Context.Response.Write(sb.ToString());
    Context.Response.End();

    -Chandra
    , Aug 21, 2006
    #1
    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. =?Utf-8?B?U2lsZWVzaA==?=
    Replies:
    4
    Views:
    390
    =?Utf-8?B?U2lsZWVzaA==?=
    Nov 5, 2004
  2. =?Utf-8?B?U2lsZWVzaA==?=
    Replies:
    1
    Views:
    724
    Jim Corey
    Nov 8, 2004
  3. Luis Esteban Valencia
    Replies:
    1
    Views:
    1,370
    Carl Prothman [MVP]
    Jan 12, 2005
  4. =?Utf-8?B?U3JpZGhhcg==?=

    change the sheet name while exporting datagrid data to excel

    =?Utf-8?B?U3JpZGhhcg==?=, Nov 9, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    527
    =?Utf-8?B?U3JpZGhhcg==?=
    Nov 9, 2006
  5. Doogie
    Replies:
    1
    Views:
    443
    sloan
    Nov 19, 2008
Loading...

Share This Page