473,382 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Help needed creating .CSV with XSLT!


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
Sep 3 '07 #1
8 1724
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
SHello,
SMy task is to create a .csv file using XSLT. Does anyone have some
Sexperience with doing this with C# 2.0?
SMy ASP.NET 2.0 application will get a DataTable object and stream a
S.CSV
Sfile to the user. I understand, XSLT would be the smarter way of
Sdoing this.
SAny help will be highly appreciated.
S>
SMany thanks in advance
SSmith
Sep 3 '07 #2

<Michael Nemtsev>; "MVP" <ne*****@msn.comwrote in message
news:3d*************************@msnews.microsoft. com...
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
Thank you Michael,
I will give it a try.
Smith
Sep 3 '07 #3
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
Sep 3 '07 #4
Smith wrote:
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.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Sep 3 '07 #5

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

"Smith" <Sm***@pricateemail.comwrote in message
news:O3**************@TK2MSFTNGP03.phx.gbl...
>
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

Sep 3 '07 #6

"John Mott" <jo********@hotmail.comwrote in message
news:Oi**************@TK2MSFTNGP03.phx.gbl...
>
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
Sep 4 '07 #7
Hi Smith,

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

john

"Smith" <Sm***@pricateemail.comwrote in message
news:uN**************@TK2MSFTNGP06.phx.gbl...
>
"John Mott" <jo********@hotmail.comwrote in message
news:Oi**************@TK2MSFTNGP03.phx.gbl...
>>
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

Sep 4 '07 #8
I did sent you an email. below my email:

pr***********@yahoo.dk

cheers
Smith
Sep 4 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ringo Langly | last post by:
Hi all, I'm a seasoned web programmer, but I've never touched XSLT. It's always been one of those acronyms I've never needed to educate myself on. Now... we're working with a web content...
5
by: Chris Kettenbach | last post by:
Good Morning, Sorry for xposting. Just need a liitle help. I have an xml file that's generated from a database. How do I select distinct values from a field in xslt and then loop through the...
4
by: Chris Kettenbach | last post by:
Hi Peter, I get error when processing the stylesheet. It errors here. <xsl:for-each select="registration)=1]"> specifically: Expression does not return a DOM node. registration)=1]<--
1
by: Torrent | last post by:
The Following is an Error I am getting using VS.NET 2003. When I bind the XML and XSLT Document together in Internet Explorer it works fine. However when I attempt to Load the File with the...
7
by: Roshawn Dawson | last post by:
Hi, I have an xslt file located in the root directory. It is used by an aspx pages in both the root directory and a subdirectory. But for some strange reason, the aspx page in the subdirectory...
5
by: Thierry | last post by:
Let's say I have the following tags in an xml: <World> <Country>Canada</Country> <Hemisphere>North</Hemisphere> <Weather climate="cold" forecast="snow"> <CommandAction>$(HOME)\calculate.py...
0
by: SamStamport | last post by:
Hello, I have coded a C# program that passes an argument list to my XSLT file. I get no errors, but I don't get any output either. Here's what I want to do: pass a parameter that is an XPath...
6
Gaiason
by: Gaiason | last post by:
Hi XML/XSLT masters and gurus, I am a newbie in XML/XSLT and have been reading up XML/XSLT in order to convert a XML generated from a OCR engine to another format of XML. I am truly stuck at this...
2
Dormilich
by: Dormilich | last post by:
Hi, I'm testing my classes for a web page and I stumble upon an error I don't have a clue what it means: Error: Fatal error: Can't use method return value in write context in "output.php" on...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.