Convert DataGrid to Excel

D

DOKOM

Hi
I wrote a small function, thaht converts a DataGrid to Excel from a Web-Application (C#)
Running the function with 100-200 rows it just works fine
Starting a "special" Report produces a DataDrid with about 13650 Rows. Now the conversion to Excel does not work
Are there any known restrictions
The code looks like this
<----
private void btnExcel_Click(object sender, System.EventArgs e

Response.ContentType = "application/vnd.ms-excel"
Response.Charset = ""
this.EnableViewState = false
System.IO.StringWriter tw = new System.IO.StringWriter(System.Globalization.CultureInfo.CurrentCulture)
System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw)
ReportGrid.RenderControl(hw)
Response.Write(makeHTMLcode(tw.ToString()))
Response.End()

<---->
 
K

Ken Cox [Microsoft MVP]

Maybe there's a control character or format command in the 201st row that is
throwing Excel off?

Excel should be able to accept 65,536 rows.
 
D

DOKOM

I think that the Request to render the Excel sheet is not send by the browser (IE6). After filling and showing the DataGrid the IEXPLORE-Process uses about 170 MB of Memory
When I press the "Excel" Button in my Webpage nothing happens. Neither private void btnExcel_Click () is called nor page functions like OnInit(...) or InitilaizeComponents(...)

Any more Ideas?
Thanks in advance


----- Ken Cox [Microsoft MVP] wrote: ----

Maybe there's a control character or format command in the 201st row that is
throwing Excel off

Excel should be able to accept 65,536 rows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,828
Latest member
LauraCastr

Latest Threads

Top