Exporting as Excel (database results)

Discussion in 'ASP General' started by Jawahar Rajan, Sep 29, 2003.

  1. All,
    I am trying to export a result set as an excel spread
    sheet. Most of the time this works as expected, when a
    user chooses to save as excel the browser pop-up a save as
    dialog to allow the user to save the spreadshet with
    a .xls name.

    Some times the browser will open up the file as text file
    within the bvrowser itself?

    These are my two lines of code to prompt the save as
    dialog for a Browser:
    Response.ContentType = "application/vnd.ms-excel"
    Response.AddHeader "Content-
    disposition", "attachment;filename=ReportsName.xls"

    I do not use any HTML to write out the Response from the
    Database rather just plain text and VBTab for a new column
    and VBCrLf for a new line.

    Thanks
    Jawahar
     
    Jawahar Rajan, Sep 29, 2003
    #1
    1. Advertising

  2. Jawahar Rajan

    Ray at Guest

    If the user does not have Excel or if the user has "confirm open after
    download" selected for the .xls filetype, he will get the download prompt.

    Ray at work

    "Jawahar Rajan" <> wrote in message
    news:236f01c38690$ef8577a0$...
    > All,
    > I am trying to export a result set as an excel spread
    > sheet. Most of the time this works as expected, when a
    > user chooses to save as excel the browser pop-up a save as
    > dialog to allow the user to save the spreadshet with
    > a .xls name.
    >
    > Some times the browser will open up the file as text file
    > within the bvrowser itself?
    >
    > These are my two lines of code to prompt the save as
    > dialog for a Browser:
    > Response.ContentType = "application/vnd.ms-excel"
    > Response.AddHeader "Content-
    > disposition", "attachment;filename=ReportsName.xls"
    >
    > I do not use any HTML to write out the Response from the
    > Database rather just plain text and VBTab for a new column
    > and VBCrLf for a new line.
    >
    > Thanks
    > Jawahar
    >
     
    Ray at, Sep 29, 2003
    #2
    1. Advertising

  3. Jawahar Rajan

    Bullschmidt Guest

    Would possibly removing the word attachment; help at all?


    Best regards,
    J. Paul Schmidt, Freelance ASP Web Developer
    http://www.Bullschmidt.com
    ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Bullschmidt, Sep 29, 2003
    #3
    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. Luis Esteban Valencia
    Replies:
    1
    Views:
    1,396
    Carl Prothman [MVP]
    Jan 12, 2005
  2. AD1234
    Replies:
    5
    Views:
    1,659
  3. Doogie
    Replies:
    1
    Views:
    455
    sloan
    Nov 19, 2008
  4. Replies:
    0
    Views:
    256
  5. Brave
    Replies:
    1
    Views:
    96
Loading...

Share This Page