Printing A CSV File

Hi everyone,

I was already able to export my DataGridView data to a CSV file. My problem now is how can i print the CSV file via a command button in my VB.net application? I really need this one any help would be appreciated. Thank you so much in advance!!!

Stan

[281 byte] By [Rain3204] at [2007-12-28]
# 1

Hi,

A quick way.>> Change the path and filename for your file though.

Process.start("C:\myCSVfile.csv")

as it is just a text file this should start Notepad for you or your default text file viewer

then PRINT it from there.

Regards,

S_DS

Spidermans_DarkSide at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2

Start looking here..

shouldnt take too much to figure out formatting etc

http://msdn2.microsoft.com/en-us/library/system.windows.forms.printdialog.aspx

Kenny99 at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 3

If you want your application to handle the printing, there is quite a bit of code to work with and you need to be familiar with some GDI principles ... check out System.Drawing.Printing.

Alternatively, head on over to http://www.developer.com/net/asp/article.php/3102381 where you will find a vb class that probably do all you want to do.

Hope this helps get you started.

Richard

DickDonny at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 4

hey!

As u could already export ur DGV data to a csv file...it will be great if u could post the code here...i am trying this for the past 2 days!

cheers

doener at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic General...