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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export Crystal Report to Excel

Status
Not open for further replies.

goofy

Programmer
Feb 3, 2001
30
0
0
US
Hi All,

I have a crystal report(.rpt file). I need to export that to excel in my vb(6.0) application. Everything works great. The only issue i have is, when i export the file to excel, the Page Header is not getting exported. So the excel has only the data without column names.

Any ideas?

This is what i am doing.

cdlAdHoc.ShowSave
cdlAdHoc.Filter = "*.xls"
strFileName = cdlAdHoc.FileName

constr = "DSN=" & gDSN & ";"
constr = constr & "UID=" & gLoginID & ";"
constr = constr & "PWD=" & gPWD & ";"
constr = constr & "DATABASE=" & gDatabase & ";"


' Here print the report
frmReports.crReports.Connect = constr
frmReports.crReports.Destination = crptToFile
frmReports.crReports.PrintFileType = crEFTExcel80
frmReports.crReports.PrintFileName = strFileName


frmReports.crReports.ReportFileName = App.Path & "\rptNickGeneralInfo.rpt"

frmReports.crReports.Action = 1
 
From what I remember you have to choose Excel Extended (or whatever it's called)

Patrick

"It works in practice, now we have to figure out if it works in theory?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top