Export datagrid with a lot of rows to Excel

Discussion in 'ASP .Net Datagrid Control' 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. Advertisements

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:
    749
    sunilkumar Reddy via DotNetMonster.com
    Jun 27, 2005
  2. The Colonel
    Replies:
    1
    Views:
    546
    The Colonel
    Sep 28, 2005
  3. The Colonel
    Replies:
    5
    Views:
    1,587
    The Colonel
    Oct 3, 2005
  4. bnob
    Replies:
    2
    Views:
    577
    Amirallia
    Jul 31, 2006
  5. Amirallia
    Replies:
    5
    Views:
    2,171
    Amirallia
    Aug 2, 2006
  6. hangar18

    Export to Excel > 65000 Rows

    hangar18, Oct 24, 2008, in forum: ASP .Net
    Replies:
    3
    Views:
    1,256
  7. enggr
    Replies:
    0
    Views:
    1,769
    enggr
    Jun 30, 2010
  8. Paul D. Fox

    Display a Datagrid & Export a Datagrid to Excel

    Paul D. Fox, Jul 21, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    344
    Elton Wang
    Jul 21, 2005
Loading...