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!

Exporting a report to CSV format using Visual Basic 1

Status
Not open for further replies.

rvasquez

Programmer
Jun 8, 2001
7
0
0
US
Can some one help me out?
I’m trying to export a crystal report to a *.csv format, programmatically through VB.
I get this far but what I can’t seem to figure out is how to tell the application to save it.
Set CRXApp = CreateObject(“CrystalRunTime.Application”)
Set CRXRpt = CRXApp.OpenReport(strReportName)
CRXRpt.ExportOptions.FormatType = crEFTCommaSeparatedValues
CRXRpt.ExportOptions.DestinationType = crEDTDiskFile
CRXRpt.ExportOptions.UseReportDateFormat = True
CRXRpt.ExportOptions.UseReportNumberFormat = True
CRXRpt.ExportOptions.DiskFileName = “c:\aaaa\exportedTest.csv”

Any suggestion or recommendation would be great.
 
I found documentation than helped me with my problem.

all i was missing at the end of my code was:

CRXRpt.Export False

thanks anyway

R
 
This looks like something I am also trying to figure out. Are you willing to share the entire code?

clement@sccompanies.com
 
I would be happy to share the code with you. Give me some back ground on what your trying to do so that i can get the code that you need.

R
 
Hi - I am looking for how to export to CSV using the Print > export function in Crystal, which creates nothing except a file with the run date repeated for multiple. Did you find that you needed to use VB to export report data to CSV?
 
I have been able to do it both ways. The reason I was looking at VB (which by the way I am running as an Access module using the timer events) was that I was looking at how to automate the process so I didn't have to be at my desk to create the csv.

It should work by using the method you describe.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top