all groups > vb.net > march 2004 >
You're in the

vb.net

group:

Problem with MyGrid.RenderControl(hw) when many data


Problem with MyGrid.RenderControl(hw) when many data anniech2000 NO[at]SPAM hotmail-dot-com.no-spam.invalid
3/25/2004 9:53:42 PM
vb.net:
I want to export the datagrid to an excel file using htmltextwriter.
My coding are as follows:

Response.ContentType = "application/vnd.ms-excel"
Response.AppendHeader("Content-Disposition",
"attachment;filename=xxx.xls;")
Response.Charset = ""
Response.Buffer = False
Me.EnableViewState = False

Dim tw As New System.IO.StringWriter
Dim hw As New System.Web.UI.HtmlTextWriter(tw)

MyGrid.RenderControl(hw)

Response.Write(tw.ToString)
Response.Flush()
Response.Close()

However, when there is a lot of data in the grid, the application gets
error "Server Application Unavailable" on the line

MyGrid.RenderControl(hw).

Is there any size limit on the htmltextwriter? Is there any method to
get around with this problem?

Please help!
Thanks a lot! :roll:


Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
Re: Problem with MyGrid.RenderControl(hw) when many data Cor
3/26/2004 9:07:16 AM
Hi Anniech,

Do you know these two newsgroups
<news://msnews.microsoft.com/microsoft.public.dotnet.framework.aspnet>

<news://msnews.microsoft.com/microsoft.public.dotnet.framework.aspnet.datagr
idcontrol>

If I was you I would try it there (crossposted)

Cor

AddThis Social Bookmark Button