Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export Data to Exel or Word Document...

Status
Not open for further replies.

1x2z3

Programmer
Sep 18, 2003
39
0
0
ZA
How can i Export data to an exel speadsheet or word document by Adding a Command Button to my application. Datasource is Sql Server 2005 & Using Visual Studio 2005.
 
If you have reports in your project, you can use

Code:
Dim rpt as new ReportName
rpt.ExportToDisk(Type, FileName)

For excel you can use the type: CrystalDecisions.Shared.ExportFormatType.Excel.

For Word, you can use the type:
CrystalDecisions.Shared.ExportFormatType.WordForWindows

This is based on CR 11. It may be different for other versions.
 

You can also do a google search. Try these terms: export data excel vb.net 2005. This search returned over 53,000 hits, including complete samples.
 
Thanx... Bluejay07 & PRPhx will try & check it out...
 
All depends on how you have your data. faq796-6739

-I hate Microsoft!
-Forever and always forward.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top