Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Export Issue

Reply
Thread Tools

Export Issue

 
 
Gunawan
Guest
Posts: n/a
 
      06-08-2007
Hi there,
I am using this code that I have found in the internet to generate excel
output.

Response.Clear();
Response.AddHeader("content-disposition",
"attachment;filename=kirim.xls");
Response.Charset = "";

// If you want the option to open the Excel file without saving than
// comment out the line below
// Response.Cache.SetCacheability(HttpCacheability.No Cache);

Response.Cache.SetCacheability(HttpCacheability.No Cache);
Response.ContentType = "application/vnd.xls";

System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite =
new HtmlTextWriter(stringWrite);

//gv.RenderControl(htmlWrite);
this.RenderControl(htmlWrite);

Response.Write(stringWrite.ToString());
Response.End();


But I've got this error (Exception) bellow when Response.End() issue.
"Unable to evaluate expression because the code is optimized or a native
frame is on top of the call stack."

How to correct this issue?

Regards,
Gun


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Export to PDF with google maps + msacces export Maarten Porters Ruby 1 07-28-2008 01:45 PM
export to excel issue =?Utf-8?B?TmVv?= ASP .Net 2 10-09-2006 12:28 PM
Urgent - Asp.NET Datagrid export Excel - landscape Issue =?Utf-8?B?ZGlub28=?= ASP .Net 4 08-07-2006 09:48 PM
Export to Excel issue (C#) Arvind R ASP .Net 2 02-24-2006 04:03 AM
Invalid export DLL or export format =?Utf-8?B?RGF2aWQgVmFsbGU=?= ASP .Net 0 10-29-2003 11:46 AM



Advertisments