Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

Help needed creating .CSV with XSLT!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Smith - 03 Sep 2007 12:16 GMT
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
Michael Nemtsev, MVP - 03 Sep 2007 13:25 GMT
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
Smith - 03 Sep 2007 14:03 GMT
<Michael Nemtsev>; "MVP" <nemtsev@msn.com> wrote in message
news:3d9fba1a33968c9bc906da728c4@msnews.microsoft.com...
> Hello Smith,
>
[quoted text clipped - 6 lines]
> "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

Thank you Michael,
I will give it a try.
Smith
Smith - 03 Sep 2007 14:38 GMT
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
Martin Honnen - 03 Sep 2007 16:01 GMT
> 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.

Signature

    Martin Honnen --- MVP XML
    http://JavaScript.FAQTs.com/

John Mott - 03 Sep 2007 17:46 GMT
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

> Hello,
> My task is to create a .csv file using XSLT. Does anyone have some
[quoted text clipped - 7 lines]
> Many thanks in advance
> Smith
Smith - 04 Sep 2007 09:25 GMT
> Hi Smith,
>
[quoted text clipped - 3 lines]
>
> john

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

Cheers
Smith
John Mott - 04 Sep 2007 17:30 GMT
Hi Smith,

I didn't get anything from you at johnmott59@hotmail.com

john

>> Hi Smith,
>>
[quoted text clipped - 10 lines]
> Cheers
> Smith
Smith - 04 Sep 2007 20:53 GMT
I did sent you an email. below my email:

price_smith11@yahoo.dk

cheers
Smith

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.