Help needed creating .CSV with XSLT!

  • Thread starter Thread starter Smith
  • Start date Start date
S

Smith

Hello,
My task is to create a .csv file using XSLT. Does anyone have some
experience with doing this with C# 2.0?
My ASP.NET 2.0 application will get a DataTable object and stream a .CSV
file to the user. I understand, XSLT would be the smarter way of doing this.

Any help will be highly appreciated.

Many thanks in advance
Smith
 
Hello Smith,

XSLT only complicate this, just write from DataSet to CSV directly
http://www.netomatix.com/GridExportToCSV.aspx

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


S> Hello,
S> My task is to create a .csv file using XSLT. Does anyone have some
S> experience with doing this with C# 2.0?
S> My ASP.NET 2.0 application will get a DataTable object and stream a
S> .CSV
S> file to the user. I understand, XSLT would be the smarter way of
S> doing this.
S> Any help will be highly appreciated.
S>
S> Many thanks in advance
S> Smith
 
Hi Michael,
The code is great. But i have the following question. How would i stream the
output directly to the client 's browser?

Many thanks in advance
Smith
 
Smith said:
The code is great. But i have the following question. How would i stream the
output directly to the client 's browser?

This line
StreamWriter sw = new StreamWriter(Server.MapPath("~/GridData.txt"),
false);
creates a StreamWriter over a file, then that StreamWriter instance sw
is used in the code.
You want to write to the Page.Response respectively its Output so doing
TextWriter sw = Page.Response.Output;
should suffice.
You should also set Response.ContentType to the MIME type for CSV before
you send anything to the client.
 
Hi Smith,

If I could get your email I can send you a zip file with a complete sample,
with compression. I just did this last a couple of weeks ago. email me
privately if you wish.

john
 
John Mott said:
Hi Smith,

If I could get your email I can send you a zip file with a complete
sample, with compression. I just did this last a couple of weeks ago.
email me privately if you wish.

john

Hi John,
I have sent you the email.
I'm looking forward to recieve your code.

Cheers
Smith
 
Back
Top