Help needed creating .CSV with XSLT!

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
 
M

Michael Nemtsev, MVP

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
 
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
 
M

Martin Honnen

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.
 
J

John Mott

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
 
S

Smith

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
 

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,776
Messages
2,569,603
Members
45,188
Latest member
Crypto TaxSoftware

Latest Threads

Top