Export datagrid to Excel with a lot of rows

Discussion in 'ASP .Net' started by bnob, Jul 28, 2006.

  1. bnob

    bnob Guest

    Hello

    Here's my code to export a datagrid to Exel :
    Response.Clear()
    Response.Buffer = True
    Response.ContentType = "application/vnd.ms-excel"
    Response.Charset = ""
    Dim monStringWriter As StringWriter = New StringWriter
    Dim monHtmlTextWriter As HtmlTextWriter = New
    HtmlTextWriter(monStringWriter)
    monDG.RenderControl(monHtmlTextWriter)
    Response.Write(monStringWriter.ToString())
    Response.End()

    It's work perfectly, but when my datagrid displays for exeample 10000 rows,
    the export doesn't work.
    Instead I have the page impossible to display !!!!

    Any idea ?
     
    bnob, Jul 28, 2006
    #1
    1. Advertising

  2. bnob

    Winista Guest

    Try this way...

    http://www.netomatix.com/gridexporttocsv.aspx

    "bnob" <> wrote in message
    news:%...
    > Hello
    >
    > Here's my code to export a datagrid to Exel :
    > Response.Clear()
    > Response.Buffer = True
    > Response.ContentType = "application/vnd.ms-excel"
    > Response.Charset = ""
    > Dim monStringWriter As StringWriter = New StringWriter
    > Dim monHtmlTextWriter As HtmlTextWriter = New
    > HtmlTextWriter(monStringWriter)
    > monDG.RenderControl(monHtmlTextWriter)
    > Response.Write(monStringWriter.ToString())
    > Response.End()
    >
    > It's work perfectly, but when my datagrid displays for exeample 10000
    > rows,
    > the export doesn't work.
    > Instead I have the page impossible to display !!!!
    >
    > Any idea ?
    >
    >
    >
    >
    >
    >
     
    Winista, Jul 28, 2006
    #2
    1. Advertising

  3. bnob

    Amirallia Guest

    Winista a formulé ce vendredi :
    > Try this way...
    >
    > http://www.netomatix.com/gridexporttocsv.aspx
    >
    > "bnob" <> wrote in message
    > news:%...
    >> Hello
    >>
    >> Here's my code to export a datagrid to Exel :
    >> Response.Clear()
    >> Response.Buffer = True
    >> Response.ContentType = "application/vnd.ms-excel"
    >> Response.Charset = ""
    >> Dim monStringWriter As StringWriter = New StringWriter
    >> Dim monHtmlTextWriter As HtmlTextWriter = New
    >> HtmlTextWriter(monStringWriter)
    >> monDG.RenderControl(monHtmlTextWriter)
    >> Response.Write(monStringWriter.ToString())
    >> Response.End()
    >>
    >> It's work perfectly, but when my datagrid displays for exeample 10000 rows,
    >> the export doesn't work.
    >> Instead I have the page impossible to display !!!!
    >>
    >> Any idea ?
    >>
    >>
    >>
    >>
    >>
    >>


    It doesn't work....

    No file is created to the server... It' directely display a white page
    !!!
     
    Amirallia, Jul 31, 2006
    #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. sunilkumar Reddy via DotNetMonster.com

    Export to excel data from Datagrid rows

    sunilkumar Reddy via DotNetMonster.com, Jun 27, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    675
    sunilkumar Reddy via DotNetMonster.com
    Jun 27, 2005
  2. The Colonel
    Replies:
    1
    Views:
    478
    The Colonel
    Sep 28, 2005
  3. The Colonel
    Replies:
    5
    Views:
    1,456
    The Colonel
    Oct 3, 2005
  4. Amirallia
    Replies:
    5
    Views:
    1,991
    Amirallia
    Aug 2, 2006
  5. bnob

    Export datagrid with a lot of rows to Excel

    bnob, Jul 28, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    139
Loading...

Share This Page