?
Solved

Streamwriter exporting a txt file to Excel format

Posted on 2006-05-30
5
Medium Priority
?
517 Views
Last Modified: 2012-08-14
Hi there,

I need to have Streamwriter export a file to Excel format and I cannot find the solution in the archives. Filestream is named fs and currently it exports to txt. How can I get it to write to Excel rather than txt?

StreamWriter sr = new StreamWriter(fs);
{
try
{
     sr.AutoFlush=true;
     sr.Write(txt);
}
finally
... etc etc..
0
Comment
Question by:boukaka
  • 3
  • 2
5 Comments
 
LVL 20

Expert Comment

by:REA_ANDREW
ID: 16790518
would CSV be an option?
0
 

Author Comment

by:boukaka
ID: 16790530
No, unfortunately the client is requesting an Excel file that gets dumped into an ftp folder automatically each night
0
 
LVL 20

Accepted Solution

by:
REA_ANDREW earned 2000 total points
ID: 16790558
ok, then this example from the Code Project Explains how. It encapsulates XML and ASP.NET C#

http://www.codeproject.com/csharp/excelxmlspreadsheet.asp

Hope this helps.
0
 

Author Comment

by:boukaka
ID: 16790569
What a great site, this should work, thanks!
0
 
LVL 20

Expert Comment

by:REA_ANDREW
ID: 16790573
Np,

I find the tutorials excellent too.

Cheers

Andrew
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month14 days, 2 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question