StreamWriter and Export to Excel

S

Serkan

Hi guys
i tried this example at
http://www.codeproject.com/dotnet/ExportToExcel.asp

but
i add these statements below

HttpResponse response = HttpContext.Current.Response;
response.ContentType = "application/vnd.ms-excel";
response.AddHeader("Content-Disposition", "attachment;filename=\"" +
fileName + "\""); //filenam koddan geliyor
response.Write(excelDoc);

when run the page it appear file save window and i save the file but the
file contains only "System.IO.StreamWriter"

i write below code to est data is created or not created in excel file

excelDoc = new System.IO.StreamWriter("c:\deneme.xml", true,
System.Text.Encoding.Default);

and i see that data is true and written in excel

i think that is the problem how i can write
Response.Write(excelDoc.ToString()); I'm sure this
row(Response.Write(excelDoc.ToString()); ) is not correct.
so my question is how can i write StreamWriter to web page to save file as
excel...

Thank you for helping....
 

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

Similar Threads

Adding Text to ListView Excel Export 0
export to excel issue 2
export to excel 2
export to excel 0
Export to excel !! 4
export to excel 0
Export Grid View to Excel 1
export to excel 1

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top