How to export a dataset to excel?

Discussion in 'ASP .Net' started by Luis Esteban Valencia, Nov 3, 2004.

  1. I have a page that generates a table depending on the querystring from a
    master page. But as its a transaction history I want to show it in excel.
    How can I generate an excel file from a DATASET?



    --
    LUIS ESTEBAN VALENCIA
    MICROSOFT DCE 2.
    MIEMBRO ACTIVO DE ALIANZADEV
     
    Luis Esteban Valencia, Nov 3, 2004
    #1
    1. Advertising

  2. Luis Esteban Valencia

    Saravana Guest

    Check out this link

    HOW TO: Transform a DataSet to Spreadsheet XML for Excel by Using Visual
    Basic .NET and ASP .NET
    http://support.microsoft.com/default.aspx?scid=KB;EN-US;319180



    --
    Saravana
    http://dotnetjunkies.com/WebLog/saravana/
    www.ExtremeExperts.com


    "Luis Esteban Valencia" <> wrote in message
    news:...
    > I have a page that generates a table depending on the querystring from a
    > master page. But as its a transaction history I want to show it in excel.
    > How can I generate an excel file from a DATASET?
    >
    >
    >
    > --
    > LUIS ESTEBAN VALENCIA
    > MICROSOFT DCE 2.
    > MIEMBRO ACTIVO DE ALIANZADEV
    >
    >
     
    Saravana, Nov 3, 2004
    #2
    1. Advertising

  3. try this way .... i am using Datagrid

    Response.Clear()
    Response.Buffer = True
    Response.ContentType = "application/vnd.ms-excel"
    Response.Charset = ""
    Dim oStringWriter As New System.IO.StringWriter
    Dim oHtmlTextWriter As New System.Web.UI.HtmlTextWriter(oStringWriter)

    oHtmlTextWriter.Write("<html><head>")
    oHtmlTextWriter.Write("</head><body>")

    oHtmlTextWriter.WriteBeginTag("form runat=server ")
    oHtmlTextWriter.WriteAttribute("target", "_blank")
    oHtmlTextWriter.Write(">")
    dgReport.RenderControl(oHtmlTextWriter)
    oHtmlTextWriter.Write("</form></body></html>")
    Response.Write(oStringWriter.ToString())
    Response.End()

    "Luis Esteban Valencia" wrote:

    > I have a page that generates a table depending on the querystring from a
    > master page. But as its a transaction history I want to show it in excel.
    > How can I generate an excel file from a DATASET?
    >
    >
    >
    > --
    > LUIS ESTEBAN VALENCIA
    > MICROSOFT DCE 2.
    > MIEMBRO ACTIVO DE ALIANZADEV
    >
    >
    >
     
    =?Utf-8?B?dmluYXk=?=, Nov 3, 2004
    #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. =?Utf-8?B?YWQ=?=
    Replies:
    1
    Views:
    851
    Steve C. Orr [MVP, MCSD]
    Oct 6, 2004
  2. =?Utf-8?B?U3JpZGhhcg==?=

    using Microsoft Excel image for Export to Excel button

    =?Utf-8?B?U3JpZGhhcg==?=, Dec 9, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    3,115
    =?Utf-8?B?U3JpZGhhcg==?=
    Dec 9, 2005
  3. =?Utf-8?B?SGVtYW50IFNpcGFoaW1hbGFuaQ==?=

    Export to Excel (Default File Type - Excel)

    =?Utf-8?B?SGVtYW50IFNpcGFoaW1hbGFuaQ==?=, Apr 24, 2006, in forum: ASP .Net
    Replies:
    15
    Views:
    17,534
    syed hassan
    May 21, 2009
  4. Sachin Salgarkar

    Export DataSet/ XML as Excel Sheet

    Sachin Salgarkar, Aug 4, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    7,555
    ritzkandy
    Sep 11, 2008
  5. =?Utf-8?B?TGFtaXM=?=

    export dataset to excel

    =?Utf-8?B?TGFtaXM=?=, Aug 29, 2007, in forum: ASP .Net
    Replies:
    5
    Views:
    501
    =?Utf-8?B?TGFtaXM=?=
    Aug 29, 2007
Loading...

Share This Page