borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (how to pass encrypted query string ?)Next Topic (Monitor all file system activity on a target server.) New Topic New Poll Post Reply
AndreaVB Forum : ASP.Net : How Do i generate a CSV file from ASP.NET
Poster Message
zimcoder
Level: VB Lord


Registered: 27-10-2003
Posts: 225

icon How Do i generate a CSV file from ASP.NET

I am developing a shopping cart in ASP.NET .. I need to generate a report in CSV of all the orders placed. How do i generate one from a web form

____________________________
BrainBench ADO.NET and ASP.NET Certified Developer

12-12-2003 at 10:52 AM
View Profile Send Email to User Show All Posts | Quote Reply
MacD
Level: Big Cheese

Registered: 06-01-2004
Posts: 19
icon Re: How Do i generate a CSV file from ASP.NET

A .CSV file is a comma seperated file so when writing to the file just make sure that you use a comma "," to seperate the output values so that they will be written to different cells.

Below are the steps you can follow:

1. create an object of File type
2. make your file name extension be .csv

Lets say you want to write 3 Headers in the file in the first line do it as follows :

fs.Write(heading1)
fs.Write(",") // comma for separating headers to be in  
                  // different cells of the file
fs.Write(heading2)
fs.Write(",")
fs.WriteLn(heading3)

Where :

fs = Object of type File
heading1-3 = text to be written as headers

I hope this may assist you.




06-01-2004 at 03:05 PM
View Profile Send Email to User Show All Posts | Quote Reply
zimcoder
Level: VB Lord


Registered: 27-10-2003
Posts: 225
icon Re: How Do i generate a CSV file from ASP.NET

Thanks MacD .. It that simple Hugh.. OK   Will implement it

____________________________
BrainBench ADO.NET and ASP.NET Certified Developer

06-01-2004 at 03:11 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : ASP.Net : How Do i generate a CSV file from ASP.NET
Previous Topic (how to pass encrypted query string ?)Next Topic (Monitor all file system activity on a target server.) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder