Problem with MyGrid.RenderControl(hw) when there i

Results 1 to 2 of 2

Thread: Problem with MyGrid.RenderControl(hw) when there i

  1. #1
    Join Date
    Dec 1969

    Default Problem with MyGrid.RenderControl(hw) when there i

    I want to export the datagrid to an excel file using htmltextwriter. My coding are as follows:<BR><BR> Response.ContentType = "application/"<BR> Response.AppendHeader("Content-Disposition", "attachment;filename=xxx.xls;")<BR> Response.Charset = ""<BR> Response.Buffer = False<BR> Me.EnableViewState = False<BR><BR> Dim tw As New System.IO.StringWriter<BR> Dim hw As New System.Web.UI.HtmlTextWriter(tw)<BR><BR> MyGrid.RenderControl(hw)<BR><BR> Response.Write(tw.ToString)<BR> Response.Flush()<BR> Response.Close()<BR><BR>However, when there is a lot of data in the grid, the application gets error "Server Application Unavailable" on the line <BR><BR>MyGrid.RenderControl(hw). <BR><BR>Is there any size limit on the htmltextwriter? Is there any method to get around with this problem? <BR><BR>Please help! <BR>Thanks a lot!

  2. #2

    Default RE: Problem with MyGrid.RenderControl(hw) when the

    I&#039;ve used that sWriter+htmlWriter approach many time and I&#039;ve never had an issue with it.<BR><BR>How much data?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts